public sealed class VideoStream.Types.H264CodecSettings : IMessage<VideoStream.Types.H264CodecSettings>, IEquatable<VideoStream.Types.H264CodecSettings>, IDeepCloneable<VideoStream.Types.H264CodecSettings>, IBufferMessage, IMessage
Reference documentation and code samples for the Live Stream v1 API class VideoStream.Types.H264CodecSettings.
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.
The number of consecutive B-frames. Must be greater than or equal to
zero. Must be less than
[gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count]
if set. The default is 0.
Required. The target video frame rate in frames per second (FPS). Must be
less than or equal to 60. Will default to the input frame rate if larger
than the input frame rate. The API will generate an output FPS that is
divisible by the input FPS, and smaller or equal to the target FPS. See
Calculating frame
rate for
more information.
Select the GOP size based on the specified duration. The default is
2s. Note that gopDuration must be less than or equal to
[segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration],
and
[segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration]
must be divisible by gopDuration. Valid range is [2s, 20s].
All video streams in the same channel must have the same GOP size.
Select the GOP size based on the specified frame count.
If GOP frame count is set instead of GOP duration, GOP duration will be
calculated by gopFrameCount/frameRate. The calculated GOP duration
must satisfy the limitations on gopDuration as well.
Valid range is [60, 600].
Enforces the specified codec profile. The following profiles are
supported:
baseline
main (default)
high
The available options are FFmpeg-compatible Profile
Options.
Note that certain values for this field may cause the
transcoder to override other fields you set in the
[H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]
message.
Enforces the specified codec tune. The available options are
FFmpeg-compatible Encode
Options
Note that certain values for this field may cause the transcoder to
override other fields you set in the
[H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]
message.
Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
Must be greater than zero. The default is equal to 90% of
[vbv_size_bits][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.vbv_size_bits].
Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
greater than zero. The default is equal to
[bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps].
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eVideoStream.Types.H264CodecSettings\u003c/code\u003e class provides settings for configuring H264 video encoding within the Live Stream v1 API.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, indicating its role in message processing, equality checks, and deep cloning.\u003c/p\u003e\n"],["\u003cp\u003eIt supports a variety of encoding parameters such as bitrate, frame rate, GOP (Group of Pictures) size, B-frame count, and various encoding profiles and tuning options, providing granular control over video quality and compression.\u003c/p\u003e\n"],["\u003cp\u003eThe class also allows for adaptive quantization (AQ) strength adjustment and Video Buffering Verifier (VBV) configuration to fine-tune the encoding process.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version for this API is 1.8.0, with previous versions ranging back to 1.0.0, all of which can be referenced via URL links provided.\u003c/p\u003e\n"]]],[],null,["# Live Stream v1 API - Class VideoStream.Types.H264CodecSettings (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.8.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.7.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.6.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.5.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.4.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.3.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.2.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.1.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/1.0.0/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings) \n\n public sealed class VideoStream.Types.H264CodecSettings : IMessage\u003cVideoStream.Types.H264CodecSettings\u003e, IEquatable\u003cVideoStream.Types.H264CodecSettings\u003e, IDeepCloneable\u003cVideoStream.Types.H264CodecSettings\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Live Stream v1 API class VideoStream.Types.H264CodecSettings.\n\nH264 codec settings. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e VideoStream.Types.H264CodecSettings \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[VideoStream](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream)[Types](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream.Types)[H264CodecSettings](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[VideoStream](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream)[Types](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream.Types)[H264CodecSettings](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[VideoStream](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream)[Types](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream.Types)[H264CodecSettings](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1.VideoStream.Types.H264CodecSettings), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Video.LiveStream.V1](/dotnet/docs/reference/Google.Cloud.Video.LiveStream.V1/latest/Google.Cloud.Video.LiveStream.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Video.LiveStream.V1.dll\n\nConstructors\n------------\n\n### H264CodecSettings()\n\n public H264CodecSettings()\n\n### H264CodecSettings(H264CodecSettings)\n\n public H264CodecSettings(VideoStream.Types.H264CodecSettings other)\n\nProperties\n----------\n\n### AllowOpenGop\n\n public bool AllowOpenGop { get; set; }\n\nSpecifies whether an open Group of Pictures (GOP) structure should be\nallowed or not. The default is `false`.\n\n### AqStrength\n\n public double AqStrength { get; set; }\n\nSpecify the intensity of the adaptive quantizer (AQ). Must be between 0\nand 1, where 0 disables the quantizer and 1 maximizes the quantizer. A\nhigher value equals a lower bitrate but smoother image. The default is 0.\n\n### BFrameCount\n\n public int BFrameCount { get; set; }\n\nThe number of consecutive B-frames. Must be greater than or equal to\nzero. Must be less than\n\\[gop_frame_count\\]\\[google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count\\]\nif set. The default is 0.\n\n### BPyramid\n\n public bool BPyramid { get; set; }\n\nAllow B-pyramid for reference frame selection. This may not be supported\non all decoders. The default is `false`.\n\n### BitrateBps\n\n public int BitrateBps { get; set; }\n\nRequired. The video bitrate in bits per second. Minimum value is 10,000.\n\n- For SD resolution (\\\u003c 720p), must be \\\u003c= 3,000,000 (3 Mbps).\n- For HD resolution (\\\u003c= 1080p), must be \\\u003c= 15,000,000 (15 Mbps).\n\n### EntropyCoder\n\n public string EntropyCoder { get; set; }\n\nThe entropy coder to use. The default is `cabac`.\n\nSupported entropy coders:\n\n- `cavlc`\n- `cabac`\n\n### FrameRate\n\n public double FrameRate { get; set; }\n\nRequired. The target video frame rate in frames per second (FPS). Must be\nless than or equal to 60. Will default to the input frame rate if larger\nthan the input frame rate. The API will generate an output FPS that is\ndivisible by the input FPS, and smaller or equal to the target FPS. See\n[Calculating frame\nrate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for\nmore information.\n\n### GopDuration\n\n public Duration GopDuration { get; set; }\n\nSelect the GOP size based on the specified duration. The default is\n`2s`. Note that `gopDuration` must be less than or equal to\n\\[segment_duration\\]\\[google.cloud.video.livestream.v1.SegmentSettings.segment_duration\\],\nand\n\\[segment_duration\\]\\[google.cloud.video.livestream.v1.SegmentSettings.segment_duration\\]\nmust be divisible by `gopDuration`. Valid range is \\[2s, 20s\\].\n\nAll video streams in the same channel must have the same GOP size.\n\n### GopFrameCount\n\n public int GopFrameCount { get; set; }\n\nSelect the GOP size based on the specified frame count.\nIf GOP frame count is set instead of GOP duration, GOP duration will be\ncalculated by `gopFrameCount`/`frameRate`. The calculated GOP duration\nmust satisfy the limitations on `gopDuration` as well.\nValid range is \\[60, 600\\].\n\n### GopModeCase\n\n public VideoStream.Types.H264CodecSettings.GopModeOneofCase GopModeCase { get; }\n\n### HasGopFrameCount\n\n public bool HasGopFrameCount { get; }\n\nGets whether the \"gop_frame_count\" field is set\n\n### HeightPixels\n\n public int HeightPixels { get; set; }\n\nRequired. The height of the video in pixels. Must be an even integer.\nValid range is \\[180, 1080\\].\n\n### Profile\n\n public string Profile { get; set; }\n\nEnforces the specified codec profile. The following profiles are\nsupported:\n\n- `baseline`\n- `main` (default)\n- `high`\n\nThe available options are [FFmpeg-compatible Profile\nOptions](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile).\nNote that certain values for this field may cause the\ntranscoder to override other fields you set in the\n\\[H264CodecSettings\\]\\[google.cloud.video.livestream.v1.VideoStream.H264CodecSettings\\]\nmessage.\n\n### Tune\n\n public string Tune { get; set; }\n\nEnforces the specified codec tune. The available options are\n[FFmpeg-compatible Encode\nOptions](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune)\nNote that certain values for this field may cause the transcoder to\noverride other fields you set in the\n\\[H264CodecSettings\\]\\[google.cloud.video.livestream.v1.VideoStream.H264CodecSettings\\]\nmessage.\n\n### VbvFullnessBits\n\n public int VbvFullnessBits { get; set; }\n\nInitial fullness of the Video Buffering Verifier (VBV) buffer in bits.\nMust be greater than zero. The default is equal to 90% of\n\\[vbv_size_bits\\]\\[google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.vbv_size_bits\\].\n\n### VbvSizeBits\n\n public int VbvSizeBits { get; set; }\n\nSize of the Video Buffering Verifier (VBV) buffer in bits. Must be\ngreater than zero. The default is equal to\n\\[bitrate_bps\\]\\[google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps\\].\n\n### WidthPixels\n\n public int WidthPixels { get; set; }\n\nRequired. The width of the video in pixels. Must be an even integer.\nValid range is \\[320, 1920\\]."]]