← Documents Documentation/userspace-api/media/v4l/vidioc-enumstd.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

VIDIOC_ENUMSTD·VIDIOC_SUBDEV_ENUMSTD ioctl

V4L2가 지원하는 아날로그 비디오 표준을 열거하고 v4l2_standard 구조체, PAL·NTSC·SECAM·ATSC 비트, 조합 마스크, timing·반송파 특성과 지역별 예외를 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/vidioc-enumstd.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

vidioc-enumstd.rst:1-351

V4L2가 지원하는 아날로그 비디오 표준을 열거하고 v4l2_standard 구조체, PAL·NTSC·SECAM·ATSC 비트, 조합 마스크, timing·반송파 특성과 지역별 예외를 설명합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_ENUMSTD:
5
6 *******************************************
7 ioctl VIDIOC_ENUMSTD, VIDIOC_SUBDEV_ENUMSTD
8 *******************************************
9
10 Name
11 ====
12
13 VIDIOC_ENUMSTD - VIDIOC_SUBDEV_ENUMSTD - Enumerate supported video standards
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_ENUMSTD
19
20 ``int ioctl(int fd, VIDIOC_ENUMSTD, struct v4l2_standard *argp)``
21
22 .. c:macro:: VIDIOC_SUBDEV_ENUMSTD
23
24 ``int ioctl(int fd, VIDIOC_SUBDEV_ENUMSTD, struct v4l2_standard *argp)``
25
26 Arguments
27 =========
28
29 ``fd``
30 File descriptor returned by :c:func:`open()`.
31
32 ``argp``
33 Pointer to struct :c:type:`v4l2_standard`.
34
35 Description
36 ===========
37
38 To query the attributes of a video standard, especially a custom (driver
39 defined) one, applications initialize the ``index`` field of struct
40 :c:type:`v4l2_standard` and call the :ref:`VIDIOC_ENUMSTD`
41 ioctl with a pointer to this structure. Drivers fill the rest of the
42 structure or return an ``EINVAL`` error code when the index is out of
43 bounds. To enumerate all standards applications shall begin at index
44 zero, incrementing by one until the driver returns ``EINVAL``. Drivers may
45 enumerate a different set of standards after switching the video input
46 or output. [#f1]_
47
48 .. c:type:: v4l2_standard
49
50 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
51
52 .. flat-table:: struct v4l2_standard
53 :header-rows: 0
54 :stub-columns: 0
55 :widths: 1 1 2
56
57 * - __u32
58 - ``index``
59 - Number of the video standard, set by the application.
60 * - :ref:`v4l2_std_id <v4l2-std-id>`
61 - ``id``
62 - The bits in this field identify the standard as one of the common
63 standards listed in :ref:`v4l2-std-id`, or if bits 32 to 63 are
64 set as custom standards. Multiple bits can be set if the hardware
65 does not distinguish between these standards, however separate
66 indices do not indicate the opposite. The ``id`` must be unique.
67 No other enumerated struct :c:type:`v4l2_standard` structure,
68 for this input or output anyway, can contain the same set of bits.
69 * - __u8
70 - ``name``\ [24]
71 - Name of the standard, a NUL-terminated ASCII string, for example:
72 "PAL-B/G", "NTSC Japan". This information is intended for the
73 user.
74 * - struct :c:type:`v4l2_fract`
75 - ``frameperiod``
76 - The frame period (not field period) is numerator / denominator.
77 For example M/NTSC has a frame period of 1001 / 30000 seconds.
78 * - __u32
79 - ``framelines``
80 - Total lines per frame including blanking, e. g. 625 for B/PAL.
81 * - __u32
82 - ``reserved``\ [4]
83 - Reserved for future extensions. Drivers must set the array to
84 zero.
85
86
87 .. c:type:: v4l2_fract
88
89 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
90
91 .. flat-table:: struct v4l2_fract
92 :header-rows: 0
93 :stub-columns: 0
94 :widths: 1 1 2
95
96 * - __u32
97 - ``numerator``
98 -
99 * - __u32
100 - ``denominator``
101 -
102
103 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
104
105 .. _v4l2-std-id:
106
107 .. flat-table:: typedef v4l2_std_id
108 :header-rows: 0
109 :stub-columns: 0
110 :widths: 1 1 2
111
112 * - __u64
113 - ``v4l2_std_id``
114 - This type is a set, each bit representing another video standard
115 as listed below and in :ref:`video-standards`. The 32 most
116 significant bits are reserved for custom (driver defined) video
117 standards.
118
119
120 .. code-block:: c
121
122 #define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
123 #define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
124 #define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
125 #define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
126 #define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
127 #define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
128 #define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
129 #define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
130
131 #define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
132 #define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
133 #define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
134 #define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
135
136 ``V4L2_STD_PAL_60`` is a hybrid standard with 525 lines, 60 Hz refresh
137 rate, and PAL color modulation with a 4.43 MHz color subcarrier. Some
138 PAL video recorders can play back NTSC tapes in this mode for display on
139 a 50/60 Hz agnostic PAL TV.
140
141 .. code-block:: c
142
143 #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
144 #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
145 #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
146
147 ``V4L2_STD_NTSC_443`` is a hybrid standard with 525 lines, 60 Hz refresh
148 rate, and NTSC color modulation with a 4.43 MHz color subcarrier.
149
150 .. code-block:: c
151
152 #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
153
154 #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
155 #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
156 #define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
157 #define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
158 #define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
159 #define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
160 #define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
161 #define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
162
163 /* ATSC/HDTV */
164 #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
165 #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
166
167 ``V4L2_STD_ATSC_8_VSB`` and ``V4L2_STD_ATSC_16_VSB`` are U.S.
168 terrestrial digital TV standards. Presently the V4L2 API does not
169 support digital TV. See also the Linux DVB API at
170 `https://linuxtv.org <https://linuxtv.org>`__.
171
172 .. code-block:: c
173
174 #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |
175 V4L2_STD_PAL_B1 |
176 V4L2_STD_PAL_G)
177 #define V4L2_STD_B (V4L2_STD_PAL_B |
178 V4L2_STD_PAL_B1 |
179 V4L2_STD_SECAM_B)
180 #define V4L2_STD_GH (V4L2_STD_PAL_G |
181 V4L2_STD_PAL_H |
182 V4L2_STD_SECAM_G |
183 V4L2_STD_SECAM_H)
184 #define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |
185 V4L2_STD_PAL_D1 |
186 V4L2_STD_PAL_K)
187 #define V4L2_STD_PAL (V4L2_STD_PAL_BG |
188 V4L2_STD_PAL_DK |
189 V4L2_STD_PAL_H |
190 V4L2_STD_PAL_I)
191 #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |
192 V4L2_STD_NTSC_M_JP |
193 V4L2_STD_NTSC_M_KR)
194 #define V4L2_STD_MN (V4L2_STD_PAL_M |
195 V4L2_STD_PAL_N |
196 V4L2_STD_PAL_Nc |
197 V4L2_STD_NTSC)
198 #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |
199 V4L2_STD_SECAM_K |
200 V4L2_STD_SECAM_K1)
201 #define V4L2_STD_DK (V4L2_STD_PAL_DK |
202 V4L2_STD_SECAM_DK)
203
204 #define V4L2_STD_SECAM (V4L2_STD_SECAM_B |
205 V4L2_STD_SECAM_G |
206 V4L2_STD_SECAM_H |
207 V4L2_STD_SECAM_DK |
208 V4L2_STD_SECAM_L |
209 V4L2_STD_SECAM_LC)
210
211 #define V4L2_STD_525_60 (V4L2_STD_PAL_M |
212 V4L2_STD_PAL_60 |
213 V4L2_STD_NTSC |
214 V4L2_STD_NTSC_443)
215 #define V4L2_STD_625_50 (V4L2_STD_PAL |
216 V4L2_STD_PAL_N |
217 V4L2_STD_PAL_Nc |
218 V4L2_STD_SECAM)
219
220 #define V4L2_STD_UNKNOWN 0
221 #define V4L2_STD_ALL (V4L2_STD_525_60 |
222 V4L2_STD_625_50)
223
224 .. raw:: latex
225
226 \begingroup
227 \tiny
228 \setlength{\tabcolsep}{2pt}
229
230 .. NTSC/M PAL/M /N /B /D /H /I SECAM/B /D /K1 /L
231 .. tabularcolumns:: |p{1.43cm}|p{1.38cm}|p{1.59cm}|p{1.7cm}|p{1.7cm}|p{1.17cm}|p{0.64cm}|p{1.71cm}|p{1.6cm}|p{1.07cm}|p{1.07cm}|p{1.07cm}|
232
233 .. _video-standards:
234
235 .. flat-table:: Video Standards (based on :ref:`itu470`)
236 :header-rows: 1
237 :stub-columns: 0
238
239 * - Characteristics
240 - M/NTSC [#f2]_
241 - M/PAL
242 - N/PAL [#f3]_
243 - B, B1, G/PAL
244 - D, D1, K/PAL
245 - H/PAL
246 - I/PAL
247 - B, G/SECAM
248 - D, K/SECAM
249 - K1/SECAM
250 - L/SECAM
251 * - Frame lines
252 - :cspan:`1` 525
253 - :cspan:`8` 625
254 * - Frame period (s)
255 - :cspan:`1` 1001/30000
256 - :cspan:`8` 1/25
257 * - Chrominance sub-carrier frequency (Hz)
258 - 3579545 ± 10
259 - 3579611.49 ± 10
260 - 4433618.75 ± 5
261
262 (3582056.25 ± 5)
263 - :cspan:`3` 4433618.75 ± 5
264 - 4433618.75 ± 1
265 - :cspan:`2` f\ :sub:`OR` = 4406250 ± 2000,
266
267 f\ :sub:`OB` = 4250000 ± 2000
268 * - Nominal radio-frequency channel bandwidth (MHz)
269 - 6
270 - 6
271 - 6
272 - B: 7; B1, G: 8
273 - 8
274 - 8
275 - 8
276 - 8
277 - 8
278 - 8
279 - 8
280 * - Sound carrier relative to vision carrier (MHz)
281 - 4.5
282 - 4.5
283 - 4.5
284 - 5.5 ± 0.001 [#f4]_ [#f5]_ [#f6]_ [#f7]_
285 - 6.5 ± 0.001
286 - 5.5
287 - 5.9996 ± 0.0005
288 - 5.5 ± 0.001
289 - 6.5 ± 0.001
290 - 6.5
291 - 6.5 [#f8]_
292
293 .. raw:: latex
294
295 \endgroup
296
297
298 Return Value
299 ============
300
301 On success 0 is returned, on error -1 and the ``errno`` variable is set
302 appropriately. The generic error codes are described at the
303 :ref:`Generic Error Codes <gen-errors>` chapter.
304
305 EINVAL
306 The struct :c:type:`v4l2_standard` ``index`` is out
307 of bounds.
308
309 ENODATA
310 Standard video timings are not supported for this input or output.
311
312 .. [#f1]
313 The supported standards may overlap and we need an unambiguous set to
314 find the current standard returned by :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`.
315
316 .. [#f2]
317 Japan uses a standard similar to M/NTSC (V4L2_STD_NTSC_M_JP).
318
319 .. [#f3]
320 The values in brackets apply to the combination N/PAL a.k.a.
321 N\ :sub:`C` used in Argentina (V4L2_STD_PAL_Nc).
322
323 .. [#f4]
324 In the Federal Republic of Germany, Austria, Italy, the Netherlands,
325 Slovakia and Switzerland a system of two sound carriers is used, the
326 frequency of the second carrier being 242.1875 kHz above the
327 frequency of the first sound carrier. For stereophonic sound
328 transmissions a similar system is used in Australia.
329
330 .. [#f5]
331 New Zealand uses a sound carrier displaced 5.4996 ± 0.0005 MHz from
332 the vision carrier.
333
334 .. [#f6]
335 In Denmark, Finland, New Zealand, Sweden and Spain a system of two
336 sound carriers is used. In Iceland, Norway and Poland the same system
337 is being introduced. The second carrier is 5.85 MHz above the vision
338 carrier and is DQPSK modulated with 728 kbit/s sound and data
339 multiplex. (NICAM system)
340
341 .. [#f7]
342 In the United Kingdom, a system of two sound carriers is used. The
343 second sound carrier is 6.552 MHz above the vision carrier and is
344 DQPSK modulated with a 728 kbit/s sound and data multiplex able to
345 carry two sound channels. (NICAM system)
346
347 .. [#f8]
348 In France, a digital carrier 5.85 MHz away from the vision carrier
349 may be used in addition to the main sound carrier. It is modulated in
350 differentially encoded QPSK with a 728 kbit/s sound and data
351 multiplexer capable of carrying two sound channels. (NICAM system)
352

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

목적, 호출 형식과 인자

1-34

`VIDIOC_ENUMSTD`와 `VIDIOC_SUBDEV_ENUMSTD`는 장치 또는 sub-device가 지원하는 비디오 표준을 열거하는 ioctl입니다. 두 명령 모두 `struct v4l2_standard *argp`를 받습니다.

`VIDIOC_ENUMSTD`의 호출 형식은 `int ioctl(int fd, VIDIOC_ENUMSTD, struct v4l2_standard *argp)`이고 sub-device용 명령은 두 번째 인자만 `VIDIOC_SUBDEV_ENUMSTD`로 바뀝니다. `fd`는 `open()`이 반환한 파일 디스크립터입니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L

.. _VIDIOC_ENUMSTD:

*******************************************
ioctl VIDIOC_ENUMSTD, VIDIOC_SUBDEV_ENUMSTD
*******************************************

Name
====

VIDIOC_ENUMSTD - VIDIOC_SUBDEV_ENUMSTD - Enumerate supported video standards

Synopsis
========

.. c:macro:: VIDIOC_ENUMSTD

``int ioctl(int fd, VIDIOC_ENUMSTD, struct v4l2_standard *argp)``

.. c:macro:: VIDIOC_SUBDEV_ENUMSTD

``int ioctl(int fd, VIDIOC_SUBDEV_ENUMSTD, struct v4l2_standard *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open()`.

``argp``
    Pointer to struct :c:type:`v4l2_standard`.

비디오 표준 열거 절차

35-47

응용 프로그램은 특히 드라이버가 정의한 custom 표준의 속성을 조사하기 위해 `v4l2_standard.index`를 설정하고 ioctl을 호출합니다. 드라이버는 나머지 필드를 채우며 index가 범위를 벗어나면 `EINVAL`을 반환합니다.

모든 표준은 index 0부터 한 번에 1씩 증가시켜 조회하고 `EINVAL`에서 열거를 끝냅니다. 비디오 입력이나 출력을 전환하면 드라이버가 열거하는 표준 집합이 달라질 수 있으므로 전환 후 다시 조사해야 합니다.

지원 표준 집합은 서로 겹칠 수 있습니다. 현재 표준을 `VIDIOC_G_STD`의 반환값으로 모호하지 않게 찾을 수 있도록, 각 열거 항목의 `id` 비트 집합은 같은 입력 또는 출력 안에서 고유해야 합니다.

지원 표준 열거
입력 또는 출력 선택v4l2_standard.index=0ENUMSTD ioctl 호출id·name·timing 기록index를 1 증가EINVAL에서 종료입출력 전환 시 다시 열거

현재 입력 또는 출력에서 사용할 수 있는 표준을 순서대로 수집합니다.

Description
===========

To query the attributes of a video standard, especially a custom (driver
defined) one, applications initialize the ``index`` field of struct
:c:type:`v4l2_standard` and call the :ref:`VIDIOC_ENUMSTD`
ioctl with a pointer to this structure. Drivers fill the rest of the
structure or return an ``EINVAL`` error code when the index is out of
bounds. To enumerate all standards applications shall begin at index
zero, incrementing by one until the driver returns ``EINVAL``. Drivers may
enumerate a different set of standards after switching the video input
or output. [#f1]_

v4l2_standard와 v4l2_fract

48-102
struct v4l2_standard
형식필드의미
`__u32``index`응용 프로그램이 설정하는 비디오 표준 순번
`v4l2_std_id``id`일반 표준 또는 bit 32~63의 custom 표준을 식별하는 고유 비트 집합
`__u8[24]``name``PAL-B/G`, `NTSC Japan` 같은 NUL 종료 ASCII 사용자 표시 이름
`struct v4l2_fract``frameperiod`field 주기가 아닌 frame 주기. `numerator / denominator`초
`__u32``framelines`blanking을 포함한 frame당 전체 line 수. 예: B/PAL은 625
`__u32[4]``reserved`미래 확장용 배열. 드라이버가 모두 0으로 설정해야 함

응용 프로그램이 지정하는 순번과 드라이버가 반환하는 표준 속성입니다.

struct v4l2_fract
형식필드의미
`__u32``numerator`frame 주기 분자
`__u32``denominator`frame 주기 분모

분수로 표현하는 frame 주기의 두 구성 요소입니다.

`id`에는 하드웨어가 서로 구별하지 못하는 여러 표준 비트가 함께 설정될 수 있습니다. 반대로 표준이 서로 다른 index로 열거됐다는 사실만으로 하드웨어가 두 표준을 구별한다고 단정할 수는 없습니다.

같은 입력 또는 출력에서 다른 `v4l2_standard` 항목이 완전히 같은 `id` 비트 집합을 포함해서는 안 됩니다. 표준을 현재 상태와 대응시키려면 이 고유성이 필요합니다.

M/NTSC의 예에서 `frameperiod`는 `1001 / 30000`초입니다. 이 값은 field period가 아니라 완전한 frame 하나의 주기입니다.

.. c:type:: v4l2_standard

.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|

.. flat-table:: struct v4l2_standard
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u32
      - ``index``
      - Number of the video standard, set by the application.
    * - :ref:`v4l2_std_id <v4l2-std-id>`
      - ``id``
      - The bits in this field identify the standard as one of the common
	standards listed in :ref:`v4l2-std-id`, or if bits 32 to 63 are
	set as custom standards. Multiple bits can be set if the hardware
	does not distinguish between these standards, however separate
	indices do not indicate the opposite. The ``id`` must be unique.
	No other enumerated struct :c:type:`v4l2_standard` structure,
	for this input or output anyway, can contain the same set of bits.
    * - __u8
      - ``name``\ [24]
      - Name of the standard, a NUL-terminated ASCII string, for example:
	"PAL-B/G", "NTSC Japan". This information is intended for the
	user.
    * - struct :c:type:`v4l2_fract`
      - ``frameperiod``
      - The frame period (not field period) is numerator / denominator.
	For example M/NTSC has a frame period of 1001 / 30000 seconds.
    * - __u32
      - ``framelines``
      - Total lines per frame including blanking, e. g. 625 for B/PAL.
    * - __u32
      - ``reserved``\ [4]
      - Reserved for future extensions. Drivers must set the array to
	zero.


.. c:type:: v4l2_fract

.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|

.. flat-table:: struct v4l2_fract
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u32
      - ``numerator``
      -
    * - __u32
      - ``denominator``
      -

v4l2_std_id와 PAL 표준

103-140

`v4l2_std_id`는 각 비트가 하나의 비디오 표준을 나타내는 `__u64` 집합입니다. 최상위 32비트는 드라이버가 정의하는 custom 표준용으로 예약됩니다.

PAL 표준 비트
상수
`V4L2_STD_PAL_B``0x00000001`
`V4L2_STD_PAL_B1``0x00000002`
`V4L2_STD_PAL_G``0x00000004`
`V4L2_STD_PAL_H``0x00000008`
`V4L2_STD_PAL_I``0x00000010`
`V4L2_STD_PAL_D``0x00000020`
`V4L2_STD_PAL_D1``0x00000040`
`V4L2_STD_PAL_K``0x00000080`
`V4L2_STD_PAL_M``0x00000100`
`V4L2_STD_PAL_N``0x00000200`
`V4L2_STD_PAL_Nc``0x00000400`
`V4L2_STD_PAL_60``0x00000800`

원문 C 정의의 각 PAL 표준과 정확한 비트값입니다.

`V4L2_STD_PAL_60`은 525 line, 60 Hz refresh rate, PAL 색상 변조와 4.43 MHz 색 부반송파를 결합한 hybrid 표준입니다.

일부 PAL 비디오 레코더는 50/60 Hz를 모두 처리하는 PAL TV에 표시하기 위해 이 모드로 NTSC tape를 재생할 수 있습니다.

.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|

.. _v4l2-std-id:

.. flat-table:: typedef v4l2_std_id
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2

    * - __u64
      - ``v4l2_std_id``
      - This type is a set, each bit representing another video standard
	as listed below and in :ref:`video-standards`. The 32 most
	significant bits are reserved for custom (driver defined) video
	standards.


.. code-block:: c

    #define V4L2_STD_PAL_B          ((v4l2_std_id)0x00000001)
    #define V4L2_STD_PAL_B1         ((v4l2_std_id)0x00000002)
    #define V4L2_STD_PAL_G          ((v4l2_std_id)0x00000004)
    #define V4L2_STD_PAL_H          ((v4l2_std_id)0x00000008)
    #define V4L2_STD_PAL_I          ((v4l2_std_id)0x00000010)
    #define V4L2_STD_PAL_D          ((v4l2_std_id)0x00000020)
    #define V4L2_STD_PAL_D1         ((v4l2_std_id)0x00000040)
    #define V4L2_STD_PAL_K          ((v4l2_std_id)0x00000080)

    #define V4L2_STD_PAL_M          ((v4l2_std_id)0x00000100)
    #define V4L2_STD_PAL_N          ((v4l2_std_id)0x00000200)
    #define V4L2_STD_PAL_Nc         ((v4l2_std_id)0x00000400)
    #define V4L2_STD_PAL_60         ((v4l2_std_id)0x00000800)

``V4L2_STD_PAL_60`` is a hybrid standard with 525 lines, 60 Hz refresh
rate, and PAL color modulation with a 4.43 MHz color subcarrier. Some
PAL video recorders can play back NTSC tapes in this mode for display on
a 50/60 Hz agnostic PAL TV.

NTSC·SECAM·ATSC 표준

141-171
NTSC·SECAM·ATSC 표준 비트
계열상수
NTSC`V4L2_STD_NTSC_M``0x00001000`
NTSC`V4L2_STD_NTSC_M_JP``0x00002000`
NTSC`V4L2_STD_NTSC_443``0x00004000`
NTSC`V4L2_STD_NTSC_M_KR``0x00008000`
SECAM`V4L2_STD_SECAM_B``0x00010000`
SECAM`V4L2_STD_SECAM_D``0x00020000`
SECAM`V4L2_STD_SECAM_G``0x00040000`
SECAM`V4L2_STD_SECAM_H``0x00080000`
SECAM`V4L2_STD_SECAM_K``0x00100000`
SECAM`V4L2_STD_SECAM_K1``0x00200000`
SECAM`V4L2_STD_SECAM_L``0x00400000`
SECAM`V4L2_STD_SECAM_LC``0x00800000`
ATSC/HDTV`V4L2_STD_ATSC_8_VSB``0x01000000`
ATSC/HDTV`V4L2_STD_ATSC_16_VSB``0x02000000`

원문 C 정의의 각 표준과 정확한 비트값입니다.

`V4L2_STD_NTSC_443`은 525 line, 60 Hz refresh rate, NTSC 색상 변조와 4.43 MHz 색 부반송파를 결합한 hybrid 표준입니다.

`V4L2_STD_ATSC_8_VSB`와 `V4L2_STD_ATSC_16_VSB`는 미국 지상파 디지털 TV 표준입니다. 이 문서가 설명하는 V4L2 API는 현재 디지털 TV를 지원하지 않으므로 Linux DVB API를 사용해야 합니다.

.. code-block:: c

    #define V4L2_STD_NTSC_M         ((v4l2_std_id)0x00001000)
    #define V4L2_STD_NTSC_M_JP      ((v4l2_std_id)0x00002000)
    #define V4L2_STD_NTSC_443       ((v4l2_std_id)0x00004000)

``V4L2_STD_NTSC_443`` is a hybrid standard with 525 lines, 60 Hz refresh
rate, and NTSC color modulation with a 4.43 MHz color subcarrier.

.. code-block:: c

    #define V4L2_STD_NTSC_M_KR      ((v4l2_std_id)0x00008000)

    #define V4L2_STD_SECAM_B        ((v4l2_std_id)0x00010000)
    #define V4L2_STD_SECAM_D        ((v4l2_std_id)0x00020000)
    #define V4L2_STD_SECAM_G        ((v4l2_std_id)0x00040000)
    #define V4L2_STD_SECAM_H        ((v4l2_std_id)0x00080000)
    #define V4L2_STD_SECAM_K        ((v4l2_std_id)0x00100000)
    #define V4L2_STD_SECAM_K1       ((v4l2_std_id)0x00200000)
    #define V4L2_STD_SECAM_L        ((v4l2_std_id)0x00400000)
    #define V4L2_STD_SECAM_LC       ((v4l2_std_id)0x00800000)

    /* ATSC/HDTV */
    #define V4L2_STD_ATSC_8_VSB     ((v4l2_std_id)0x01000000)
    #define V4L2_STD_ATSC_16_VSB    ((v4l2_std_id)0x02000000)

``V4L2_STD_ATSC_8_VSB`` and ``V4L2_STD_ATSC_16_VSB`` are U.S.
terrestrial digital TV standards. Presently the V4L2 API does not
support digital TV. See also the Linux DVB API at
`https://linuxtv.org <https://linuxtv.org>`__.

표준 조합 마스크

172-223
v4l2_std_id 조합
상수포함하는 표준 또는 값
`V4L2_STD_PAL_BG``PAL_B | PAL_B1 | PAL_G`
`V4L2_STD_B``PAL_B | PAL_B1 | SECAM_B`
`V4L2_STD_GH``PAL_G | PAL_H | SECAM_G | SECAM_H`
`V4L2_STD_PAL_DK``PAL_D | PAL_D1 | PAL_K`
`V4L2_STD_PAL``PAL_BG | PAL_DK | PAL_H | PAL_I`
`V4L2_STD_NTSC``NTSC_M | NTSC_M_JP | NTSC_M_KR`
`V4L2_STD_MN``PAL_M | PAL_N | PAL_Nc | NTSC`
`V4L2_STD_SECAM_DK``SECAM_D | SECAM_K | SECAM_K1`
`V4L2_STD_DK``PAL_DK | SECAM_DK`
`V4L2_STD_SECAM``SECAM_B | SECAM_G | SECAM_H | SECAM_DK | SECAM_L | SECAM_LC`
`V4L2_STD_525_60``PAL_M | PAL_60 | NTSC | NTSC_443`
`V4L2_STD_625_50``PAL | PAL_N | PAL_Nc | SECAM`
`V4L2_STD_UNKNOWN``0`
`V4L2_STD_ALL``V4L2_STD_525_60 | V4L2_STD_625_50`

개별 표준 비트를 묶는 원문의 조합 상수입니다.

조합 상수는 서로 관련된 표준의 bitwise OR입니다. 응용 프로그램은 개별 비트뿐 아니라 `V4L2_STD_525_60`, `V4L2_STD_625_50`, `V4L2_STD_ALL` 같은 집합으로 지원 여부를 검사할 수 있습니다.

`V4L2_STD_UNKNOWN`은 비트가 하나도 설정되지 않은 값 0입니다. `V4L2_STD_ALL`은 이 API가 묶어 둔 525/60 및 625/50 아날로그 표준 집합 전체입니다.

.. code-block:: c

    #define V4L2_STD_PAL_BG         (V4L2_STD_PAL_B         |
		     V4L2_STD_PAL_B1        |
		     V4L2_STD_PAL_G)
    #define V4L2_STD_B              (V4L2_STD_PAL_B         |
		     V4L2_STD_PAL_B1        |
		     V4L2_STD_SECAM_B)
    #define V4L2_STD_GH             (V4L2_STD_PAL_G         |
		     V4L2_STD_PAL_H         |
		     V4L2_STD_SECAM_G       |
		     V4L2_STD_SECAM_H)
    #define V4L2_STD_PAL_DK         (V4L2_STD_PAL_D         |
		     V4L2_STD_PAL_D1        |
		     V4L2_STD_PAL_K)
    #define V4L2_STD_PAL            (V4L2_STD_PAL_BG        |
		     V4L2_STD_PAL_DK        |
		     V4L2_STD_PAL_H         |
		     V4L2_STD_PAL_I)
    #define V4L2_STD_NTSC           (V4L2_STD_NTSC_M        |
		     V4L2_STD_NTSC_M_JP     |
		     V4L2_STD_NTSC_M_KR)
    #define V4L2_STD_MN             (V4L2_STD_PAL_M         |
		     V4L2_STD_PAL_N         |
		     V4L2_STD_PAL_Nc        |
		     V4L2_STD_NTSC)
    #define V4L2_STD_SECAM_DK       (V4L2_STD_SECAM_D       |
		     V4L2_STD_SECAM_K       |
		     V4L2_STD_SECAM_K1)
    #define V4L2_STD_DK             (V4L2_STD_PAL_DK        |
		     V4L2_STD_SECAM_DK)

    #define V4L2_STD_SECAM          (V4L2_STD_SECAM_B       |
		     V4L2_STD_SECAM_G       |
		     V4L2_STD_SECAM_H       |
		     V4L2_STD_SECAM_DK      |
		     V4L2_STD_SECAM_L       |
		     V4L2_STD_SECAM_LC)

    #define V4L2_STD_525_60         (V4L2_STD_PAL_M         |
		     V4L2_STD_PAL_60        |
		     V4L2_STD_NTSC          |
		     V4L2_STD_NTSC_443)
    #define V4L2_STD_625_50         (V4L2_STD_PAL           |
		     V4L2_STD_PAL_N         |
		     V4L2_STD_PAL_Nc        |
		     V4L2_STD_SECAM)

    #define V4L2_STD_UNKNOWN        0
    #define V4L2_STD_ALL            (V4L2_STD_525_60        |
		     V4L2_STD_625_50)

