Part I - Video for Linux API¶
This part describes the Video for Linux API version 2 (V4L2 API) specification.
Revision 4.5
- 1. Common API Elements
- 1.1. Opening and Closing Devices
- 1.2. Querying Capabilities
- 1.3. Application Priority
- 1.4. Video Inputs and Outputs
- 1.5. Audio Inputs and Outputs
- 1.6. Tuners and Modulators
- 1.7. Video Standards
- 1.8. Digital Video (DV) Timings
- 1.9. User Controls
- 1.10. Extended Controls API
- 1.11. Camera Control Reference
- 1.12. Flash Control Reference
- 1.13. Image Source Control Reference
- 1.14. Image Process Control Reference
- 1.15. Codec Control Reference
- 1.16. Stateless Codec Control Reference
- 1.17. JPEG Control Reference
- 1.18. Digital Video Control Reference
- 1.19. RF Tuner Control Reference
- 1.20. FM Transmitter Control Reference
- 1.21. FM Receiver Control Reference
- 1.22. Detect Control Reference
- 1.23. Colorimetry Control Reference
- 1.24. Guidelines for Video4Linux pixel format 4CCs
- 1.25. Data Formats
- 1.26. Single- and multi-planar APIs
- 1.27. Cropping, composing and scaling -- the SELECTION API
- 1.28. Image Cropping, Insertion and Scaling -- the CROP API
- 1.29. Streaming Parameters
- 2. Image Formats
- 2.1. Single-planar format structure
- 2.2. Multi-planar format structures
- 2.3. Standard Image Formats
- 2.4. Indexed Format
- 2.5. RGB Formats
- 2.6. Raw Bayer Formats
- 2.6.1. Description
- 2.6.1.1. V4L2_PIX_FMT_SRGGB8 (‘RGGB’), V4L2_PIX_FMT_SGRBG8 (‘GRBG’), V4L2_PIX_FMT_SGBRG8 (‘GBRG’), V4L2_PIX_FMT_SBGGR8 (‘BA81’),
- 2.6.1.2. V4L2_PIX_FMT_PISP_COMP1_RGGB (‘PC1R’), V4L2_PIX_FMT_PISP_COMP1_GRBG (‘PC1G’), V4L2_PIX_FMT_PISP_COMP1_GBRG (‘PC1g’), V4L2_PIX_FMT_PISP_COMP1_BGGR (‘PC1B), V4L2_PIX_FMT_PISP_COMP1_MONO (‘PC1M’), V4L2_PIX_FMT_PISP_COMP2_RGGB (‘PC2R’), V4L2_PIX_FMT_PISP_COMP2_GRBG (‘PC2G’), V4L2_PIX_FMT_PISP_COMP2_GBRG (‘PC2g’), V4L2_PIX_FMT_PISP_COMP2_BGGR (‘PC2B), V4L2_PIX_FMT_PISP_COMP2_MONO (‘PC2M’)
- 2.6.1.3. V4L2_PIX_FMT_SRGGB10 (‘RG10’), V4L2_PIX_FMT_SGRBG10 (‘BA10’), V4L2_PIX_FMT_SGBRG10 (‘GB10’), V4L2_PIX_FMT_SBGGR10 (‘BG10’),
- 2.6.1.4. V4L2_PIX_FMT_SRGGB10P (‘pRAA’), V4L2_PIX_FMT_SGRBG10P (‘pgAA’), V4L2_PIX_FMT_SGBRG10P (‘pGAA’), V4L2_PIX_FMT_SBGGR10P (‘pBAA’),
- 2.6.1.5. V4L2_PIX_FMT_SBGGR10ALAW8 (‘aBA8’), V4L2_PIX_FMT_SGBRG10ALAW8 (‘aGA8’), V4L2_PIX_FMT_SGRBG10ALAW8 (‘agA8’), V4L2_PIX_FMT_SRGGB10ALAW8 (‘aRA8’),
- 2.6.1.6. V4L2_PIX_FMT_SBGGR10DPCM8 (‘bBA8’), V4L2_PIX_FMT_SGBRG10DPCM8 (‘bGA8’), V4L2_PIX_FMT_SGRBG10DPCM8 (‘BD10’), V4L2_PIX_FMT_SRGGB10DPCM8 (‘bRA8’),
- 2.6.1.7. V4L2_PIX_FMT_IPU3_SBGGR10 (‘ip3b’), V4L2_PIX_FMT_IPU3_SGBRG10 (‘ip3g’), V4L2_PIX_FMT_IPU3_SGRBG10 (‘ip3G’), V4L2_PIX_FMT_IPU3_SRGGB10 (‘ip3r’)
- 2.6.1.8. V4L2_PIX_FMT_SRGGB12 (‘RG12’), V4L2_PIX_FMT_SGRBG12 (‘BA12’), V4L2_PIX_FMT_SGBRG12 (‘GB12’), V4L2_PIX_FMT_SBGGR12 (‘BG12’),
- 2.6.1.9. V4L2_PIX_FMT_SRGGB12P (‘pRCC’), V4L2_PIX_FMT_SGRBG12P (‘pgCC’), V4L2_PIX_FMT_SGBRG12P (‘pGCC’), V4L2_PIX_FMT_SBGGR12P (‘pBCC’),
- 2.6.1.10. V4L2_PIX_FMT_SRGGB14 (‘RG14’), V4L2_PIX_FMT_SGRBG14 (‘GR14’), V4L2_PIX_FMT_SGBRG14 (‘GB14’), V4L2_PIX_FMT_SBGGR14 (‘BG14’),
- 2.6.1.11. V4L2_PIX_FMT_SRGGB14P (‘pREE’), V4L2_PIX_FMT_SGRBG14P (‘pgEE’), V4L2_PIX_FMT_SGBRG14P (‘pGEE’), V4L2_PIX_FMT_SBGGR14P (‘pBEE’),
- 2.6.1.12. V4L2_PIX_FMT_SRGGB16 (‘RG16’), V4L2_PIX_FMT_SGRBG16 (‘GR16’), V4L2_PIX_FMT_SGBRG16 (‘GB16’), V4L2_PIX_FMT_SBGGR16 (‘BYR2’),
- 2.6.1. Description
- 2.7. YUV Formats
- 2.8. HSV Formats
- 2.9. Depth Formats
- 2.10. Compressed Formats
- 2.11. SDR Formats
- 2.12. Touch Formats
- 2.13. Metadata Formats
- 2.13.1. V4L2_META_FMT_D4XX (‘D4XX’)
- 2.13.2. V4L2_META_FMT_GENERIC_8 (‘MET8’), V4L2_META_FMT_GENERIC_CSI2_10 (‘MC1A’), V4L2_META_FMT_GENERIC_CSI2_12 (‘MC1C’), V4L2_META_FMT_GENERIC_CSI2_14 (‘MC1E’), V4L2_META_FMT_GENERIC_CSI2_16 (‘MC1G’), V4L2_META_FMT_GENERIC_CSI2_20 (‘MC1K’), V4L2_META_FMT_GENERIC_CSI2_24 (‘MC1O’)
- 2.13.3. V4L2_META_FMT_IPU3_PARAMS (‘ip3p’), V4L2_META_FMT_IPU3_3A (‘ip3s’)
- 2.13.4. V4L2_META_FMT_RPI_BE_CFG
- 2.13.5. V4L2_META_FMT_RPI_FE_CFG
- 2.13.6. V4L2_META_FMT_RPI_FE_STATS
- 2.13.7. V4L2_META_FMT_RK_ISP1_PARAMS (‘rk1p’), V4L2_META_FMT_RK_ISP1_STAT_3A (‘rk1s’), V4L2_META_FMT_RK_ISP1_EXT_PARAMS (‘rk1e’)
- 2.13.8. V4L2_META_FMT_UVC (‘UVCH’)
- 2.13.9. V4L2_META_FMT_VIVID (‘VIVD’)
- 2.13.10. V4L2_META_FMT_VSP1_HGO (‘VSPH’)
- 2.13.11. V4L2_META_FMT_VSP1_HGT (‘VSPT’)
- 2.14. Reserved Format Identifiers
- 2.15. Colorspaces
- 2.16. Defining Colorspaces in V4L2
- 2.17. Detailed Colorspace Descriptions
- 2.17.1. Colorspace SMPTE 170M (V4L2_COLORSPACE_SMPTE170M)
- 2.17.2. Colorspace Rec. 709 (V4L2_COLORSPACE_REC709)
- 2.17.3. Colorspace sRGB (V4L2_COLORSPACE_SRGB)
- 2.17.4. Colorspace opRGB (V4L2_COLORSPACE_OPRGB)
- 2.17.5. Colorspace BT.2020 (V4L2_COLORSPACE_BT2020)
- 2.17.6. Colorspace DCI-P3 (V4L2_COLORSPACE_DCI_P3)
- 2.17.7. Colorspace SMPTE 240M (V4L2_COLORSPACE_SMPTE240M)
- 2.17.8. Colorspace NTSC 1953 (V4L2_COLORSPACE_470_SYSTEM_M)
- 2.17.9. Colorspace EBU Tech. 3213 (V4L2_COLORSPACE_470_SYSTEM_BG)
- 2.17.10. Colorspace JPEG (V4L2_COLORSPACE_JPEG)
- 2.18. Detailed Transfer Function Descriptions
- 3. Input/Output
- 4. Interfaces
- 4.1. Video Capture Interface
- 4.2. Video Overlay Interface
- 4.3. Video Output Interface
- 4.4. Video Output Overlay Interface
- 4.5. Video Memory-To-Memory Interface
- 4.5.1. Memory-to-Memory Stateful Video Decoder Interface
- 4.5.1.1. Conventions and Notations Used in This Document
- 4.5.1.2. Glossary
- 4.5.1.3. State Machine
- 4.5.1.4. Querying Capabilities
- 4.5.1.5. Initialization
- 4.5.1.6. Capture Setup
- 4.5.1.7. Decoding
- 4.5.1.8. Seek
- 4.5.1.9. Dynamic Resolution Change
- 4.5.1.10. Drain
- 4.5.1.11. End of Stream
- 4.5.1.12. Commit Points
- 4.5.2. Memory-to-Memory Stateful Video Encoder Interface
- 4.5.3. Memory-to-memory Stateless Video Decoder Interface
- 4.5.1. Memory-to-Memory Stateful Video Decoder Interface
- 4.6. Raw VBI Data Interface
- 4.7. Sliced VBI Data Interface
- 4.7.1. Querying Capabilities
- 4.7.2. Supplemental Functions
- 4.7.3. Sliced VBI Format Negotiation
- 4.7.4. Reading and writing sliced VBI data
- 4.7.5. Sliced VBI Data in MPEG Streams
- 4.7.5.1. MPEG Stream Embedded, Sliced VBI Data Format: NONE
- 4.7.5.2. MPEG Stream Embedded, Sliced VBI Data Format: IVTV
- 4.7.5.3. struct v4l2_mpeg_vbi_fmt_ivtv
- 4.7.5.4. Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic field
- 4.7.5.5. structs v4l2_mpeg_vbi_itv0 and v4l2_mpeg_vbi_ITV0
- 4.7.5.6. struct v4l2_mpeg_vbi_ITV0
- 4.7.5.7. struct v4l2_mpeg_vbi_itv0_line
- 4.7.5.8. Line Identifiers for struct v4l2_mpeg_vbi_itv0_line id field
- 4.8. Radio Interface
- 4.9. RDS Interface
- 4.10. Software Defined Radio Interface (SDR)
- 4.11. Touch Devices
- 4.12. Event Interface
- 4.13. Sub-device Interface
- 4.14. Metadata Interface
- 5. Libv4l Userspace Library
- 6. Changes
- 6.1. Differences between V4L and V4L2
- 6.2. Changes of the V4L2 API
- 6.2.1. Early Versions
- 6.2.2. V4L2 Version 0.16 1999-01-31
- 6.2.3. V4L2 Version 0.18 1999-03-16
- 6.2.4. V4L2 Version 0.19 1999-06-05
- 6.2.5. V4L2 Version 0.20 (1999-09-10)
- 6.2.6. V4L2 Version 0.20 incremental changes
- 6.2.7. V4L2 Version 0.20 2000-11-23
- 6.2.8. V4L2 Version 0.20 2002-07-25
- 6.2.9. V4L2 in Linux 2.5.46, 2002-10
- 6.2.10. V4L2 2003-06-19
- 6.2.11. V4L2 2003-11-05
- 6.2.12. V4L2 in Linux 2.6.6, 2004-05-09
- 6.2.13. V4L2 in Linux 2.6.8
- 6.2.14. V4L2 spec erratum 2004-08-01
- 6.2.15. V4L2 in Linux 2.6.14
- 6.2.16. V4L2 in Linux 2.6.15
- 6.2.17. V4L2 spec erratum 2005-11-27
- 6.2.18. V4L2 spec erratum 2006-01-10
- 6.2.19. V4L2 spec erratum 2006-02-03
- 6.2.20. V4L2 spec erratum 2006-02-04
- 6.2.21. V4L2 in Linux 2.6.17
- 6.2.22. V4L2 spec erratum 2006-09-23 (Draft 0.15)
- 6.2.23. V4L2 in Linux 2.6.18
- 6.2.24. V4L2 in Linux 2.6.19
- 6.2.25. V4L2 spec erratum 2006-10-12 (Draft 0.17)
- 6.2.26. V4L2 in Linux 2.6.21
- 6.2.27. V4L2 in Linux 2.6.22
- 6.2.28. V4L2 in Linux 2.6.24
- 6.2.29. V4L2 in Linux 2.6.25
- 6.2.30. V4L2 in Linux 2.6.26
- 6.2.31. V4L2 in Linux 2.6.27
- 6.2.32. V4L2 in Linux 2.6.28
- 6.2.33. V4L2 in Linux 2.6.29
- 6.2.34. V4L2 in Linux 2.6.30
- 6.2.35. V4L2 in Linux 2.6.32
- 6.2.36. V4L2 in Linux 2.6.33
- 6.2.37. V4L2 in Linux 2.6.34
- 6.2.38. V4L2 in Linux 2.6.37
- 6.2.39. V4L2 in Linux 2.6.39
- 6.2.40. V4L2 in Linux 3.1
- 6.2.41. V4L2 in Linux 3.2
- 6.2.42. V4L2 in Linux 3.3
- 6.2.43. V4L2 in Linux 3.4
- 6.2.44. V4L2 in Linux 3.5
- 6.2.45. V4L2 in Linux 3.6
- 6.2.46. V4L2 in Linux 3.9
- 6.2.47. V4L2 in Linux 3.10
- 6.2.48. V4L2 in Linux 3.11
- 6.2.49. V4L2 in Linux 3.14
- 6.2.50. V4L2 in Linux 3.15
- 6.2.51. V4L2 in Linux 3.16
- 6.2.52. V4L2 in Linux 3.17
- 6.2.53. V4L2 in Linux 3.18
- 6.2.54. V4L2 in Linux 3.19
- 6.2.55. V4L2 in Linux 4.4
- 6.2.56. Relation of V4L2 to other Linux multimedia APIs
- 6.2.57. Experimental API Elements
- 6.2.58. Obsolete API Elements
- 7. Function Reference
- 7.1. V4L2 close()
- 7.2. V4L2 ioctl()
- 7.3. ioctl VIDIOC_CREATE_BUFS
- 7.4. ioctl VIDIOC_CROPCAP
- 7.5. ioctl VIDIOC_DBG_G_CHIP_INFO
- 7.6. ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER
- 7.7. ioctl VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD
- 7.8. ioctl VIDIOC_DQEVENT
- 7.9. ioctl VIDIOC_DV_TIMINGS_CAP, VIDIOC_SUBDEV_DV_TIMINGS_CAP
- 7.10. ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD
- 7.11. ioctl VIDIOC_ENUMAUDIO
- 7.12. ioctl VIDIOC_ENUMAUDOUT
- 7.13. ioctl VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS
- 7.14. ioctl VIDIOC_ENUM_FMT
- 7.15. ioctl VIDIOC_ENUM_FRAMESIZES
- 7.16. ioctl VIDIOC_ENUM_FRAMEINTERVALS
- 7.17. ioctl VIDIOC_ENUM_FREQ_BANDS
- 7.18. ioctl VIDIOC_ENUMINPUT
- 7.19. ioctl VIDIOC_ENUMOUTPUT
- 7.20. ioctl VIDIOC_ENUMSTD, VIDIOC_SUBDEV_ENUMSTD
- 7.21. ioctl VIDIOC_EXPBUF
- 7.22. ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO
- 7.23. ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT
- 7.24. ioctl VIDIOC_G_CROP, VIDIOC_S_CROP
- 7.25. ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL
- 7.26. ioctl VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS
- 7.27. ioctl VIDIOC_G_EDID, VIDIOC_S_EDID, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID
- 7.28. ioctl VIDIOC_G_ENC_INDEX
- 7.29. ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS, VIDIOC_TRY_EXT_CTRLS
- 7.30. ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF
- 7.31. ioctl VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT
- 7.32. ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY
- 7.33. ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT
- 7.34. ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP
- 7.35. ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR
- 7.36. ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT
- 7.37. ioctl VIDIOC_G_PARM, VIDIOC_S_PARM
- 7.38. ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY
- 7.39. ioctl VIDIOC_G_SELECTION, VIDIOC_S_SELECTION
- 7.40. ioctl VIDIOC_G_SLICED_VBI_CAP
- 7.41. ioctl VIDIOC_G_STD, VIDIOC_S_STD, VIDIOC_SUBDEV_G_STD, VIDIOC_SUBDEV_S_STD
- 7.42. ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER
- 7.43. ioctl VIDIOC_LOG_STATUS
- 7.44. ioctl VIDIOC_OVERLAY
- 7.45. ioctl VIDIOC_PREPARE_BUF
- 7.46. ioctl VIDIOC_QBUF, VIDIOC_DQBUF
- 7.47. ioctl VIDIOC_QUERYBUF
- 7.48. ioctl VIDIOC_QUERYCAP
- 7.49. ioctls VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL and VIDIOC_QUERYMENU
- 7.50. ioctl VIDIOC_QUERY_DV_TIMINGS
- 7.51. ioctl VIDIOC_QUERYSTD, VIDIOC_SUBDEV_QUERYSTD
- 7.52. ioctl VIDIOC_REQBUFS
- 7.53. ioctl VIDIOC_REMOVE_BUFS
- 7.54. ioctl VIDIOC_S_HW_FREQ_SEEK
- 7.55. ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF
- 7.56. ioctl VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL
- 7.57. ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE
- 7.58. ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE
- 7.59. ioctl VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP
- 7.60. ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT
- 7.61. ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL
- 7.62. ioctl VIDIOC_SUBDEV_G_ROUTING, VIDIOC_SUBDEV_S_ROUTING
- 7.63. ioctl VIDIOC_SUBDEV_G_SELECTION, VIDIOC_SUBDEV_S_SELECTION
- 7.64. ioctl VIDIOC_SUBDEV_G_CLIENT_CAP, VIDIOC_SUBDEV_S_CLIENT_CAP
- 7.65. ioctl VIDIOC_SUBDEV_QUERYCAP
- 7.66. ioctl VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT
- 7.67. V4L2 mmap()
- 7.68. V4L2 munmap()
- 7.69. V4L2 open()
- 7.70. V4L2 poll()
- 7.71. V4L2 read()
- 7.72. V4L2 select()
- 7.73. V4L2 write()
- 8. Common definitions for V4L2 and V4L2 subdev interfaces
- 9. Video For Linux Two Header File
- 10. Video Capture Example
- 11. Video Grabber example using libv4l
- 12. References
- 12.1. CEA 608-E
- 12.2. EN 300 294
- 12.3. ETS 300 231
- 12.4. ETS 300 706
- 12.5. ISO 13818-1
- 12.6. ISO 13818-2
- 12.7. ITU BT.470
- 12.8. ITU BT.601
- 12.9. ITU BT.653
- 12.10. ITU BT.709
- 12.11. ITU BT.1119
- 12.12. ITU-T Rec. H.264 Specification (04/2017 Edition)
- 12.13. ITU H.265/HEVC
- 12.14. JFIF
- 12.15. ITU-T.81
- 12.16. W3C JPEG JFIF
- 12.17. SMPTE 12M
- 12.18. SMPTE 170M
- 12.19. SMPTE 240M
- 12.20. SMPTE RP 431-2
- 12.21. SMPTE ST 2084
- 12.22. sRGB
- 12.23. sYCC
- 12.24. xvYCC
- 12.25. opRGB
- 12.26. ITU BT.2020
- 12.27. EBU Tech 3213
- 12.28. EBU Tech 3321
- 12.29. IEC 62106
- 12.30. NRSC-4-B
- 12.31. ISO 12232:2006
- 12.32. CEA-861-E
- 12.33. VESA DMT
- 12.34. E-DDC
- 12.35. EDID
- 12.36. HDCP
- 12.37. HDMI
- 12.38. HDMI2
- 12.39. DP
- 12.40. poynton
- 12.41. colimg
- 12.42. VP8
- 12.43. VP9
- 12.44. AV1
Revision and Copyright¶
Authors, in alphabetical order:
Ailus, Sakari <sakari.ailus@iki.fi>
Subdev selections API.
Carvalho Chehab, Mauro <mchehab+samsung@kernel.org>
Documented libv4l, designed and added v4l2grab example, Remote Controller chapter.
Dirks, Bill
Original author of the V4L2 API and documentation.
Figa, Tomasz <tfiga@chromium.org>
Documented the memory-to-memory decoder interface.
Documented the memory-to-memory encoder interface.
H Schimek, Michael <mschimek@gmx.at>
Original author of the V4L2 API and documentation.
Karicheri, Muralidharan <m-karicheri2@ti.com>
Documented the Digital Video timings API.
Osciak, Pawel <posciak@chromium.org>
Documented the memory-to-memory decoder interface.
Documented the memory-to-memory encoder interface.
Osciak, Pawel <pawel@osciak.com>
Designed and documented the multi-planar API.
Palosaari, Antti <crope@iki.fi>
SDR API.
Ribalda, Ricardo
Introduce HSV formats and other minor changes.
Rubli, Martin
Designed and documented the VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS ioctls.
Walls, Andy <awalls@md.metrocast.net>
Documented the fielded V4L2_MPEG_STREAM_VBI_FMT_IVTV MPEG stream embedded, sliced VBI data format in this specification.
Verkuil, Hans <hverkuil@xs4all.nl>
Designed and documented the VIDIOC_LOG_STATUS ioctl, the extended control ioctls, major parts of the sliced VBI API, the MPEG encoder and decoder APIs and the DV Timings API.
Copyright © 1999-2018: Bill Dirks, Michael H. Schimek, Hans Verkuil, Martin Rubli, Andy Walls, Muralidharan Karicheri, Mauro Carvalho Chehab, Pawel Osciak, Sakari Ailus & Antti Palosaari, Tomasz Figa
Except when explicitly stated as GPL, programming examples within this part can be used and distributed without restrictions.
Revision History¶
- revision:
4.10 / 2016-07-15 (rr)
Introduce HSV formats.
- revision:
4.5 / 2015-10-29 (rr)
Extend VIDIOC_G_EXT_CTRLS;. Replace ctrl_class with a new union with ctrl_class and which. Which is used to select the current value of the control or the default value.
- revision:
4.4 / 2015-05-26 (ap)
Renamed V4L2_TUNER_ADC to V4L2_TUNER_SDR. Added V4L2_CID_RF_TUNER_RF_GAIN control. Added transmitter support for Software Defined Radio (SDR) Interface.
- revision:
4.1 / 2015-02-13 (mcc)
Fix documentation for media controller device nodes and add support for DVB device nodes. Add support for Tuner sub-device.
- revision:
3.19 / 2014-12-05 (hv)
Rewrote Colorspace chapter, added new enum
v4l2_ycbcr_encoding
and enum
v4l2_quantization
fields to struct
v4l2_pix_format
, struct
v4l2_pix_format_mplane
and struct
v4l2_mbus_framefmt
.
- revision:
3.17 / 2014-08-04 (lp, hv)
Extended struct v4l2_pix_format
. Added
format flags. Added compound control types and VIDIOC_QUERY_EXT_CTRL.
- revision:
3.15 / 2014-02-03 (hv, ap)
Update several sections of “Common API Elements”: “Opening and Closing Devices” “Querying Capabilities”, “Application Priority”, “Video Inputs and Outputs”, “Audio Inputs and Outputs” “Tuners and Modulators”, “Video Standards” and “Digital Video (DV) Timings”. Added SDR API.
- revision:
3.14 / 2013-11-25 (rr)
Set width and height as unsigned on v4l2_rect.
- revision:
3.11 / 2013-05-26 (hv)
Remove obsolete VIDIOC_DBG_G_CHIP_IDENT ioctl.
- revision:
3.10 / 2013-03-25 (hv)
Remove obsolete and unused DV_PRESET ioctls: VIDIOC_G_DV_PRESET, VIDIOC_S_DV_PRESET, VIDIOC_QUERY_DV_PRESET and VIDIOC_ENUM_DV_PRESET. Remove the related v4l2_input/output capability flags V4L2_IN_CAP_PRESETS and V4L2_OUT_CAP_PRESETS. Added VIDIOC_DBG_G_CHIP_INFO.
- revision:
3.9 / 2012-12-03 (sa, sn)
Added timestamp types to v4l2_buffer. Added V4L2_EVENT_CTRL_CH_RANGE control event changes flag.
- revision:
3.6 / 2012-07-02 (hv)
Added VIDIOC_ENUM_FREQ_BANDS.
- revision:
3.5 / 2012-05-07 (sa, sn, hv)
Added V4L2_CTRL_TYPE_INTEGER_MENU and V4L2 subdev selections API. Improved the description of V4L2_CID_COLORFX control, added V4L2_CID_COLORFX_CBCR control. Added camera controls V4L2_CID_AUTO_EXPOSURE_BIAS, V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE, V4L2_CID_IMAGE_STABILIZATION, V4L2_CID_ISO_SENSITIVITY, V4L2_CID_ISO_SENSITIVITY_AUTO, V4L2_CID_EXPOSURE_METERING, V4L2_CID_SCENE_MODE, V4L2_CID_3A_LOCK, V4L2_CID_AUTO_FOCUS_START, V4L2_CID_AUTO_FOCUS_STOP, V4L2_CID_AUTO_FOCUS_STATUS and V4L2_CID_AUTO_FOCUS_RANGE. Added VIDIOC_ENUM_DV_TIMINGS, VIDIOC_QUERY_DV_TIMINGS and VIDIOC_DV_TIMINGS_CAP.
- revision:
3.4 / 2012-01-25 (sn)
Added JPEG compression control class.
- revision:
3.3 / 2012-01-11 (hv)
Added device_caps field to struct v4l2_capabilities.
- revision:
3.2 / 2011-08-26 (hv)
Added V4L2_CTRL_FLAG_VOLATILE.
- revision:
3.1 / 2011-06-27 (mcc, po, hv)
Documented that VIDIOC_QUERYCAP now returns a per-subsystem version instead of a per-driver one. Standardize an error code for invalid ioctl. Added V4L2_CTRL_TYPE_BITMASK.
- revision:
2.6.39 / 2011-03-01 (mcc, po)
Removed VIDIOC_*_OLD from videodev2.h header and update it to reflect latest changes. Added the multi-planar API.
- revision:
2.6.37 / 2010-08-06 (hv)
Removed obsolete vtx (videotext) API.
- revision:
2.6.33 / 2009-12-03 (mk)
Added documentation for the Digital Video timings API.
- revision:
2.6.32 / 2009-08-31 (mcc)
Now, revisions will match the kernel version where the V4L2 API changes will be used by the Linux Kernel. Also added Remote Controller chapter.
- revision:
0.29 / 2009-08-26 (ev)
Added documentation for string controls and for FM Transmitter controls.
- revision:
0.28 / 2009-08-26 (gl)
Added V4L2_CID_BAND_STOP_FILTER documentation.
- revision:
0.27 / 2009-08-15 (mcc)
Added libv4l and Remote Controller documentation; added v4l2grab and keytable application examples.
- revision:
0.26 / 2009-07-23 (hv)
Finalized the RDS capture API. Added modulator and RDS encoder capabilities. Added support for string controls.
- revision:
0.25 / 2009-01-18 (hv)
Added pixel formats VYUY, NV16 and NV61, and changed the debug ioctls VIDIOC_DBG_G/S_REGISTER and VIDIOC_DBG_G_CHIP_IDENT. Added camera controls V4L2_CID_ZOOM_ABSOLUTE, V4L2_CID_ZOOM_RELATIVE, V4L2_CID_ZOOM_CONTINUOUS and V4L2_CID_PRIVACY.
- revision:
0.24 / 2008-03-04 (mhs)
Added pixel formats Y16 and SBGGR16, new controls and a camera controls class. Removed VIDIOC_G/S_MPEGCOMP.
- revision:
0.23 / 2007-08-30 (mhs)
Fixed a typo in VIDIOC_DBG_G/S_REGISTER. Clarified the byte order of packed pixel formats.
- revision:
0.22 / 2007-08-29 (mhs)
Added the Video Output Overlay interface, new MPEG controls, V4L2_FIELD_INTERLACED_TB and V4L2_FIELD_INTERLACED_BT, VIDIOC_DBG_G/S_REGISTER, VIDIOC_(TRY_)ENCODER_CMD, VIDIOC_G_CHIP_IDENT, VIDIOC_G_ENC_INDEX, new pixel formats. Clarifications in the cropping chapter, about RGB pixel formats, the mmap(), poll(), select(), read() and write() functions. Typographical fixes.
- revision:
0.21 / 2006-12-19 (mhs)
Fixed a link in the VIDIOC_G_EXT_CTRLS section.
- revision:
0.20 / 2006-11-24 (mhs)
Clarified the purpose of the audioset field in struct v4l2_input and v4l2_output.
- revision:
0.19 / 2006-10-19 (mhs)
Documented V4L2_PIX_FMT_RGB444.
- revision:
0.18 / 2006-10-18 (mhs)
Added the description of extended controls by Hans Verkuil. Linked V4L2_PIX_FMT_MPEG to V4L2_CID_MPEG_STREAM_TYPE.
- revision:
0.17 / 2006-10-12 (mhs)
Corrected V4L2_PIX_FMT_HM12 description.
- revision:
0.16 / 2006-10-08 (mhs)
VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS are now part of the API.
- revision:
0.15 / 2006-09-23 (mhs)
Cleaned up the bibliography, added BT.653 and BT.1119. capture.c/start_capturing() for user pointer I/O did not initialize the buffer index. Documented the V4L MPEG and MJPEG VID_TYPEs and V4L2_PIX_FMT_SBGGR8. Updated the list of reserved pixel formats. See the history chapter for API changes.
- revision:
0.14 / 2006-09-14 (mr)
Added VIDIOC_ENUM_FRAMESIZES and VIDIOC_ENUM_FRAMEINTERVALS proposal for frame format enumeration of digital devices.
- revision:
0.13 / 2006-04-07 (mhs)
Corrected the description of struct v4l2_window
clips. New V4L2_STD_
and V4L2_TUNER_MODE_LANG1_LANG2 defines.
- revision:
0.12 / 2006-02-03 (mhs)
Corrected the description of struct v4l2_captureparm and v4l2_outputparm.
- revision:
0.11 / 2006-01-27 (mhs)
Improved the description of struct v4l2_tuner.
- revision:
0.10 / 2006-01-10 (mhs)
VIDIOC_G_INPUT and VIDIOC_S_PARM clarifications.
- revision:
0.9 / 2005-11-27 (mhs)
Improved the 525 line numbering diagram. Hans Verkuil and I rewrote the sliced VBI section. He also contributed a VIDIOC_LOG_STATUS page. Fixed VIDIOC_S_STD call in the video standard selection example. Various updates.
- revision:
0.8 / 2004-10-04 (mhs)
Somehow a piece of junk slipped into the capture example, removed.
- revision:
0.7 / 2004-09-19 (mhs)
Fixed video standard selection, control enumeration, downscaling and aspect example. Added read and user pointer i/o to video capture example.
- revision:
0.6 / 2004-08-01 (mhs)
v4l2_buffer changes, added video capture example, various corrections.
- revision:
0.5 / 2003-11-05 (mhs)
Pixel format erratum.
- revision:
0.4 / 2003-09-17 (mhs)
Corrected source and Makefile to generate a PDF. SGML fixes. Added latest API changes. Closed gaps in the history chapter.
- revision:
0.3 / 2003-02-05 (mhs)
Another draft, more corrections.
- revision:
0.2 / 2003-01-15 (mhs)
Second draft, with corrections pointed out by Gerd Knorr.
- revision:
0.1 / 2002-12-01 (mhs)
First draft, based on documentation by Bill Dirks and discussions on the V4L mailing list.