pub struct EncoderConfig<T: YUVPixelType> {Show 31 fields
pub codec: CodecId,
pub profile: EncoderProfile,
pub flags: EncoderFlags,
pub width: u32,
pub height: u32,
pub timebase: Timebase,
pub rate_control: RateControl,
pub threads: u32,
pub output_bit_depth: vpx_bit_depth,
pub error_resilient: ErrorResilient,
pub pass: vpx_enc_pass,
pub lag_in_frames: u32,
pub rc_dropframe_thresh: u32,
pub rc_resize_allowed: Option<SpatialResizeParams>,
pub rc_twopass_stats_in: Option<FixedBuffer>,
pub rc_firstpass_mb_stats_in: Option<FixedBuffer>,
pub rc_undershoot_pct: u32,
pub rc_overshoot_pct: u32,
pub rc_buf_sz: Duration,
pub rc_buf_initial_sz: Duration,
pub rc_buf_optimal_sz: Duration,
pub rc_2pass_vbr_bias_pct: u32,
pub rc_2pass_vbr_minsection_pct: u32,
pub rc_2pass_vbr_maxsection_pct: u32,
pub rc_2pass_vbr_corpus_complexity: u32,
pub kf_mode: KeyFrameMode,
pub spatial_layers: Vec<SpatialLayer>,
pub temporal_layers: Vec<TemporalLayer>,
pub temporal_periodicity: Vec<u32>,
pub layer_target_bitrate: [u32; 12],
pub temporal_layering_mode: Option<vp9e_temporal_layering_mode>,
/* private fields */
}Expand description
Specifies an initial configuration of the encoder. Fields prefixed
with rc_ denote rate-control parameters.
Fields§
§codec: CodecIdThe codec to utilize when producing a bitstream.
profile: EncoderProfileBitstream profile to use.
flags: EncoderFlagsFlags to configure on the encoder.
width: u32The display width of the video stream in pixels.
height: u32The display height of the video stream in pixels.
timebase: TimebaseThe timebase for the presentation timestamps passed to the encoder.
rate_control: RateControlThe type of rate control to employ.
threads: u32Number of threads to employ in encoding.
output_bit_depth: vpx_bit_depthBit-depth of the codec.
This value identifies the bit_depth of the codec and the generated
output bitstream. It doesn’t imply a specific input data bit depth
(which is defined by the associated generic type of this struct).
The default is VPX_BITS_8.
error_resilient: ErrorResilientBitstream error resiliency flags.
pass: vpx_enc_passMulti-pass encoding support:
VPX_RC_ONE_PASS: Single-pass mode (default).VPX_RC_FIRST_PASS: First pass of multi-pass mode.VPX_RC_LAST_PASS: Final pass of multi-pass mode.
lag_in_frames: u32Allow lagged encoding
If set, this value allows the encoder to consume a number of input frames before producing output frames. This allows the encoder to base decisions for the current frame on future frames. This does increase the latency of the encoding pipeline, so it is not appropriate in all situations (ex: realtime encoding).
Note that this is a maximum value – the encoder may produce frames sooner than the given limit. Set this value to 0 to disable this feature (this is the default).
rc_dropframe_thresh: u32Temporal resampling configuration, if supported by the codec.
Temporal resampling allows the codec to “drop” frames as a strategy to meet its target data rate. This can cause temporal discontinuities in the encoded video, which may appear as stuttering during playback. This trade-off is often acceptable, but for many applications is not. It can be disabled in these cases.
This threshold is described as a percentage of the target data buffer. When the data buffer falls below this percentage of fullness, a dropped frame is indicated. Set the threshold to zero (0) to disable this feature.
rc_resize_allowed: Option<SpatialResizeParams>Enable/disable spatial resampling, if supported by the codec.
Spatial resampling allows the codec to compress a lower resolution version of the frame, which is then upscaled by the encoder to the correct presentation resolution. This increases visual quality at low data rates, at the expense of CPU time on the encoder/decoder.
If set to None, spatial resizing is disallowed.
rc_twopass_stats_in: Option<FixedBuffer>Two-pass stats buffer.
A buffer containing all of the stats packets produced in the first pass, concatenated.
If set to None (the default), no two-pass stats are passed in.
rc_firstpass_mb_stats_in: Option<FixedBuffer>First pass mb stats buffer.
A buffer containing all of the first pass mb stats packets produced in the first pass, concatenated.
If set to None (the default), no first-pass MB stats are passed in.
rc_undershoot_pct: u32Rate control adaptation undershoot control
VP8: Expressed as a percentage of the target bitrate, controls the maximum allowed adaptation speed of the codec. This factor controls the maximum amount of bits that can be subtracted from the target bitrate in order to compensate for prior overshoot.
VP9: Expressed as a percentage of the target bitrate, a threshold undershoot level (current rate vs target) beyond which more aggressive corrective measures are taken.
Valid values in the range VP8:0-100 VP9: 0-100.
rc_overshoot_pct: u32Rate control adaptation overshoot control
VP8: Expressed as a percentage of the target bitrate, controls the maximum allowed adaptation speed of the codec. This factor controls the maximum amount of bits that can be added to the target bitrate in order to compensate for prior undershoot.
VP9: Expressed as a percentage of the target bitrate, a threshold overshoot level (current rate vs target) beyond which more aggressive corrective measures are taken.
Valid values in the range VP8:0-100 VP9: 0-100.
rc_buf_sz: DurationDecoder Buffer Size
This value indicates the amount of data that may be buffered by the decoding application. Note that this value is expressed in units of time.
rc_buf_initial_sz: DurationDecoder Buffer Initial Size
This value indicates the amount of data that will be buffered by the decoding application prior to beginning playback. This value is expressed in units of time
rc_buf_optimal_sz: DurationDecoder Buffer Optimal Size
This value indicates the amount of data that the encoder should try to maintain in the decoder’s buffer. This value is expressed in units of time.
rc_2pass_vbr_bias_pct: u32Two-pass mode CBR/VBR bias
Bias, expressed on a scale of 0 to 100, for determining target size for the current frame. The value 0 indicates the optimal CBR mode value should be used. The value 100 indicates the optimal VBR mode value should be used. Values in between indicate which way the encoder should “lean.”
rc_2pass_vbr_minsection_pct: u32Two-pass mode per-GOP minimum bitrate
This value, expressed as a percentage of the target bitrate, indicates the minimum bitrate to be used for a single GOP (aka “section”)
rc_2pass_vbr_maxsection_pct: u32Two-pass mode per-GOP maximum bitrate
This value, expressed as a percentage of the target bitrate, indicates the maximum bitrate to be used for a single GOP (aka “section”)
rc_2pass_vbr_corpus_complexity: u32Two-pass corpus vbr mode complexity control
Used only in VP9: A value representing the corpus midpoint complexity for corpus vbr mode. This value defaults to 0 which disables corpus vbr mode in favour of normal vbr mode.
kf_mode: KeyFrameModeKeyframe placement mode
This value indicates whether the encoder should place keyframes at a
fixed interval, or determine the optimal placement automatically
(as governed by the min_dist and max_dist parameters).
spatial_layers: Vec<SpatialLayer>Configures the spatial coding layers to be used by the encoder.
temporal_layers: Vec<TemporalLayer>Temporal coding layers.
This vector MUST NOT contain more than vpx_sys::VPX_TS_MAX_LAYERS
temporal layers.
temporal_periodicity: Vec<u32>Template defining the membership of frames to temporal layers.
This vector defines the membership of frames to temporal coding layers.
For a 2-layer encoding that assigns even numbered frames to one
temporal layer (0) and odd numbered frames to a second temporal layer
(1), then cfg.temporal_periodicity = vec![0,1,0,1,0,1,0,1].
This vector MUST NOT contain more than
vpx_sys::VPX_TS_MAX_PERIODICITY items.
layer_target_bitrate: [u32; 12]Target bitrate for each spatial/temporal layer.
These values specify the target coding bitrate to be used for each spatial/temporal layer (in kbps).
temporal_layering_mode: Option<vp9e_temporal_layering_mode>Temporal layering mode indicating which temporal layering scheme to use.
If this is set to None, the codec-default layering mode is
used.
Implementations§
Source§impl<T: YUVPixelType> EncoderConfig<T>
impl<T: YUVPixelType> EncoderConfig<T>
Trait Implementations§
Source§impl<T: Clone + YUVPixelType> Clone for EncoderConfig<T>
impl<T: Clone + YUVPixelType> Clone for EncoderConfig<T>
Source§fn clone(&self) -> EncoderConfig<T>
fn clone(&self) -> EncoderConfig<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more