비디오 표준 특성

224-297
Video Standards
표준frame lineframe 주기(s)색 부반송파(Hz)대역폭(MHz)음성 간격(MHz)
M/NTSC5251001/300003579545 ± 1064.5
M/PAL5251001/300003579611.49 ± 1064.5
N/PAL6251/254433618.75 ± 5; Nc는 3582056.25 ± 564.5
B, B1, G/PAL6251/254433618.75 ± 5B: 7; B1,G: 85.5 ± 0.001
D, D1, K/PAL6251/254433618.75 ± 586.5 ± 0.001
H/PAL6251/254433618.75 ± 585.5
I/PAL6251/254433618.75 ± 585.9996 ± 0.0005
B, G/SECAM6251/254433618.75 ± 185.5 ± 0.001
D, K/SECAM6251/25fOR=4406250 ± 2000; fOB=4250000 ± 200086.5 ± 0.001
K1/SECAM6251/25fOR=4406250 ± 2000; fOB=4250000 ± 200086.5
L/SECAM6251/25fOR=4406250 ± 2000; fOB=4250000 ± 200086.5

ITU-R BT.470 기반의 line 수, frame 주기, 색 부반송파, RF 채널 대역폭과 영상 대비 음성 반송파 간격입니다.

M/NTSC와 M/PAL은 525 line과 `1001/30000`초 frame 주기를 사용하고, 나머지 표의 표준은 625 line과 `1/25`초를 사용합니다.

