Skip to content

H264Settings

Source code in docs_src/capo_medialive/types/h264_settings.py
class H264Settings(TypedDict, closed=True):
    adaptive_quantization: NotRequired[
        "capo_medialive.types.h264_adaptive_quantization.H264AdaptiveQuantization"
    ]
    """Enables or disables adaptive quantization (AQ), which is a technique MediaLive can apply to video on a frame-by-frame basis to produce more compression without losing quality. There are three types of adaptive quantization: spatial, temporal, and flicker. We recommend that you set the field to Auto. For more information about all the options, see the topic about video adaptive quantization in the MediaLive user guide."""
    afd_signaling: NotRequired["capo_medialive.types.afd_signaling.AfdSignaling"]
    """Indicates that AFD values will be written into the output stream. If afdSignaling is "auto", the system will try to preserve the input AFD value (in cases where multiple AFD values are valid). If set to "fixed", the AFD value will be the value configured in the fixedAfd parameter."""
    bitrate: NotRequired["capo_medialive.types.__integer_min1000.__integerMin1000"]
    """Average bitrate in bits/second. Required when the rate control mode is VBR or CBR. Not used for QVBR. In an MS Smooth output group, each output must have a unique value when its bitrate is rounded down to the nearest multiple of 1000."""
    buf_fill_pct: NotRequired[
        "capo_medialive.types.__integer_min0_max100.__integerMin0Max100"
    ]
    """Percentage of the buffer that should initially be filled (HRD buffer model)."""
    buf_size: NotRequired["capo_medialive.types.__integer_min0.__integerMin0"]
    """Size of buffer (HRD buffer model) in bits."""
    color_metadata: NotRequired[
        "capo_medialive.types.h264_color_metadata.H264ColorMetadata"
    ]
    """Includes colorspace metadata in the output."""
    color_space_settings: NotRequired[
        "capo_medialive.types.h264_color_space_settings.H264ColorSpaceSettings"
    ]
    """Specify the type of color space to apply or choose to pass through. The default is to pass through the color space that is in the source."""
    entropy_encoding: NotRequired[
        "capo_medialive.types.h264_entropy_encoding.H264EntropyEncoding"
    ]
    """Entropy encoding mode. Use cabac (must be in Main or High profile) or cavlc."""
    filter_settings: NotRequired[
        "capo_medialive.types.h264_filter_settings.H264FilterSettings"
    ]
    """Optional. Both filters reduce bandwidth by removing imperceptible details. You can enable one of the filters. We recommend that you try both filters and observe the results to decide which one to use. The Temporal Filter reduces bandwidth by removing imperceptible details in the content. It combines perceptual filtering and motion compensated temporal filtering (MCTF). It operates independently of the compression level. The Bandwidth Reduction filter is a perceptual filter located within the encoding loop. It adapts to the current compression level to filter imperceptible signals. This filter works only when the resolution is 1080p or lower."""
    fixed_afd: NotRequired["capo_medialive.types.fixed_afd.FixedAfd"]
    """Four bit AFD value to write on all frames of video in the output stream. Only valid when afdSignaling is set to 'Fixed'."""
    flicker_aq: NotRequired["capo_medialive.types.h264_flicker_aq.H264FlickerAq"]
    """Flicker AQ makes adjustments within each frame to reduce flicker or 'pop' on I-frames. The value to enter in this field depends on the value in the Adaptive quantization field. For more information, see the topic about video adaptive quantization in the MediaLive user guide."""
    force_field_pictures: NotRequired[
        "capo_medialive.types.h264_force_field_pictures.H264ForceFieldPictures"
    ]
    """This setting applies only when scan type is "interlaced." It controls whether coding is performed on a field basis or on a frame basis. (When the video is progressive, the coding is always performed on a frame basis.) enabled: Force MediaLive to code on a field basis, so that odd and even sets of fields are coded separately. disabled: Code the two sets of fields separately (on a field basis) or together (on a frame basis using PAFF), depending on what is most appropriate for the content."""
    framerate_control: NotRequired[
        "capo_medialive.types.h264_framerate_control.H264FramerateControl"
    ]
    """This field indicates how the output video frame rate is specified. If "specified" is selected then the output video frame rate is determined by framerateNumerator and framerateDenominator, else if "initializeFromSource" is selected then the output video frame rate will be set equal to the input video frame rate of the first input."""
    framerate_denominator: NotRequired[
        "capo_medialive.types.__integer_min1.__integerMin1"
    ]
    """Framerate denominator."""
    framerate_numerator: NotRequired[
        "capo_medialive.types.__integer_min1.__integerMin1"
    ]
    """Framerate numerator - framerate is a fraction, e.g. 24000 / 1001 = 23.976 fps."""
    gop_b_reference: NotRequired[
        "capo_medialive.types.h264_gop_b_reference.H264GopBReference"
    ]
    """Documentation update needed"""
    gop_closed_cadence: NotRequired["capo_medialive.types.__integer_min0.__integerMin0"]
    """Frequency of closed GOPs. In streaming applications, it is recommended that this be set to 1 so a decoder joining mid-stream will receive an IDR frame as quickly as possible. Setting this value to 0 will break output segmenting."""
    gop_num_b_frames: NotRequired[
        "capo_medialive.types.__integer_min0_max7.__integerMin0Max7"
    ]
    """Number of B-frames between reference frames."""
    gop_size: NotRequired["capo_medialive.types.__double.__double"]
    """GOP size (keyframe interval) in units of either frames or seconds per gopSizeUnits. If gopSizeUnits is frames, gopSize must be an integer and must be greater than or equal to 1. If gopSizeUnits is seconds, gopSize must be greater than 0, but need not be an integer."""
    gop_size_units: NotRequired[
        "capo_medialive.types.h264_gop_size_units.H264GopSizeUnits"
    ]
    """Indicates if the gopSize is specified in frames or seconds. If seconds the system will convert the gopSize into a frame count at run time."""
    level: NotRequired["capo_medialive.types.h264_level.H264Level"]
    """H.264 Level."""
    look_ahead_rate_control: NotRequired[
        "capo_medialive.types.h264_look_ahead_rate_control.H264LookAheadRateControl"
    ]
    """Amount of lookahead. A value of low can decrease latency and memory usage, while high can produce better quality for certain content."""
    max_bitrate: NotRequired["capo_medialive.types.__integer_min1000.__integerMin1000"]
    """For QVBR: See the tooltip for Quality level For VBR: Set the maximum bitrate in order to accommodate expected spikes in the complexity of the video."""
    min_i_interval: NotRequired[
        "capo_medialive.types.__integer_min0_max30.__integerMin0Max30"
    ]
    """Only meaningful if sceneChangeDetect is set to enabled. Defaults to 5 if multiplex rate control is used. Enforces separation between repeated (cadence) I-frames and I-frames inserted by Scene Change Detection. If a scene change I-frame is within I-interval frames of a cadence I-frame, the GOP is shrunk and/or stretched to the scene change I-frame. GOP stretch requires enabling lookahead as well as setting I-interval. The normal cadence resumes for the next GOP. Note: Maximum GOP stretch = GOP size + Min-I-interval - 1"""
    num_ref_frames: NotRequired[
        "capo_medialive.types.__integer_min1_max6.__integerMin1Max6"
    ]
    """Number of reference frames to use. The encoder may use more than requested if using B-frames and/or interlaced encoding."""
    par_control: NotRequired["capo_medialive.types.h264_par_control.H264ParControl"]
    """This field indicates how the output pixel aspect ratio is specified. If "specified" is selected then the output video pixel aspect ratio is determined by parNumerator and parDenominator, else if "initializeFromSource" is selected then the output pixsel aspect ratio will be set equal to the input video pixel aspect ratio of the first input."""
    par_denominator: NotRequired["capo_medialive.types.__integer_min1.__integerMin1"]
    """Pixel Aspect Ratio denominator."""
    par_numerator: NotRequired["capo_medialive.types.__integer_min1.__integerMin1"]
    """Pixel Aspect Ratio numerator."""
    profile: NotRequired["capo_medialive.types.h264_profile.H264Profile"]
    """H.264 Profile."""
    quality_level: NotRequired[
        "capo_medialive.types.h264_quality_level.H264QualityLevel"
    ]
    """Leave as STANDARD_QUALITY or choose a different value (which might result in additional costs to run the channel). - ENHANCED_QUALITY: Produces a slightly better video quality without an increase in the bitrate. Has an effect only when the Rate control mode is QVBR or CBR. If this channel is in a MediaLive multiplex, the value must be ENHANCED_QUALITY. - STANDARD_QUALITY: Valid for any Rate control mode."""
    qvbr_quality_level: NotRequired[
        "capo_medialive.types.__integer_min1_max10.__integerMin1Max10"
    ]
    """Controls the target quality for the video encode. Applies only when the rate control mode is QVBR. You can set a target quality or you can let MediaLive determine the best quality. To set a target quality, enter values in the QVBR quality level field and the Max bitrate field. Enter values that suit your most important viewing devices. Recommended values are: - Primary screen: Quality level: 8 to 10. Max bitrate: 4M - PC or tablet: Quality level: 7. Max bitrate: 1.5M to 3M - Smartphone: Quality level: 6. Max bitrate: 1M to 1.5M To let MediaLive decide, leave the QVBR quality level field empty, and in Max bitrate enter the maximum rate you want in the video. For more information, see the section called "Video - rate control mode" in the MediaLive user guide"""
    rate_control_mode: NotRequired[
        "capo_medialive.types.h264_rate_control_mode.H264RateControlMode"
    ]
    """Rate control mode. QVBR: Quality will match the specified quality level except when it is constrained by the maximum bitrate. Recommended if you or your viewers pay for bandwidth. VBR: Quality and bitrate vary, depending on the video complexity. Recommended instead of QVBR if you want to maintain a specific average bitrate over the duration of the channel. CBR: Quality varies, depending on the video complexity. Recommended only if you distribute your assets to devices that cannot handle variable bitrates. Multiplex: This rate control mode is only supported (and is required) when the video is being delivered to a MediaLive Multiplex in which case the rate control configuration is controlled by the properties within the Multiplex Program."""
    scan_type: NotRequired["capo_medialive.types.h264_scan_type.H264ScanType"]
    """Sets the scan type of the output to progressive or top-field-first interlaced."""
    scene_change_detect: NotRequired[
        "capo_medialive.types.h264_scene_change_detect.H264SceneChangeDetect"
    ]
    """Scene change detection. - On: inserts I-frames when scene change is detected. - Off: does not force an I-frame when scene change is detected."""
    slices: NotRequired["capo_medialive.types.__integer_min1_max32.__integerMin1Max32"]
    """Number of slices per picture. Must be less than or equal to the number of macroblock rows for progressive pictures, and less than or equal to half the number of macroblock rows for interlaced pictures. This field is optional; when no value is specified the encoder will choose the number of slices based on encode resolution."""
    softness: NotRequired[
        "capo_medialive.types.__integer_min0_max128.__integerMin0Max128"
    ]
    """Softness. Selects quantizer matrix, larger values reduce high-frequency content in the encoded image. If not set to zero, must be greater than 15."""
    spatial_aq: NotRequired["capo_medialive.types.h264_spatial_aq.H264SpatialAq"]
    """Spatial AQ makes adjustments within each frame based on spatial variation of content complexity. The value to enter in this field depends on the value in the Adaptive quantization field. For more information, see the topic about video adaptive quantization in the MediaLive user guide."""
    subgop_length: NotRequired[
        "capo_medialive.types.h264_sub_gop_length.H264SubGopLength"
    ]
    """If set to fixed, use gopNumBFrames B-frames per sub-GOP. If set to dynamic, optimize the number of B-frames used for each sub-GOP to improve visual quality."""
    syntax: NotRequired["capo_medialive.types.h264_syntax.H264Syntax"]
    """Produces a bitstream compliant with SMPTE RP-2027."""
    temporal_aq: NotRequired["capo_medialive.types.h264_temporal_aq.H264TemporalAq"]
    """Temporal makes adjustments within each frame based on variations in content complexity over time. The value to enter in this field depends on the value in the Adaptive quantization field. For more information, see the topic about video adaptive quantization in the MediaLive user guide."""
    timecode_insertion: NotRequired[
        "capo_medialive.types.h264_timecode_insertion_behavior.H264TimecodeInsertionBehavior"
    ]
    """Determines how timecodes should be inserted into the video elementary stream. - 'disabled': Do not include timecodes - 'picTimingSei': Pass through picture timing SEI messages from the source specified in Timecode Config"""
    timecode_burnin_settings: NotRequired[
        "capo_medialive.types.timecode_burnin_settings.TimecodeBurninSettings"
    ]
    """Timecode burn-in settings"""
    min_qp: NotRequired["capo_medialive.types.__integer_min1_max51.__integerMin1Max51"]
    """Sets the minimum QP. If you aren't familiar with quantization adjustment, leave the field empty. MediaLive will apply an appropriate value."""
    min_bitrate: NotRequired["capo_medialive.types.__integer_min0.__integerMin0"]
    """Used for QVBR rate control mode only. Optional. Enter a minimum bitrate if you want to keep the output bitrate about a threshold, in order to prevent the downstream system from de-allocating network bandwidth for this output."""

