VAAPI encoders
Wrappers for hardware encoders accessible via VAAPI.
These encoders only accept input in VAAPI hardware surfaces. If you have input in software frames, use the 'hwupload' filter to upload them to the GPU.
The following standard libavcodec options are used:
- 'g' / 'gop_size'
- 'bf' / 'max_b_frames'
- 'profile'
If not set, this will be determined automatically from the format of the input frames and the profiles supported by the driver.
- 'level'
- 'b' / 'bit_rate'
- 'maxrate' / 'rc_max_rate'
- 'bufsize' / 'rc_buffer_size'
- 'rc_init_occupancy' / 'rc_initial_buffer_occupancy'
- 'compression_level'
Speed / quality tradeoff: higher values are faster / worse quality.
- 'q' / 'global_quality'
Size / quality tradeoff: higher values are smaller / worse quality.
- 'qmin'
- 'qmax'
- 'i_qfactor' / 'i_quant_factor'
- 'i_qoffset' / 'i_quant_offset'
- 'b_qfactor' / 'b_quant_factor'
- 'b_qoffset' / 'b_quant_offset'
- 'slices'
All encoders support the following options:
- 'low_power'
-
Some drivers/platforms offer a second encoder for some codecs intended to use less power than the default encoder; setting this option will attempt to use that encoder. Note that it may support a reduced feature set, so some other options may not be available in this mode.
- 'idr_interval'
-
Set the number of normal intra frames between full-refresh (IDR) frames in open-GOP mode. The intra frames are still IRAPs, but will not include global headers and may have non-decodable leading pictures.
- 'b_depth'
-
Set the B-frame reference depth. When set to one (the default), all B-frames will refer only to P- or I-frames. When set to greater values multiple layers of B-frames will be present, frames in each layer only referring to frames in higher layers.
- 'rc_mode'
-
Set the rate control mode to use. A given driver may only support a subset of modes.
Possible modes:
- 'auto'
-
Choose the mode automatically based on driver support and the other options. This is the default.
- 'CQP'
-
Constant-quality.
- 'CBR'
-
Constant-bitrate.
- 'VBR'
-
Variable-bitrate.
- 'ICQ'
-
Intelligent constant-quality.
- 'QVBR'
-
Quality-defined variable-bitrate.
- 'AVBR'
-
Average variable bitrate.
Each encoder also has its own specific options:
- 'h264_vaapi'
-
'profile' sets the value of profile_idc and the constraint_set*_flags. 'level' sets the value of level_idc.
- 'coder'
-
Set entropy encoder (default is cabac). Possible values:
- 'ac'
- 'cabac'
-
Use CABAC.
- 'vlc'
- 'cavlc'
-
Use CAVLC.
- 'ac'
- 'aud'
-
Include access unit delimiters in the stream (not included by default).
- 'sei'
-
Set SEI message types to include. Some combination of the following values:
- 'identifier'
-
Include a user_data_unregistered message containing information about the encoder.
- 'timing'
-
Include picture timing parameters (buffering_period and pic_timing messages).
- 'recovery_point'
-
Include recovery points where appropriate (recovery_point messages).
- 'hevc_vaapi'
-
'profile' and 'level' set the values of general_profile_idc and general_level_idc respectively.
- 'aud'
-
Include access unit delimiters in the stream (not included by default).
- 'tier'
-
Set general_tier_flag. This may affect the level chosen for the stream if it is not explicitly specified.
- 'sei'
-
Set SEI message types to include. Some combination of the following values:
- 'hdr'
-
Include HDR metadata if the input frames have it (mastering_display_colour_volume and content_light_level messages).
- 'mjpeg_vaapi'
-
Only baseline DCT encoding is supported. The encoder always uses the standard quantisation and huffman tables - 'global_quality' scales the standard quantisation table (range 1-100).
For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also supported, and will create an RGB JPEG.
- 'jfif'
-
Include JFIF header in each frame (not included by default).
- 'huffman'
-
Include standard huffman tables (on by default). Turning this off will save a few hundred bytes in each output frame, but may lose compatibility with some JPEG decoders which don't fully handle MJPEG.
- 'mpeg2_vaapi'
-
'profile' and 'level' set the value of profile_and_level_indication.
- 'vp8_vaapi'
-
B-frames are not supported.
'global_quality' sets the q_idx used for non-key frames (range 0-127).
- 'loop_filter_level'
- 'loop_filter_sharpness'
-
Manually set the loop filter parameters.
- 'loop_filter_level'
- 'vp9_vaapi'
-
'global_quality' sets the q_idx used for P-frames (range 0-255).
- 'loop_filter_level'
- 'loop_filter_sharpness'
-
Manually set the loop filter parameters.
B-frames are supported, but the output stream is always in encode order rather than display order. If B-frames are enabled, it may be necessary to use the 'vp9_raw_reorder' bitstream filter to modify the output stream to display frames in the correct order.
Only normal frames are produced - the 'vp9_superframe' bitstream filter may be required to produce a stream usable with all decoders.
- 'loop_filter_level'