#[non_exhaustive]pub struct H265CodecSettings {Show 20 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 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
H265 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: i32The 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: i32The 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: f64Required. The target video frame rate in frames per second (FPS). Must be less than or equal to 120.
frame_rate_conversion_strategy: FrameRateConversionStrategyOptional. Frame rate conversion strategy for desired frame rate. The
default is DOWNSAMPLE.
bitrate_bps: i32Required. The video bitrate in bits per second. The minimum value is 1,000. The maximum value is 800,000,000.
pixel_format: StringPixel format to use. The default is yuv420p.
Supported pixel formats:
yuv420ppixel formatyuv422ppixel formatyuv444ppixel formatyuv420p1010-bit HDR pixel formatyuv422p1010-bit HDR pixel formatyuv444p1010-bit HDR pixel formatyuv420p1212-bit HDR pixel formatyuv422p1212-bit HDR pixel formatyuv444p1212-bit HDR pixel format
rate_control_mode: StringSpecify the mode. The default is vbr.
Supported rate control modes:
vbr- variable bitratecrf- constant rate factor
crf_level: i32Target 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: boolSpecifies whether an open Group of Pictures (GOP) structure should be
allowed or not. The default is false.
enable_two_pass: boolUse two-pass encoding strategy to achieve better video quality.
H265CodecSettings.rate_control_mode
must be vbr. The default is false.
vbv_size_bits: i32Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
greater than zero. The default is equal to VideoStream.bitrate_bps.
vbv_fullness_bits: i32Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to 90% of H265CodecSettings.vbv_size_bits.
b_pyramid: boolAllow B-pyramid for reference frame selection. This may not be supported
on all decoders. The default is false.
b_frame_count: i32The number of consecutive B-frames. Must be greater than or equal to zero. Must be less than H265CodecSettings.gop_frame_count if set. The default is 0.
aq_strength: f64Specify 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: StringEnforces the specified codec profile. The following profiles are supported:
- 8-bit profiles
main(default)main-intramainstillpicture
- 10-bit profiles
main10(default)main10-intramain422-10main422-10-intramain444-10main444-10-intra
- 12-bit profiles
main12(default)main12-intramain422-12main422-12-intramain444-12main444-12-intra
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 H265CodecSettings
message.
tune: StringEnforces 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 H265CodecSettings
message.
preset: StringEnforces 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 H265CodecSettings
message.
gop_mode: Option<GopMode>GOP mode can be either by frame count or duration.
color_format: Option<ColorFormat>Color format can be sdr, hlg, hdr10.
Implementations§
Source§impl H265CodecSettings
impl H265CodecSettings
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_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<H265ColorFormatSDR>>
pub fn sdr(&self) -> Option<&Box<H265ColorFormatSDR>>
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<H265ColorFormatSDR>>>(self, v: T) -> Self
pub fn set_sdr<T: Into<Box<H265ColorFormatSDR>>>(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<H265ColorFormatHLG>>
pub fn hlg(&self) -> Option<&Box<H265ColorFormatHLG>>
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<H265ColorFormatHLG>>>(self, v: T) -> Self
pub fn set_hlg<T: Into<Box<H265ColorFormatHLG>>>(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.
Sourcepub fn hdr10(&self) -> Option<&Box<H265ColorFormatHDR10>>
pub fn hdr10(&self) -> Option<&Box<H265ColorFormatHDR10>>
The value of color_format
if it holds a Hdr10, None if the field is not set or
holds a different branch.
Sourcepub fn set_hdr10<T: Into<Box<H265ColorFormatHDR10>>>(self, v: T) -> Self
pub fn set_hdr10<T: Into<Box<H265ColorFormatHDR10>>>(self, v: T) -> Self
Sets the value of color_format
to hold a Hdr10.
Note that all the setters affecting color_format are
mutually exclusive.
Trait Implementations§
Source§impl Clone for H265CodecSettings
impl Clone for H265CodecSettings
Source§fn clone(&self) -> H265CodecSettings
fn clone(&self) -> H265CodecSettings
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more