adaptive_quantization instance-attribute

adaptive_quantization: NotRequired[H264AdaptiveQuantization]

Enables or disables adaptive quantization (AQ), which is a technique MediaLive can apply to video on a frame-by-frame basis to produce more compression without losing quality. There are three types of adaptive quantization: spatial, temporal, and flicker. We recommend that you set the field to Auto. For more information about all the options, see the topic about video adaptive quantization in the MediaLive user guide.

afd_signaling instance-attribute

afd_signaling: NotRequired[AfdSignaling]

Indicates that AFD values will be written into the output stream. If afdSignaling is "auto", the system will try to preserve the input AFD value (in cases where multiple AFD values are valid). If set to "fixed", the AFD value will be the value configured in the fixedAfd parameter.

bitrate instance-attribute

bitrate: NotRequired[__integerMin1000]

Average bitrate in bits/second. Required when the rate control mode is VBR or CBR. Not used for QVBR. In an MS Smooth output group, each output must have a unique value when its bitrate is rounded down to the nearest multiple of 1000.

buf_fill_pct instance-attribute

buf_fill_pct: NotRequired[__integerMin0Max100]

Percentage of the buffer that should initially be filled (HRD buffer model).

buf_size instance-attribute

buf_size: NotRequired[__integerMin0]

Size of buffer (HRD buffer model) in bits.

