0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002
0003 ******************
0004 Compressed Formats
0005 ******************
0006
0007
0008 .. _compressed-formats:
0009
0010 .. raw:: latex
0011
0012 \small
0013
0014 .. tabularcolumns:: |p{5.8cm}|p{1.2cm}|p{10.3cm}|
0015
0016 .. cssclass:: longtable
0017
0018 .. flat-table:: Compressed Image Formats
0019 :header-rows: 1
0020 :stub-columns: 0
0021 :widths: 3 1 4
0022
0023 * - Identifier
0024 - Code
0025 - Details
0026 * .. _V4L2-PIX-FMT-JPEG:
0027
0028 - ``V4L2_PIX_FMT_JPEG``
0029 - 'JPEG'
0030 - TBD. See also :ref:`VIDIOC_G_JPEGCOMP <VIDIOC_G_JPEGCOMP>`,
0031 :ref:`VIDIOC_S_JPEGCOMP <VIDIOC_G_JPEGCOMP>`.
0032 * .. _V4L2-PIX-FMT-MPEG:
0033
0034 - ``V4L2_PIX_FMT_MPEG``
0035 - 'MPEG'
0036 - MPEG multiplexed stream. The actual format is determined by
0037 extended control ``V4L2_CID_MPEG_STREAM_TYPE``, see
0038 :ref:`mpeg-control-id`.
0039 * .. _V4L2-PIX-FMT-H264:
0040
0041 - ``V4L2_PIX_FMT_H264``
0042 - 'H264'
0043 - H264 Access Unit.
0044 The decoder expects one Access Unit per buffer.
0045 The encoder generates one Access Unit per buffer.
0046 If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
0047 then the decoder has no requirements since it can parse all the
0048 information from the raw bytestream.
0049 * .. _V4L2-PIX-FMT-H264-NO-SC:
0050
0051 - ``V4L2_PIX_FMT_H264_NO_SC``
0052 - 'AVC1'
0053 - H264 video elementary stream without start codes.
0054 * .. _V4L2-PIX-FMT-H264-MVC:
0055
0056 - ``V4L2_PIX_FMT_H264_MVC``
0057 - 'M264'
0058 - H264 MVC video elementary stream.
0059 * .. _V4L2-PIX-FMT-H264-SLICE:
0060
0061 - ``V4L2_PIX_FMT_H264_SLICE``
0062 - 'S264'
0063 - H264 parsed slice data, including slice headers, either with or
0064 without the start code, as extracted from the H264 bitstream.
0065 This format is adapted for stateless video decoders that implement an
0066 H264 pipeline with the :ref:`stateless_decoder`.
0067 This pixelformat has two modifiers that must be set at least once
0068 through the ``V4L2_CID_STATELESS_H264_DECODE_MODE``
0069 and ``V4L2_CID_STATELESS_H264_START_CODE`` controls.
0070 In addition, metadata associated with the frame to decode are
0071 required to be passed through the ``V4L2_CID_STATELESS_H264_SPS``,
0072 ``V4L2_CID_STATELESS_H264_PPS``,
0073 ``V4L2_CID_STATELESS_H264_SCALING_MATRIX``,
0074 ``V4L2_CID_STATELESS_H264_SLICE_PARAMS`` and
0075 ``V4L2_CID_STATELESS_H264_DECODE_PARAMS`` controls. See the
0076 :ref:`associated Codec Control IDs <v4l2-codec-stateless-h264>`.
0077 Exactly one output and one capture buffer must be provided for use
0078 with this pixel format. The output buffer must contain the
0079 appropriate number of macroblocks to decode a full
0080 corresponding frame to the matching capture buffer.
0081
0082 The syntax for this format is documented in :ref:`h264`, section
0083 7.3.2.8 "Slice layer without partitioning RBSP syntax" and the following
0084 sections.
0085
0086 * .. _V4L2-PIX-FMT-H263:
0087
0088 - ``V4L2_PIX_FMT_H263``
0089 - 'H263'
0090 - H263 video elementary stream.
0091 * .. _V4L2-PIX-FMT-MPEG1:
0092
0093 - ``V4L2_PIX_FMT_MPEG1``
0094 - 'MPG1'
0095 - MPEG1 Picture. Each buffer starts with a Picture header, followed
0096 by other headers as needed and ending with the Picture data.
0097 If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
0098 then the decoder has no requirements since it can parse all the
0099 information from the raw bytestream.
0100 * .. _V4L2-PIX-FMT-MPEG2:
0101
0102 - ``V4L2_PIX_FMT_MPEG2``
0103 - 'MPG2'
0104 - MPEG2 Picture. Each buffer starts with a Picture header, followed
0105 by other headers as needed and ending with the Picture data.
0106 If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
0107 then the decoder has no requirements since it can parse all the
0108 information from the raw bytestream.
0109 * .. _V4L2-PIX-FMT-MPEG2-SLICE:
0110
0111 - ``V4L2_PIX_FMT_MPEG2_SLICE``
0112 - 'MG2S'
0113 - MPEG-2 parsed slice data, as extracted from the MPEG-2 bitstream.
0114 This format is adapted for stateless video decoders that implement a
0115 MPEG-2 pipeline with the :ref:`stateless_decoder`.
0116 Metadata associated with the frame to decode is required to be passed
0117 through the ``V4L2_CID_STATELESS_MPEG2_SEQUENCE`` and
0118 ``V4L2_CID_STATELESS_MPEG2_PICTURE`` controls.
0119 Quantisation matrices can optionally be specified through the
0120 ``V4L2_CID_STATELESS_MPEG2_QUANTISATION`` control.
0121 See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-mpeg2>`.
0122 Exactly one output and one capture buffer must be provided for use with
0123 this pixel format. The output buffer must contain the appropriate number
0124 of macroblocks to decode a full corresponding frame to the matching
0125 capture buffer.
0126 * .. _V4L2-PIX-FMT-MPEG4:
0127
0128 - ``V4L2_PIX_FMT_MPEG4``
0129 - 'MPG4'
0130 - MPEG4 video elementary stream.
0131 * .. _V4L2-PIX-FMT-XVID:
0132
0133 - ``V4L2_PIX_FMT_XVID``
0134 - 'XVID'
0135 - Xvid video elementary stream.
0136 * .. _V4L2-PIX-FMT-VC1-ANNEX-G:
0137
0138 - ``V4L2_PIX_FMT_VC1_ANNEX_G``
0139 - 'VC1G'
0140 - VC1, SMPTE 421M Annex G compliant stream.
0141 * .. _V4L2-PIX-FMT-VC1-ANNEX-L:
0142
0143 - ``V4L2_PIX_FMT_VC1_ANNEX_L``
0144 - 'VC1L'
0145 - VC1, SMPTE 421M Annex L compliant stream.
0146 * .. _V4L2-PIX-FMT-VP8:
0147
0148 - ``V4L2_PIX_FMT_VP8``
0149 - 'VP80'
0150 - VP8 compressed video frame. The encoder generates one
0151 compressed frame per buffer, and the decoder requires one
0152 compressed frame per buffer.
0153 * .. _V4L2-PIX-FMT-VP8-FRAME:
0154
0155 - ``V4L2_PIX_FMT_VP8_FRAME``
0156 - 'VP8F'
0157 - VP8 parsed frame, including the frame header, as extracted from the container.
0158 This format is adapted for stateless video decoders that implement an
0159 VP8 pipeline with the :ref:`stateless_decoder`.
0160 Metadata associated with the frame to decode is required to be passed
0161 through the ``V4L2_CID_STATELESS_VP8_FRAME`` control.
0162 See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp8>`.
0163 Exactly one output and one capture buffer must be provided for use with
0164 this pixel format. The output buffer must contain the appropriate number
0165 of macroblocks to decode a full corresponding frame to the matching
0166 capture buffer.
0167
0168 * .. _V4L2-PIX-FMT-VP9:
0169
0170 - ``V4L2_PIX_FMT_VP9``
0171 - 'VP90'
0172 - VP9 compressed video frame. The encoder generates one
0173 compressed frame per buffer, and the decoder requires one
0174 compressed frame per buffer.
0175 * .. _V4L2-PIX-FMT-VP9-FRAME:
0176
0177 - ``V4L2_PIX_FMT_VP9_FRAME``
0178 - 'VP9F'
0179 - VP9 parsed frame, including the frame header, as extracted from the container.
0180 This format is adapted for stateless video decoders that implement a
0181 VP9 pipeline with the :ref:`stateless_decoder`.
0182 Metadata associated with the frame to decode is required to be passed
0183 through the ``V4L2_CID_STATELESS_VP9_FRAME`` and
0184 the ``V4L2_CID_STATELESS_VP9_COMPRESSED_HDR`` controls.
0185 See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-vp9>`.
0186 Exactly one output and one capture buffer must be provided for use with
0187 this pixel format. The output buffer must contain the appropriate number
0188 of macroblocks to decode a full corresponding frame to the matching
0189 capture buffer.
0190 * .. _V4L2-PIX-FMT-HEVC:
0191
0192 - ``V4L2_PIX_FMT_HEVC``
0193 - 'HEVC'
0194 - HEVC/H.265 Access Unit.
0195 The decoder expects one Access Unit per buffer.
0196 The encoder generates one Access Unit per buffer.
0197 If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
0198 then the decoder has no requirements since it can parse all the
0199 information from the raw bytestream.
0200 * .. _V4L2-PIX-FMT-HEVC-SLICE:
0201
0202 - ``V4L2_PIX_FMT_HEVC_SLICE``
0203 - 'S265'
0204 - HEVC parsed slice data, as extracted from the HEVC bitstream.
0205 This format is adapted for stateless video decoders that implement a
0206 HEVC pipeline (using the :ref:`mem2mem` and :ref:`media-request-api`).
0207 This pixelformat has two modifiers that must be set at least once
0208 through the ``V4L2_CID_MPEG_VIDEO_HEVC_DECODE_MODE``
0209 and ``V4L2_CID_MPEG_VIDEO_HEVC_START_CODE`` controls.
0210 Metadata associated with the frame to decode is required to be passed
0211 through the following controls:
0212 ``V4L2_CID_MPEG_VIDEO_HEVC_SPS``,
0213 ``V4L2_CID_MPEG_VIDEO_HEVC_PPS``, and
0214 ``V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS``.
0215 See the :ref:`associated Codec Control IDs <v4l2-codec-stateless-hevc>`.
0216 Buffers associated with this pixel format must contain the appropriate
0217 number of macroblocks to decode a full corresponding frame.
0218 * .. _V4L2-PIX-FMT-FWHT:
0219
0220 - ``V4L2_PIX_FMT_FWHT``
0221 - 'FWHT'
0222 - Video elementary stream using a codec based on the Fast Walsh Hadamard
0223 Transform. This codec is implemented by the vicodec ('Virtual Codec')
0224 driver. See the codec-fwht.h header for more details.
0225 :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM``
0226 since the decoder can parse all the information from the raw bytestream.
0227 * .. _V4L2-PIX-FMT-FWHT-STATELESS:
0228
0229 - ``V4L2_PIX_FMT_FWHT_STATELESS``
0230 - 'SFWH'
0231 - Same format as V4L2_PIX_FMT_FWHT but requires stateless codec implementation.
0232 Metadata associated with the frame to decode is required to be passed
0233 through the ``V4L2_CID_STATELESS_FWHT_PARAMS`` control.
0234 See the :ref:`associated Codec Control ID <codec-stateless-fwht>`.
0235
0236 .. raw:: latex
0237
0238 \normalsize