pixfmt-compressed.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. ******************
  4. Compressed Formats
  5. ******************
  6. .. _compressed-formats:
  7. .. raw:: latex
  8. \small
  9. .. tabularcolumns:: |p{5.8cm}|p{1.2cm}|p{10.3cm}|
  10. .. cssclass:: longtable
  11. .. flat-table:: Compressed Image Formats
  12. :header-rows: 1
  13. :stub-columns: 0
  14. :widths: 3 1 4
  15. * - Identifier
  16. - Code
  17. - Details
  18. * .. _V4L2-PIX-FMT-JPEG:
  19. - ``V4L2_PIX_FMT_JPEG``
  20. - 'JPEG'
  21. - TBD. See also :ref:`VIDIOC_G_JPEGCOMP <VIDIOC_G_JPEGCOMP>`,
  22. :ref:`VIDIOC_S_JPEGCOMP <VIDIOC_G_JPEGCOMP>`.
  23. * .. _V4L2-PIX-FMT-MPEG:
  24. - ``V4L2_PIX_FMT_MPEG``
  25. - 'MPEG'
  26. - MPEG multiplexed stream. The actual format is determined by
  27. extended control ``V4L2_CID_MPEG_STREAM_TYPE``, see
  28. :ref:`mpeg-control-id`.
  29. * .. _V4L2-PIX-FMT-H264:
  30. - ``V4L2_PIX_FMT_H264``
  31. - 'H264'
  32. - H264 Access Unit.
  33. The decoder expects one Access Unit per buffer.
  34. The encoder generates one Access Unit per buffer.
  35. If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
  36. then the decoder has no requirements since it can parse all the
  37. information from the raw bytestream.
  38. * .. _V4L2-PIX-FMT-H264-NO-SC:
  39. - ``V4L2_PIX_FMT_H264_NO_SC``
  40. - 'AVC1'
  41. - H264 video elementary stream without start codes.
  42. * .. _V4L2-PIX-FMT-H264-MVC:
  43. - ``V4L2_PIX_FMT_H264_MVC``
  44. - 'M264'
  45. - H264 MVC video elementary stream.
  46. * .. _V4L2-PIX-FMT-H264-SLICE:
  47. - ``V4L2_PIX_FMT_H264_SLICE``
  48. - 'S264'
  49. - H264 parsed slice data, including slice headers, either with or
  50. without the start code, as extracted from the H264 bitstream.
  51. This format is adapted for stateless video decoders that implement an
  52. H264 pipeline with the :ref:`stateless_decoder`.
  53. This pixelformat has two modifiers that must be set at least once
  54. through the ``V4L2_CID_STATELESS_H264_DECODE_MODE``
  55. and ``V4L2_CID_STATELESS_H264_START_CODE`` controls.
  56. In addition, metadata associated with the frame to decode are
  57. required to be passed through the ``V4L2_CID_STATELESS_H264_SPS``,
  58. ``V4L2_CID_STATELESS_H264_PPS``,
  59. ``V4L2_CID_STATELESS_H264_SCALING_MATRIX``,
  60. ``V4L2_CID_STATELESS_H264_SLICE_PARAMS`` and
  61. ``V4L2_CID_STATELESS_H264_DECODE_PARAMS`` controls. See the
  62. :ref:`associated Codec Control IDs <v4l2-codec-stateless-h264>`.
  63. Exactly one output and one capture buffer must be provided for use
  64. with this pixel format. The output buffer must contain the
  65. appropriate number of macroblocks to decode a full
  66. corresponding frame to the matching capture buffer.
  67. The syntax for this format is documented in :ref:`h264`, section
  68. 7.3.2.8 "Slice layer without partitioning RBSP syntax" and the following
  69. sections.
  70. * .. _V4L2-PIX-FMT-H263:
  71. - ``V4L2_PIX_FMT_H263``
  72. - 'H263'
  73. - H263 video elementary stream.
  74. * .. _V4L2-PIX-FMT-SPK:
  75. - ``V4L2_PIX_FMT_SPK``
  76. - 'SPK0'
  77. - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files
  78. * .. _V4L2-PIX-FMT-MPEG1:
  79. - ``V4L2_PIX_FMT_MPEG1``
  80. - 'MPG1'
  81. - MPEG1 Picture. Each buffer starts with a Picture header, followed
  82. by other headers as needed and ending with the Picture data.
  83. If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
  84. then the decoder has no requirements since it can parse all the
  85. information from the raw bytestream.
  86. * .. _V4L2-PIX-FMT-MPEG2:
  87. - ``V4L2_PIX_FMT_MPEG2``
  88. - 'MPG2'
  89. - MPEG2 Picture. Each buffer starts with a Picture header, followed
  90. by other headers as needed and ending with the Picture data.
  91. If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
  92. then the decoder has no requirements since it can parse all the
  93. information from the raw bytestream.
  94. * .. _V4L2-PIX-FMT-MPEG2-SLICE:
  95. - ``V4L2_PIX_FMT_MPEG2_SLICE``
  96. - 'MG2S'
  97. - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream.
  98. This format is adapted for stateless video decoders that implement a
  99. MPEG-2 pipeline with the :ref:`stateless_decoder`.
  100. Metadata associated with the frame to decode is required to be passed
  101. through the ``V4L2_CID_STATELESS_MPEG2_SEQUENCE`` and
  102. ``V4L2_CID_STATELESS_MPEG2_PICTURE`` controls.
  103. Quantisation matrices can optionally be specified through the
  104. ``V4L2_CID_STATELESS_MPEG2_QUANTISATION`` control.
  105. See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-mpeg2>`.
  106. Exactly one output and one capture buffer must be provided for use with
  107. this pixel format. The output buffer must contain the appropriate number
  108. of macroblocks to decode a full corresponding frame to the matching
  109. capture buffer.
  110. * .. _V4L2-PIX-FMT-MPEG4:
  111. - ``V4L2_PIX_FMT_MPEG4``
  112. - 'MPG4'
  113. - MPEG4 video elementary stream.
  114. * .. _V4L2-PIX-FMT-XVID:
  115. - ``V4L2_PIX_FMT_XVID``
  116. - 'XVID'
  117. - Xvid video elementary stream.
  118. * .. _V4L2-PIX-FMT-VC1-ANNEX-G:
  119. - ``V4L2_PIX_FMT_VC1_ANNEX_G``
  120. - 'VC1G'
  121. - VC1, SMPTE 421M Annex G compliant stream.
  122. * .. _V4L2-PIX-FMT-VC1-ANNEX-L:
  123. - ``V4L2_PIX_FMT_VC1_ANNEX_L``
  124. - 'VC1L'
  125. - VC1, SMPTE 421M Annex L compliant stream.
  126. * .. _V4L2-PIX-FMT-VP8:
  127. - ``V4L2_PIX_FMT_VP8``
  128. - 'VP80'
  129. - VP8 compressed video frame. The encoder generates one
  130. compressed frame per buffer, and the decoder requires one
  131. compressed frame per buffer.
  132. * .. _V4L2-PIX-FMT-VP8-FRAME:
  133. - ``V4L2_PIX_FMT_VP8_FRAME``
  134. - 'VP8F'
  135. - VP8 parsed frame, including the frame header, as extracted from the container.
  136. This format is adapted for stateless video decoders that implement an
  137. VP8 pipeline with the :ref:`stateless_decoder`.
  138. Metadata associated with the frame to decode is required to be passed
  139. through the ``V4L2_CID_STATELESS_VP8_FRAME`` control.
  140. See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp8>`.
  141. Exactly one output and one capture buffer must be provided for use with
  142. this pixel format. The output buffer must contain the appropriate number
  143. of macroblocks to decode a full corresponding frame to the matching
  144. capture buffer.
  145. * .. _V4L2-PIX-FMT-VP9:
  146. - ``V4L2_PIX_FMT_VP9``
  147. - 'VP90'
  148. - VP9 compressed video frame. The encoder generates one
  149. compressed frame per buffer, and the decoder requires one
  150. compressed frame per buffer.
  151. * .. _V4L2-PIX-FMT-VP9-FRAME:
  152. - ``V4L2_PIX_FMT_VP9_FRAME``
  153. - 'VP9F'
  154. - VP9 parsed frame, including the frame header, as extracted from the container.
  155. This format is adapted for stateless video decoders that implement a
  156. VP9 pipeline with the :ref:`stateless_decoder`.
  157. Metadata associated with the frame to decode is required to be passed
  158. through the ``V4L2_CID_STATELESS_VP9_FRAME`` and
  159. the ``V4L2_CID_STATELESS_VP9_COMPRESSED_HDR`` controls.
  160. See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp9>`.
  161. Exactly one output and one capture buffer must be provided for use with
  162. this pixel format. The output buffer must contain the appropriate number
  163. of macroblocks to decode a full corresponding frame to the matching
  164. capture buffer.
  165. * .. _V4L2-PIX-FMT-HEVC:
  166. - ``V4L2_PIX_FMT_HEVC``
  167. - 'HEVC'
  168. - HEVC/H.265 Access Unit.
  169. The decoder expects one Access Unit per buffer.
  170. The encoder generates one Access Unit per buffer.
  171. If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
  172. then the decoder has no requirements since it can parse all the
  173. information from the raw bytestream.
  174. * .. _V4L2-PIX-FMT-HEVC-SLICE:
  175. - ``V4L2_PIX_FMT_HEVC_SLICE``
  176. - 'S265'
  177. - HEVC parsed slice data, as extracted from the HEVC bitstream.
  178. This format is adapted for stateless video decoders that implement a
  179. HEVC pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
  180. This pixelformat has two modifiers that must be set at least once
  181. through the ``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE``
  182. and ``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE`` controls.
  183. Metadata associated with the frame to decode is required to be passed
  184. through the following controls:
  185. ``V4L2_CID_MPEG_VIDEO_HEVC_SPS``,
  186. ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``, and
  187. ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``.
  188. See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-hevc>`.
  189. Buffers associated with this pixel format must contain the appropriate
  190. number of macroblocks to decode a full corresponding frame.
  191. * .. _V4L2-PIX-FMT-FWHT:
  192. - ``V4L2_PIX_FMT_FWHT``
  193. - 'FWHT'
  194. - Video elementary stream using a codec based on the Fast Walsh Hadamard
  195. Transform. This codec is implemented by the vicodec ('Virtual Codec')
  196. driver. See the codec-fwht.h header for more details.
  197. :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
  198. since the decoder can parse all the information from the raw bytestream.
  199. * .. _V4L2-PIX-FMT-FWHT-STATELESS:
  200. - ``V4L2_PIX_FMT_FWHT_STATELESS``
  201. - 'SFWH'
  202. - Same format as V4L2_PIX_FMT_FWHT but requires stateless codec implementation.
  203. Metadata associated with the frame to decode is required to be passed
  204. through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.
  205. See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.
  206. * .. _V4L2-PIX-FMT-RV30:
  207. - ``V4L2_PIX_FMT_RV30``
  208. - 'RV30'
  209. - RealVideo, or also spelled as Real Video, is a suite of
  210. proprietary video compression formats developed by
  211. RealNetworks - the specific format changes with the version.
  212. RealVideo codecs are identified by four-character codes.
  213. RV30 corresponds to RealVideo 8, suspected to be based
  214. largely on an early draft of H.264
  215. * .. _V4L2-PIX-FMT-RV40:
  216. - ``V4L2_PIX_FMT_RV40``
  217. - 'RV40'
  218. - RV40 represents RealVideo 9 and RealVideo 10.
  219. RealVideo 9, suspected to be based on H.264.
  220. RealVideo 10, aka RV9 EHQ, This refers to an improved encoder
  221. for the RV9 format that is fully backwards compatible with
  222. RV9 players - the format and decoder did not change, only
  223. the encoder did. As a result, it uses the same FourCC.
  224. * .. _V4L2-PIX-FMT-AV1-FRAME:
  225. - ``V4L2_PIX_FMT_AV1_FRAME``
  226. - 'AV1F'
  227. - AV1 parsed frame, including the frame header, as extracted from the container.
  228. This format is adapted for stateless video decoders that implement a AV1
  229. pipeline with the :ref:`stateless_decoder`. Metadata associated with the
  230. frame to decode is required to be passed through the
  231. ``V4L2_CID_STATELESS_AV1_SEQUENCE``, ``V4L2_CID_STATELESS_AV1_FRAME``,
  232. and ``V4L2_CID_STATELESS_AV1_TILE_GROUP_ENTRY`` controls.
  233. See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-av1>`.
  234. Exactly one output and one capture buffer must be provided for use with
  235. this pixel format. The output buffer must contain the appropriate number
  236. of macroblocks to decode a full corresponding frame to the matching
  237. capture buffer.
  238. * .. _V4L2-PIX-FMT-AV1:
  239. - ``V4L2_PIX_FMT_AV1``
  240. - 'AV01'
  241. - AV1 compressed video frame. This format is adapted for implementing AV1
  242. pipeline. The decoder implements stateful video decoder and expects one
  243. temporal unit per buffer in OBU stream format.
  244. The encoder generates one Temporal Unit per buffer.
  245. .. raw:: latex
  246. \normalsize