color_metadata instance-attribute

color_metadata: NotRequired[H264ColorMetadata]

Includes colorspace metadata in the output.

color_space_settings instance-attribute

color_space_settings: NotRequired[H264ColorSpaceSettings]

Specify the type of color space to apply or choose to pass through. The default is to pass through the color space that is in the source.

entropy_encoding instance-attribute

entropy_encoding: NotRequired[H264EntropyEncoding]

Entropy encoding mode. Use cabac (must be in Main or High profile) or cavlc.

filter_settings instance-attribute

filter_settings: NotRequired[H264FilterSettings]

Optional. Both filters reduce bandwidth by removing imperceptible details. You can enable one of the filters. We recommend that you try both filters and observe the results to decide which one to use. The Temporal Filter reduces bandwidth by removing imperceptible details in the content. It combines perceptual filtering and motion compensated temporal filtering (MCTF). It operates independently of the compression level. The Bandwidth Reduction filter is a perceptual filter located within the encoding loop. It adapts to the current compression level to filter imperceptible signals. This filter works only when the resolution is 1080p or lower.

fixed_afd instance-attribute

fixed_afd: NotRequired[FixedAfd]

Four bit AFD value to write on all frames of video in the output stream. Only valid when afdSignaling is set to 'Fixed'.

flicker_aq instance-attribute