N/PAL의 괄호 안 색 부반송파 값은 아르헨티나에서 사용하는 N/PAL 조합, 즉 `N_C`인 `V4L2_STD_PAL_Nc`에 적용됩니다.

표의 음성 간격은 sound carrier가 vision carrier에서 떨어진 주파수입니다. 여러 국가에서는 두 번째 반송파나 NICAM 디지털 음성 반송파를 추가하므로 아래 주석의 지역별 예외도 함께 적용해야 합니다.

.. raw:: latex

    \begingroup
    \tiny
    \setlength{\tabcolsep}{2pt}

..                            NTSC/M   PAL/M    /N       /B       /D       /H       /I        SECAM/B    /D       /K1     /L
.. tabularcolumns:: |p{1.43cm}|p{1.38cm}|p{1.59cm}|p{1.7cm}|p{1.7cm}|p{1.17cm}|p{0.64cm}|p{1.71cm}|p{1.6cm}|p{1.07cm}|p{1.07cm}|p{1.07cm}|

.. _video-standards:

.. flat-table:: Video Standards (based on :ref:`itu470`)
    :header-rows:  1
    :stub-columns: 0

    * - Characteristics
      - M/NTSC [#f2]_
      - M/PAL
      - N/PAL [#f3]_
      - B, B1, G/PAL
      - D, D1, K/PAL
      - H/PAL
      - I/PAL
      - B, G/SECAM
      - D, K/SECAM
      - K1/SECAM
      - L/SECAM
    * - Frame lines
      - :cspan:`1` 525
      - :cspan:`8` 625
    * - Frame period (s)
      - :cspan:`1` 1001/30000
      - :cspan:`8` 1/25
    * - Chrominance sub-carrier frequency (Hz)
      - 3579545 ± 10
      - 3579611.49 ± 10
      - 4433618.75 ± 5

	(3582056.25 ± 5)
      - :cspan:`3` 4433618.75 ± 5
      - 4433618.75 ± 1
      - :cspan:`2` f\ :sub:`OR` = 4406250 ± 2000,

	f\ :sub:`OB` = 4250000 ± 2000
    * - Nominal radio-frequency channel bandwidth (MHz)
      - 6
      - 6
      - 6
      - B: 7; B1, G: 8
      - 8
      - 8
      - 8
      - 8
      - 8
      - 8
      - 8
    * - Sound carrier relative to vision carrier (MHz)
      - 4.5
      - 4.5
      - 4.5
      - 5.5 ± 0.001  [#f4]_  [#f5]_  [#f6]_  [#f7]_
      - 6.5 ± 0.001
      - 5.5
      - 5.9996 ± 0.0005
      - 5.5 ± 0.001
      - 6.5 ± 0.001
      - 6.5
      - 6.5 [#f8]_

.. raw:: latex

    \endgroup

반환값, 오류와 지역별 주석

298-351

성공하면 0을 반환합니다. 오류가 발생하면 -1을 반환하고 `errno`를 적절한 값으로 설정하며, 공통 오류 코드는 Generic Error Codes 장을 따릅니다.

ENUMSTD 오류
errno조건
`EINVAL``struct v4l2_standard.index`가 범위를 벗어남
`ENODATA`현재 입력 또는 출력이 표준 비디오 timing을 지원하지 않음

표준 열거 중 명시적으로 정의된 오류입니다.

일본은 M/NTSC와 비슷한 `V4L2_STD_NTSC_M_JP`를 사용합니다. 아르헨티나의 N/PAL은 `V4L2_STD_PAL_Nc`이며 표에서 괄호로 표시한 값을 사용합니다.

지역별 음성 반송파 예외
지역추가 조건
독일·오스트리아·이탈리아·네덜란드·슬로바키아·스위스두 음성 반송파를 사용하며 두 번째는 첫 번째보다 242.1875 kHz 높음. 호주의 stereo 전송도 유사한 체계 사용
뉴질랜드음성 반송파가 영상 반송파에서 5.4996 ± 0.0005 MHz 떨어짐
덴마크·핀란드·뉴질랜드·스웨덴·스페인 및 도입 중인 아이슬란드·노르웨이·폴란드두 번째 반송파는 영상보다 5.85 MHz 높고 728 kbit/s 음성·데이터 multiplex를 DQPSK 변조하는 NICAM
영국두 번째 음성 반송파는 영상보다 6.552 MHz 높고 두 음성 채널을 운반하는 728 kbit/s multiplex를 DQPSK 변조하는 NICAM
프랑스주 음성 반송파 외에 영상에서 5.85 MHz 떨어진 디지털 반송파를 사용할 수 있으며, 두 음성 채널을 운반하는 728 kbit/s multiplexer를 차분 부호화 QPSK로 변조하는 NICAM

원문 주석 4~8의 두 번째 음성 반송파 및 NICAM 조건입니다.

입력 또는 출력 전환 뒤 지원 표준이 바뀔 수 있다는 점과 `id` 집합의 고유성은 `VIDIOC_G_STD`로 현재 표준을 판별할 때 특히 중요합니다.

Return Value
============

On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.

EINVAL
    The struct :c:type:`v4l2_standard` ``index`` is out
    of bounds.

ENODATA
    Standard video timings are not supported for this input or output.

.. [#f1]
   The supported standards may overlap and we need an unambiguous set to
   find the current standard returned by :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`.

.. [#f2]
   Japan uses a standard similar to M/NTSC (V4L2_STD_NTSC_M_JP).

.. [#f3]
   The values in brackets apply to the combination N/PAL a.k.a.
   N\ :sub:`C` used in Argentina (V4L2_STD_PAL_Nc).

.. [#f4]
   In the Federal Republic of Germany, Austria, Italy, the Netherlands,
   Slovakia and Switzerland a system of two sound carriers is used, the
   frequency of the second carrier being 242.1875 kHz above the
   frequency of the first sound carrier. For stereophonic sound
   transmissions a similar system is used in Australia.

.. [#f5]
   New Zealand uses a sound carrier displaced 5.4996 ± 0.0005 MHz from
   the vision carrier.

.. [#f6]
   In Denmark, Finland, New Zealand, Sweden and Spain a system of two
   sound carriers is used. In Iceland, Norway and Poland the same system
   is being introduced. The second carrier is 5.85 MHz above the vision
   carrier and is DQPSK modulated with 728 kbit/s sound and data
   multiplex. (NICAM system)

.. [#f7]
   In the United Kingdom, a system of two sound carriers is used. The
   second sound carrier is 6.552 MHz above the vision carrier and is
   DQPSK modulated with a 728 kbit/s sound and data multiplex able to
   carry two sound channels. (NICAM system)

.. [#f8]
   In France, a digital carrier 5.85 MHz away from the vision carrier
   may be used in addition to the main sound carrier. It is modulated in
   differentially encoded QPSK with a 728 kbit/s sound and data
   multiplexer capable of carrying two sound channels. (NICAM system)