#[non_exhaustive]pub struct H264CodecSettings {Show 21 fields
pub width_pixels: i32,
pub height_pixels: i32,
pub frame_rate: f64,
pub frame_rate_conversion_strategy: FrameRateConversionStrategy,
pub bitrate_bps: i32,
pub pixel_format: String,
pub rate_control_mode: String,
pub crf_level: i32,
pub allow_open_gop: bool,
pub enable_two_pass: bool,
pub vbv_size_bits: i32,
pub vbv_fullness_bits: i32,
pub entropy_coder: String,
pub b_pyramid: bool,
pub b_frame_count: i32,
pub aq_strength: f64,
pub profile: String,
pub tune: String,
pub preset: String,
pub gop_mode: Option<GopMode>,
pub color_format: Option<ColorFormat>,
/* private fields */
}
Expand description
H264 codec settings.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.width_pixels: i32
The width of the video in pixels. Must be an even integer. When not specified, the width is adjusted to match the specified height and input aspect ratio. If both are omitted, the input width is used.
For portrait videos that contain horizontal ASR and rotation metadata, provide the width, in pixels, per the horizontal ASR. The API calculates the height per the horizontal ASR. The API detects any rotation metadata and swaps the requested height and width for the output.
height_pixels: i32
The height of the video in pixels. Must be an even integer. When not specified, the height is adjusted to match the specified width and input aspect ratio. If both are omitted, the input height is used.
For portrait videos that contain horizontal ASR and rotation metadata, provide the height, in pixels, per the horizontal ASR. The API calculates the width per the horizontal ASR. The API detects any rotation metadata and swaps the requested height and width for the output.
frame_rate: f64
Required. The target video frame rate in frames per second (FPS). Must be less than or equal to 120.
frame_rate_conversion_strategy: FrameRateConversionStrategy
Optional. Frame rate conversion strategy for desired frame rate. The
default is DOWNSAMPLE
.
bitrate_bps: i32
Required. The video bitrate in bits per second. The minimum value is 1,000. The maximum value is 800,000,000.
pixel_format: String
Pixel format to use. The default is yuv420p
.
Supported pixel formats:
yuv420p
pixel formatyuv422p
pixel formatyuv444p
pixel formatyuv420p10
10-bit HDR pixel formatyuv422p10
10-bit HDR pixel formatyuv444p10
10-bit HDR pixel formatyuv420p12
12-bit HDR pixel formatyuv422p12
12-bit HDR pixel formatyuv444p12
12-bit HDR pixel format
rate_control_mode: String
Specify the mode. The default is vbr
.
Supported rate control modes:
vbr
- variable bitratecrf
- constant rate factor
crf_level: i32
Target CRF level. Must be between 10 and 36, where 10 is the highest quality and 36 is the most efficient compression. The default is 21.
allow_open_gop: bool
Specifies whether an open Group of Pictures (GOP) structure should be
allowed or not. The default is false
.
enable_two_pass: bool
Use two-pass encoding strategy to achieve better video quality.
H264CodecSettings.rate_control_mode
must be vbr
. The default is false
.
vbv_size_bits: i32
Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to H264CodecSettings.bitrate_bps.
vbv_fullness_bits: i32
Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to 90% of H264CodecSettings.vbv_size_bits.
entropy_coder: String
The entropy coder to use. The default is cabac
.
Supported entropy coders:
cavlc
cabac
b_pyramid: bool
Allow B-pyramid for reference frame selection. This may not be supported
on all decoders. The default is false
.
b_frame_count: i32
The number of consecutive B-frames. Must be greater than or equal to zero. Must be less than H264CodecSettings.gop_frame_count if set. The default is 0.
aq_strength: f64
Specify the intensity of the adaptive quantizer (AQ). Must be between 0 and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A higher value equals a lower bitrate but smoother image. The default is 0.
profile: String
Enforces the specified codec profile. The following profiles are supported:
baseline
main
high
(default)
The available options are
FFmpeg-compatible.
Note that certain values for this field may cause the
transcoder to override other fields you set in the H264CodecSettings
message.
tune: String
Enforces the specified codec tune. The available options are
FFmpeg-compatible.
Note that certain values for this field may cause the
transcoder to override other fields you set in the H264CodecSettings
message.
preset: String
Enforces the specified codec preset. The default is veryfast
. The
available options are
FFmpeg-compatible.
Note that certain values for this field may cause the
transcoder to override other fields you set in the H264CodecSettings
message.
gop_mode: Option<GopMode>
GOP mode can be either by frame count or duration.
color_format: Option<ColorFormat>
Color format can be sdr or hlg.
Implementations§
Source§impl H264CodecSettings
impl H264CodecSettings
pub fn new() -> Self
Sourcepub fn set_width_pixels<T: Into<i32>>(self, v: T) -> Self
pub fn set_width_pixels<T: Into<i32>>(self, v: T) -> Self
Sets the value of width_pixels.
Sourcepub fn set_height_pixels<T: Into<i32>>(self, v: T) -> Self
pub fn set_height_pixels<T: Into<i32>>(self, v: T) -> Self
Sets the value of height_pixels.
Sourcepub fn set_frame_rate<T: Into<f64>>(self, v: T) -> Self
pub fn set_frame_rate<T: Into<f64>>(self, v: T) -> Self
Sets the value of frame_rate.
Sourcepub fn set_frame_rate_conversion_strategy<T: Into<FrameRateConversionStrategy>>(
self,
v: T,
) -> Self
pub fn set_frame_rate_conversion_strategy<T: Into<FrameRateConversionStrategy>>( self, v: T, ) -> Self
Sets the value of frame_rate_conversion_strategy.
Sourcepub fn set_bitrate_bps<T: Into<i32>>(self, v: T) -> Self
pub fn set_bitrate_bps<T: Into<i32>>(self, v: T) -> Self
Sets the value of bitrate_bps.
Sourcepub fn set_pixel_format<T: Into<String>>(self, v: T) -> Self
pub fn set_pixel_format<T: Into<String>>(self, v: T) -> Self
Sets the value of pixel_format.
Sourcepub fn set_rate_control_mode<T: Into<String>>(self, v: T) -> Self
pub fn set_rate_control_mode<T: Into<String>>(self, v: T) -> Self
Sets the value of rate_control_mode.
Sourcepub fn set_crf_level<T: Into<i32>>(self, v: T) -> Self
pub fn set_crf_level<T: Into<i32>>(self, v: T) -> Self
Sets the value of crf_level.
Sourcepub fn set_allow_open_gop<T: Into<bool>>(self, v: T) -> Self
pub fn set_allow_open_gop<T: Into<bool>>(self, v: T) -> Self
Sets the value of allow_open_gop.
Sourcepub fn set_enable_two_pass<T: Into<bool>>(self, v: T) -> Self
pub fn set_enable_two_pass<T: Into<bool>>(self, v: T) -> Self
Sets the value of enable_two_pass.
Sourcepub fn set_vbv_size_bits<T: Into<i32>>(self, v: T) -> Self
pub fn set_vbv_size_bits<T: Into<i32>>(self, v: T) -> Self
Sets the value of vbv_size_bits.
Sourcepub fn set_vbv_fullness_bits<T: Into<i32>>(self, v: T) -> Self
pub fn set_vbv_fullness_bits<T: Into<i32>>(self, v: T) -> Self
Sets the value of vbv_fullness_bits.
Sourcepub fn set_entropy_coder<T: Into<String>>(self, v: T) -> Self
pub fn set_entropy_coder<T: Into<String>>(self, v: T) -> Self
Sets the value of entropy_coder.
Sourcepub fn set_b_pyramid<T: Into<bool>>(self, v: T) -> Self
pub fn set_b_pyramid<T: Into<bool>>(self, v: T) -> Self
Sets the value of b_pyramid.
Sourcepub fn set_b_frame_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_b_frame_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of b_frame_count.
Sourcepub fn set_aq_strength<T: Into<f64>>(self, v: T) -> Self
pub fn set_aq_strength<T: Into<f64>>(self, v: T) -> Self
Sets the value of aq_strength.
Sourcepub fn set_profile<T: Into<String>>(self, v: T) -> Self
pub fn set_profile<T: Into<String>>(self, v: T) -> Self
Sets the value of profile.
Sourcepub fn set_preset<T: Into<String>>(self, v: T) -> Self
pub fn set_preset<T: Into<String>>(self, v: T) -> Self
Sets the value of preset.
Sourcepub fn set_gop_mode<T: Into<Option<GopMode>>>(self, v: T) -> Self
pub fn set_gop_mode<T: Into<Option<GopMode>>>(self, v: T) -> Self
Sets the value of gop_mode.
Note that all the setters affecting gop_mode
are mutually
exclusive.
Sourcepub fn gop_frame_count(&self) -> Option<&i32>
pub fn gop_frame_count(&self) -> Option<&i32>
The value of gop_mode
if it holds a GopFrameCount
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_gop_frame_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_gop_frame_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of gop_mode
to hold a GopFrameCount
.
Note that all the setters affecting gop_mode
are
mutually exclusive.
Sourcepub fn gop_duration(&self) -> Option<&Box<Duration>>
pub fn gop_duration(&self) -> Option<&Box<Duration>>
The value of gop_mode
if it holds a GopDuration
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_gop_duration<T: Into<Box<Duration>>>(self, v: T) -> Self
pub fn set_gop_duration<T: Into<Box<Duration>>>(self, v: T) -> Self
Sets the value of gop_mode
to hold a GopDuration
.
Note that all the setters affecting gop_mode
are
mutually exclusive.
Sourcepub fn set_color_format<T: Into<Option<ColorFormat>>>(self, v: T) -> Self
pub fn set_color_format<T: Into<Option<ColorFormat>>>(self, v: T) -> Self
Sets the value of color_format.
Note that all the setters affecting color_format
are mutually
exclusive.
Sourcepub fn sdr(&self) -> Option<&Box<H264ColorFormatSDR>>
pub fn sdr(&self) -> Option<&Box<H264ColorFormatSDR>>
The value of color_format
if it holds a Sdr
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_sdr<T: Into<Box<H264ColorFormatSDR>>>(self, v: T) -> Self
pub fn set_sdr<T: Into<Box<H264ColorFormatSDR>>>(self, v: T) -> Self
Sets the value of color_format
to hold a Sdr
.
Note that all the setters affecting color_format
are
mutually exclusive.
Sourcepub fn hlg(&self) -> Option<&Box<H264ColorFormatHLG>>
pub fn hlg(&self) -> Option<&Box<H264ColorFormatHLG>>
The value of color_format
if it holds a Hlg
, None
if the field is not set or
holds a different branch.
Sourcepub fn set_hlg<T: Into<Box<H264ColorFormatHLG>>>(self, v: T) -> Self
pub fn set_hlg<T: Into<Box<H264ColorFormatHLG>>>(self, v: T) -> Self
Sets the value of color_format
to hold a Hlg
.
Note that all the setters affecting color_format
are
mutually exclusive.
Trait Implementations§
Source§impl Clone for H264CodecSettings
impl Clone for H264CodecSettings
Source§fn clone(&self) -> H264CodecSettings
fn clone(&self) -> H264CodecSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more