flicker_aq: NotRequired[H264FlickerAq]

Flicker AQ makes adjustments within each frame to reduce flicker or 'pop' on I-frames. The value to enter in this field depends on the value in the Adaptive quantization field. For more information, see the topic about video adaptive quantization in the MediaLive user guide.

force_field_pictures instance-attribute

force_field_pictures: NotRequired[H264ForceFieldPictures]

This setting applies only when scan type is "interlaced." It controls whether coding is performed on a field basis or on a frame basis. (When the video is progressive, the coding is always performed on a frame basis.) enabled: Force MediaLive to code on a field basis, so that odd and even sets of fields are coded separately. disabled: Code the two sets of fields separately (on a field basis) or together (on a frame basis using PAFF), depending on what is most appropriate for the content.

framerate_control instance-attribute

framerate_control: NotRequired[H264FramerateControl]

This field indicates how the output video frame rate is specified. If "specified" is selected then the output video frame rate is determined by framerateNumerator and framerateDenominator, else if "initializeFromSource" is selected then the output video frame rate will be set equal to the input video frame rate of the first input.

framerate_denominator instance-attribute

framerate_denominator: NotRequired[__integerMin1]

Framerate denominator.

framerate_numerator instance-attribute

framerate_numerator: NotRequired[__integerMin1]

