Class: Google::Apis::TranscoderV1::H264CodecSettings
- Inherits:
-
Object
- Object
- Google::Apis::TranscoderV1::H264CodecSettings
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/transcoder_v1/classes.rb,
lib/google/apis/transcoder_v1/representations.rb,
lib/google/apis/transcoder_v1/representations.rb
Overview
H264 codec settings.
Instance Attribute Summary collapse
-
#allow_open_gop ⇒ Boolean
(also: #allow_open_gop?)
Specifies whether an open Group of Pictures (GOP) structure should be allowed or not.
-
#aq_strength ⇒ Float
Specify the intensity of the adaptive quantizer (AQ).
-
#b_frame_count ⇒ Fixnum
The number of consecutive B-frames.
-
#b_pyramid ⇒ Boolean
(also: #b_pyramid?)
Allow B-pyramid for reference frame selection.
-
#bitrate_bps ⇒ Fixnum
Required.
-
#crf_level ⇒ Fixnum
Target CRF level.
-
#enable_two_pass ⇒ Boolean
(also: #enable_two_pass?)
Use two-pass encoding strategy to achieve better video quality.
-
#entropy_coder ⇒ String
The entropy coder to use.
-
#frame_rate ⇒ Float
Required.
-
#frame_rate_conversion_strategy ⇒ String
Optional.
-
#gop_duration ⇒ String
Select the GOP size based on the specified duration.
-
#gop_frame_count ⇒ Fixnum
Select the GOP size based on the specified frame count.
-
#height_pixels ⇒ Fixnum
The height of the video in pixels.
-
#hlg ⇒ Google::Apis::TranscoderV1::H264ColorFormatHlg
Convert the input video to a Hybrid Log Gamma (HLG) video.
-
#pixel_format ⇒ String
Pixel format to use.
-
#preset ⇒ String
Enforces the specified codec preset.
-
#profile ⇒ String
Enforces the specified codec profile.
-
#rate_control_mode ⇒ String
Specify the mode.
-
#sdr ⇒ Google::Apis::TranscoderV1::H264ColorFormatSdr
Convert the input video to a Standard Dynamic Range (SDR) video.
-
#tune ⇒ String
Enforces the specified codec tune.
-
#vbv_fullness_bits ⇒ Fixnum
Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
-
#vbv_size_bits ⇒ Fixnum
Size of the Video Buffering Verifier (VBV) buffer in bits.
-
#width_pixels ⇒ Fixnum
The width of the video in pixels.
Instance Method Summary collapse
-
#initialize(**args) ⇒ H264CodecSettings
constructor
A new instance of H264CodecSettings.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ H264CodecSettings
Returns a new instance of H264CodecSettings.
948 949 950 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 948 def initialize(**args) update!(**args) end |
Instance Attribute Details
#allow_open_gop ⇒ Boolean Also known as: allow_open_gop?
Specifies whether an open Group of Pictures (GOP) structure should be allowed
or not. The default is false
.
Corresponds to the JSON property allowOpenGop
789 790 791 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 789 def allow_open_gop @allow_open_gop end |
#aq_strength ⇒ Float
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.
Corresponds to the JSON property aqStrength
797 798 799 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 797 def aq_strength @aq_strength end |
#b_frame_count ⇒ Fixnum
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.
Corresponds to the JSON property bFrameCount
803 804 805 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 803 def b_frame_count @b_frame_count end |
#b_pyramid ⇒ Boolean Also known as: b_pyramid?
Allow B-pyramid for reference frame selection. This may not be supported on
all decoders. The default is false
.
Corresponds to the JSON property bPyramid
809 810 811 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 809 def b_pyramid @b_pyramid end |
#bitrate_bps ⇒ Fixnum
Required. The video bitrate in bits per second. The minimum value is 1,000.
The maximum value is 800,000,000.
Corresponds to the JSON property bitrateBps
816 817 818 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 816 def bitrate_bps @bitrate_bps end |
#crf_level ⇒ Fixnum
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.
Corresponds to the JSON property crfLevel
822 823 824 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 822 def crf_level @crf_level end |
#enable_two_pass ⇒ Boolean Also known as: enable_two_pass?
Use two-pass encoding strategy to achieve better video quality.
H264CodecSettings.rate_control_mode must be vbr
. The default is false
.
Corresponds to the JSON property enableTwoPass
828 829 830 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 828 def enable_two_pass @enable_two_pass end |
#entropy_coder ⇒ String
The entropy coder to use. The default is cabac
. Supported entropy coders: -
cavlc
- cabac
Corresponds to the JSON property entropyCoder
835 836 837 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 835 def entropy_coder @entropy_coder end |
#frame_rate ⇒ Float
Required. The target video frame rate in frames per second (FPS). Must be less
than or equal to 120.
Corresponds to the JSON property frameRate
841 842 843 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 841 def frame_rate @frame_rate end |
#frame_rate_conversion_strategy ⇒ String
Optional. Frame rate conversion strategy for desired frame rate. The default
is DOWNSAMPLE
.
Corresponds to the JSON property frameRateConversionStrategy
847 848 849 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 847 def frame_rate_conversion_strategy @frame_rate_conversion_strategy end |
#gop_duration ⇒ String
Select the GOP size based on the specified duration. The default is 3s
. Note
that gopDuration
must be less than or equal to segmentDuration
, and segmentDuration
must be divisible
by gopDuration
.
Corresponds to the JSON property gopDuration
855 856 857 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 855 def gop_duration @gop_duration end |
#gop_frame_count ⇒ Fixnum
Select the GOP size based on the specified frame count. Must be greater than
zero.
Corresponds to the JSON property gopFrameCount
861 862 863 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 861 def gop_frame_count @gop_frame_count end |
#height_pixels ⇒ Fixnum
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.
Corresponds to the JSON property heightPixels
872 873 874 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 872 def height_pixels @height_pixels end |
#hlg ⇒ Google::Apis::TranscoderV1::H264ColorFormatHlg
Convert the input video to a Hybrid Log Gamma (HLG) video.
Corresponds to the JSON property hlg
877 878 879 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 877 def hlg @hlg end |
#pixel_format ⇒ String
Pixel format to use. The default is yuv420p
. Supported pixel formats: -
yuv420p
pixel format - yuv422p
pixel format - yuv444p
pixel format -
yuv420p10
10-bit HDR pixel format - yuv422p10
10-bit HDR pixel format -
yuv444p10
10-bit HDR pixel format - yuv420p12
12-bit HDR pixel format -
yuv422p12
12-bit HDR pixel format - yuv444p12
12-bit HDR pixel format
Corresponds to the JSON property pixelFormat
886 887 888 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 886 def pixel_format @pixel_format end |
#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.
Corresponds to the JSON property preset
894 895 896 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 894 def preset @preset end |
#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.
Corresponds to the JSON property profile
903 904 905 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 903 def profile @profile end |
#rate_control_mode ⇒ String
Specify the mode. The default is vbr
. Supported rate control modes: - vbr
-
variable bitrate - crf
- constant rate factor
Corresponds to the JSON property rateControlMode
909 910 911 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 909 def rate_control_mode @rate_control_mode end |
#sdr ⇒ Google::Apis::TranscoderV1::H264ColorFormatSdr
Convert the input video to a Standard Dynamic Range (SDR) video.
Corresponds to the JSON property sdr
914 915 916 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 914 def sdr @sdr end |
#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.
Corresponds to the JSON property tune
922 923 924 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 922 def tune @tune end |
#vbv_fullness_bits ⇒ Fixnum
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.
Corresponds to the JSON property vbvFullnessBits
929 930 931 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 929 def vbv_fullness_bits @vbv_fullness_bits end |
#vbv_size_bits ⇒ Fixnum
Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater
than zero. The default is equal to H264CodecSettings.bitrate_bps.
Corresponds to the JSON property vbvSizeBits
935 936 937 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 935 def vbv_size_bits @vbv_size_bits end |
#width_pixels ⇒ Fixnum
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.
Corresponds to the JSON property widthPixels
946 947 948 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 946 def width_pixels @width_pixels end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 |
# File 'lib/google/apis/transcoder_v1/classes.rb', line 953 def update!(**args) @allow_open_gop = args[:allow_open_gop] if args.key?(:allow_open_gop) @aq_strength = args[:aq_strength] if args.key?(:aq_strength) @b_frame_count = args[:b_frame_count] if args.key?(:b_frame_count) @b_pyramid = args[:b_pyramid] if args.key?(:b_pyramid) @bitrate_bps = args[:bitrate_bps] if args.key?(:bitrate_bps) @crf_level = args[:crf_level] if args.key?(:crf_level) @enable_two_pass = args[:enable_two_pass] if args.key?(:enable_two_pass) @entropy_coder = args[:entropy_coder] if args.key?(:entropy_coder) @frame_rate = args[:frame_rate] if args.key?(:frame_rate) @frame_rate_conversion_strategy = args[:frame_rate_conversion_strategy] if args.key?(:frame_rate_conversion_strategy) @gop_duration = args[:gop_duration] if args.key?(:gop_duration) @gop_frame_count = args[:gop_frame_count] if args.key?(:gop_frame_count) @height_pixels = args[:height_pixels] if args.key?(:height_pixels) @hlg = args[:hlg] if args.key?(:hlg) @pixel_format = args[:pixel_format] if args.key?(:pixel_format) @preset = args[:preset] if args.key?(:preset) @profile = args[:profile] if args.key?(:profile) @rate_control_mode = args[:rate_control_mode] if args.key?(:rate_control_mode) @sdr = args[:sdr] if args.key?(:sdr) @tune = args[:tune] if args.key?(:tune) @vbv_fullness_bits = args[:vbv_fullness_bits] if args.key?(:vbv_fullness_bits) @vbv_size_bits = args[:vbv_size_bits] if args.key?(:vbv_size_bits) @width_pixels = args[:width_pixels] if args.key?(:width_pixels) end |