Framerate numerator - framerate is a fraction, e.g. 24000 / 1001 = 23.976 fps.

gop_b_reference instance-attribute

gop_b_reference: NotRequired[H264GopBReference]

Documentation update needed

gop_closed_cadence instance-attribute

gop_closed_cadence: NotRequired[__integerMin0]

Frequency of closed GOPs. In streaming applications, it is recommended that this be set to 1 so a decoder joining mid-stream will receive an IDR frame as quickly as possible. Setting this value to 0 will break output segmenting.

gop_num_b_frames instance-attribute

gop_num_b_frames: NotRequired[__integerMin0Max7]

Number of B-frames between reference frames.

gop_size instance-attribute

gop_size: NotRequired[__double]

GOP size (keyframe interval) in units of either frames or seconds per gopSizeUnits. If gopSizeUnits is frames, gopSize must be an integer and must be greater than or equal to 1. If gopSizeUnits is seconds, gopSize must be greater than 0, but need not be an integer.

gop_size_units instance-attribute

gop_size_units: NotRequired[H264GopSizeUnits]

Indicates if the gopSize is specified in frames or seconds. If seconds the system will convert the gopSize into a frame count at run time.

level instance-attribute

level: NotRequired[H264Level]

H.264 Level.

look_ahead_rate_control instance-attribute

look_ahead_rate_control: NotRequired[H264LookAheadRateControl]

Amount of lookahead. A value of low can decrease latency and memory usage, while high can produce better quality for certain content.

max_bitrate instance-attribute

max_bitrate: NotRequired[__integerMin1000]

For QVBR: See the tooltip for Quality level For VBR: Set the maximum bitrate in order to accommodate expected spikes in the complexity of the video.

min_bitrate instance-attribute

min_bitrate: NotRequired[__integerMin0]

Used for QVBR rate control mode only. Optional. Enter a minimum bitrate if you want to keep the output bitrate about a threshold, in order to prevent the downstream system from de-allocating network bandwidth for this output.

min_i_interval instance-attribute

min_i_interval: NotRequired[__integerMin0Max30]

Only meaningful if sceneChangeDetect is set to enabled. Defaults to 5 if multiplex rate control is used. Enforces separation between repeated (cadence) I-frames and I-frames inserted by Scene Change Detection. If a scene change I-frame is within I-interval frames of a cadence I-frame, the GOP is shrunk and/or stretched to the scene change I-frame. GOP stretch requires enabling lookahead as well as setting I-interval. The normal cadence resumes for the next GOP. Note: Maximum GOP stretch = GOP size + Min-I-interval - 1

min_qp instance-attribute

min_qp: NotRequired[__integerMin1Max51]

Sets the minimum QP. If you aren't familiar with quantization adjustment, leave the field empty. MediaLive will apply an appropriate value.

num_ref_frames instance-attribute

num_ref_frames: NotRequired[__integerMin1Max6]

Number of reference frames to use. The encoder may use more than requested if using B-frames and/or interlaced encoding.

par_control instance-attribute

par_control: NotRequired[H264ParControl]

This field indicates how the output pixel aspect ratio is specified. If "specified" is selected then the output video pixel aspect ratio is determined by parNumerator and parDenominator, else if "initializeFromSource" is selected then the output pixsel aspect ratio will be set equal to the input video pixel aspect ratio of the first input.

par_denominator instance-attribute

par_denominator: NotRequired[__integerMin1]

Pixel Aspect Ratio denominator.

par_numerator instance-attribute

par_numerator: NotRequired[__integerMin1]

Pixel Aspect Ratio numerator.

profile instance-attribute

profile: NotRequired[H264Profile]

H.264 Profile.

quality_level instance-attribute

quality_level: NotRequired[H264QualityLevel]

Leave as STANDARD_QUALITY or choose a different value (which might result in additional costs to run the channel). - ENHANCED_QUALITY: Produces a slightly better video quality without an increase in the bitrate. Has an effect only when the Rate control mode is QVBR or CBR. If this channel is in a MediaLive multiplex, the value must be ENHANCED_QUALITY. - STANDARD_QUALITY: Valid for any Rate control mode.

qvbr_quality_level instance-attribute

qvbr_quality_level: NotRequired[__integerMin1Max10]

Controls the target quality for the video encode. Applies only when the rate control mode is QVBR. You can set a target quality or you can let MediaLive determine the best quality. To set a target quality, enter values in the QVBR quality level field and the Max bitrate field. Enter values that suit your most important viewing devices. Recommended values are: - Primary screen: Quality level: 8 to 10. Max bitrate: 4M - PC or tablet: Quality level: 7. Max bitrate: 1.5M to 3M - Smartphone: Quality level: 6. Max bitrate: 1M to 1.5M To let MediaLive decide, leave the QVBR quality level field empty, and in Max bitrate enter the maximum rate you want in the video. For more information, see the section called "Video - rate control mode" in the MediaLive user guide

rate_control_mode instance-attribute

rate_control_mode: NotRequired[H264RateControlMode]

Rate control mode. QVBR: Quality will match the specified quality level except when it is constrained by the maximum bitrate. Recommended if you or your viewers pay for bandwidth. VBR: Quality and bitrate vary, depending on the video complexity. Recommended instead of QVBR if you want to maintain a specific average bitrate over the duration of the channel. CBR: Quality varies, depending on the video complexity. Recommended only if you distribute your assets to devices that cannot handle variable bitrates. Multiplex: This rate control mode is only supported (and is required) when the video is being delivered to a MediaLive Multiplex in which case the rate control configuration is controlled by the properties within the Multiplex Program.

scan_type instance-attribute

scan_type: NotRequired[H264ScanType]

Sets the scan type of the output to progressive or top-field-first interlaced.

scene_change_detect instance-attribute

scene_change_detect: NotRequired[H264SceneChangeDetect]

Scene change detection. - On: inserts I-frames when scene change is detected. - Off: does not force an I-frame when scene change is detected.

slices instance-attribute

slices: NotRequired[__integerMin1Max32]

Number of slices per picture. Must be less than or equal to the number of macroblock rows for progressive pictures, and less than or equal to half the number of macroblock rows for interlaced pictures. This field is optional; when no value is specified the encoder will choose the number of slices based on encode resolution.

softness instance-attribute

softness: NotRequired[__integerMin0Max128]

Softness. Selects quantizer matrix, larger values reduce high-frequency content in the encoded image. If not set to zero, must be greater than 15.

spatial_aq instance-attribute

spatial_aq: NotRequired[H264SpatialAq]

Spatial AQ makes adjustments within each frame based on spatial variation of content complexity. The value to enter in this field depends on the value in the Adaptive quantization field. For more information, see the topic about video adaptive quantization in the MediaLive user guide.

subgop_length instance-attribute

subgop_length: NotRequired[H264SubGopLength]

If set to fixed, use gopNumBFrames B-frames per sub-GOP. If set to dynamic, optimize the number of B-frames used for each sub-GOP to improve visual quality.

syntax instance-attribute

syntax: NotRequired[H264Syntax]

Produces a bitstream compliant with SMPTE RP-2027.

temporal_aq instance-attribute

temporal_aq: NotRequired[H264TemporalAq]

Temporal makes adjustments within each frame based on variations in content complexity over time. The value to enter in this field depends on the value in the Adaptive quantization field. For more information, see the topic about video adaptive quantization in the MediaLive user guide.

timecode_burnin_settings instance-attribute

timecode_burnin_settings: NotRequired[TimecodeBurninSettings]

Timecode burn-in settings

timecode_insertion instance-attribute

timecode_insertion: NotRequired[H264TimecodeInsertionBehavior]

Determines how timecodes should be inserted into the video elementary stream. - 'disabled': Do not include timecodes - 'picTimingSei': Pass through picture timing SEI messages from the source specified in Timecode Config