H264SettingsProps

class aws_cdk.aws_medialive_alpha.H264SettingsProps(*, adaptive_quantization=None, afd_signaling=None, buf_fill_pct=None, buf_size=None, color_metadata=None, color_space_settings=None, entropy_encoding=None, filter_settings=None, fixed_afd=None, flicker_aq=None, force_field_pictures=None, framerate=None, gop_b_reference=None, gop_closed_cadence=None, gop_num_b_frames=None, gop_size=None, level=None, look_ahead_rate_control=None, min_bitrate=None, min_i_interval=None, min_qp=None, num_ref_frames=None, pixel_aspect_ratio=None, profile=None, quality_level=None, rate_control=None, scan_type=None, scene_change_detect=None, slices=None, softness=None, spatial_aq=None, subgop_length=None, syntax=None, temporal_aq=None, timecode_burnin=None, timecode_insertion=None)

Bases: object

(experimental) Properties for H.264 codec settings.

Parameters:
  • adaptive_quantization (Optional[H264AdaptiveQuantization]) – (experimental) The adaptive quantization. This allows intra-frame quantizers to vary to improve visual quality. Default: H264AdaptiveQuantization.AUTO

  • afd_signaling (Optional[AfdSignaling]) – (experimental) Indicates that AFD values will be written into the output stream. If afdSignaling is auto, the system tries to preserve the input AFD value (in cases where multiple AFD values are valid). If set to fixed, the AFD value is the value configured in the fixedAfd parameter. Default: AfdSignaling.NONE

  • buf_fill_pct (Union[int, float, None]) – (experimental) Percentage of the buffer that should initially be filled (HRD buffer model). Default: - service default

  • buf_size (Union[int, float, None]) – (experimental) Size of the buffer (HRD buffer model) in bits/second. Default: - service default

  • color_metadata (Optional[ColorMetadata]) – (experimental) Whether to include color space metadata in the output. Default: - service default

  • color_space_settings (Optional[H264ColorSpaceSettings]) – (experimental) Color space settings for the video. Default: - service default

  • entropy_encoding (Optional[H264EntropyEncoding]) – (experimental) The entropy encoding mode. CABAC requires Main or High profile. Default: - service default

  • filter_settings (Optional[H264FilterSettings]) – (experimental) Optional video filter settings. Default: - service default

  • fixed_afd (Optional[str]) – (experimental) Four-bit AFD value to write on all frames. Only valid when afdSignaling is FIXED. Valid values: FIXED_0000, FIXED_0010, FIXED_0011, FIXED_0100, FIXED_1000, FIXED_1001, FIXED_1010, FIXED_1011, FIXED_1100, FIXED_1101, FIXED_1110, FIXED_1111. Default: - service default

  • flicker_aq (Optional[FlickerAq]) – (experimental) If enabled, adjusts quantization within each frame to reduce flicker on I-frames. Default: FlickerAq.ENABLED

  • force_field_pictures (Optional[H264ForceFieldPictures]) – (experimental) Controls whether coding is on a field basis or frame basis when scan type is interlaced. Default: - service default

  • framerate (Optional[Framerate]) – (experimental) The video frame rate. Default: - follow source

  • gop_b_reference (Optional[GopBReference]) – (experimental) If enabled, uses reference B frames for GOP structures that have B frames > 1. Default: - service default

  • gop_closed_cadence (Union[int, float, None]) – (experimental) Frequency of closed GOPs. Set to 1 for streaming so decoders joining mid-stream get an IDR frame quickly. Default: - service default

  • gop_num_b_frames (Union[int, float, None]) – (experimental) The number of B-frames between reference frames. Default: - service default

  • gop_size (Optional[GopSize]) – (experimental) The GOP size (keyframe interval). Default: GopSize.seconds(1)

  • level (Optional[H264Level]) – (experimental) The H.264 level. Valid values: H264_LEVEL_1, H264_LEVEL_1_1, H264_LEVEL_1_2, H264_LEVEL_1_3, H264_LEVEL_2, H264_LEVEL_2_1, H264_LEVEL_2_2, H264_LEVEL_3, H264_LEVEL_3_1, H264_LEVEL_3_2, H264_LEVEL_4, H264_LEVEL_4_1, H264_LEVEL_4_2, H264_LEVEL_5, H264_LEVEL_5_1, H264_LEVEL_5_2, H264_LEVEL_AUTO. Default: H264Level.H264_LEVEL_AUTO

  • look_ahead_rate_control (Optional[LookAheadRateControl]) – (experimental) Amount of lookahead. Low decreases latency/memory; high can produce better quality. Default: LookAheadRateControl.HIGH

  • min_bitrate (Union[int, float, None]) – (experimental) Minimum bitrate in bits/second. Default: - service default

  • min_i_interval (Union[int, float, None]) – (experimental) Only meaningful if sceneChangeDetect is enabled. Enforces separation between repeated (cadence) I-frames and I-frames inserted by scene change detection. Default: - service default

  • min_qp (Union[int, float, None]) – (experimental) Minimum QP value. Sets a floor on the quantization parameter. Default: - service default

  • num_ref_frames (Union[int, float, None]) – (experimental) The number of reference frames to use. The encoder might use more if B-frames or interlaced encoding is used. Default: - service default

  • pixel_aspect_ratio (Optional[PixelAspectRatio]) – (experimental) The pixel aspect ratio (PAR) of the video. Default: - follow source (or square pixels when framerate is specified)

  • profile (Optional[H264Profile]) – (experimental) The H.264 profile. Default: H264Profile.MAIN

  • quality_level (Optional[H264QualityLevel]) – (experimental) Quality level. ENHANCED_QUALITY produces slightly better video without increasing bitrate. Default: - service default

  • rate_control (Optional[H264RateControl]) – (experimental) The rate control configuration. Default: - CBR with no bitrate (service default)

  • scan_type (Optional[ScanType]) – (experimental) Sets the scan type of the output. Default: ScanType.PROGRESSIVE

  • scene_change_detect (Optional[H264SceneChangeDetect]) – (experimental) Whether scene change detection inserts I-frames on scene changes. Default: H264SceneChangeDetect.ENABLED

  • slices (Union[int, float, None]) – (experimental) Number of slices per picture. Must be <= macroblock rows (progressive) or half (interlaced). Default: - encoder chooses based on resolution

  • softness (Union[int, float, None]) – (experimental) Softness. Selects a quantizer matrix; larger values reduce high-frequency content. Default: - service default

  • spatial_aq (Optional[H264SpatialAq]) – (experimental) Whether spatial adaptive quantization adjusts quantization within each frame based on spatial variation. Default: H264SpatialAq.ENABLED

  • subgop_length (Optional[SubgopLength]) – (experimental) Sub-GOP length mode. Default: - service default

  • syntax (Optional[H264Syntax]) – (experimental) Produces a bitstream compliant with SMPTE RP-2027. Default: H264Syntax.DEFAULT

  • temporal_aq (Optional[H264TemporalAq]) – (experimental) Whether temporal adaptive quantization adjusts quantization based on temporal variation between frames. Default: H264TemporalAq.ENABLED

  • timecode_burnin (Union[TimecodeBurninSettings, Dict[str, Any], None]) – (experimental) Timecode burn-in settings to overlay timecode on the video. Default: - no timecode burn-in

  • timecode_insertion (Optional[TimecodeInsertion]) – (experimental) Determines how timecodes are inserted into the video elementary stream. This controls insertion into the output elementary stream. The channel’s timecodeConfig controls the source of the timecode used for output. Default: - service default

Stability:

experimental

ExampleMetadata:

infused

Example:

# stack: Stack
# input: medialive.IInput
# bucket: s3.IBucket


video = medialive.EncodeConfiguration.video(
    name="video_720p",
    codec=medialive.VideoCodecSettings.h264(
        rate_control=medialive.H264RateControl.cbr(bitrate=Bitrate.mbps(3)),
        framerate=medialive.Framerate.FPS_30
    ),
    width=1280,
    height=720
)

audio = medialive.EncodeConfiguration.audio(
    name="audio_aac",
    codec=medialive.AudioCodecSettings.aac(bitrate=Bitrate.kbps(192))
)

medialive.Channel(stack, "Channel",
    inputs=[medialive.InputAttachment(input=input)],
    output_groups=[
        medialive.OutputGroupConfiguration.hls(
            name="hls",
            destinations=[medialive.OutputDestination.to_bucket(bucket, "live/stream")],
            outputs=[medialive.HlsOutputDefinition(encodes=[video, audio], output_name="hls_out")]
        )
    ]
)

Attributes

adaptive_quantization

(experimental) The adaptive quantization.

This allows intra-frame quantizers to vary to improve visual quality.

Default:

H264AdaptiveQuantization.AUTO

Stability:

experimental

afd_signaling

(experimental) Indicates that AFD values will be written into the output stream.

If afdSignaling is auto, the system tries to preserve the input AFD value (in cases where multiple AFD values are valid). If set to fixed, the AFD value is the value configured in the fixedAfd parameter.

Default:

AfdSignaling.NONE

Stability:

experimental

buf_fill_pct

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

Default:
  • service default

Stability:

experimental

buf_size

(experimental) Size of the buffer (HRD buffer model) in bits/second.

Default:
  • service default

Stability:

experimental

color_metadata

(experimental) Whether to include color space metadata in the output.

Default:
  • service default

Stability:

experimental

color_space_settings

(experimental) Color space settings for the video.

Default:
  • service default

Stability:

experimental

entropy_encoding

(experimental) The entropy encoding mode.

CABAC requires Main or High profile.

Default:
  • service default

Stability:

experimental

filter_settings

(experimental) Optional video filter settings.

Default:
  • service default

Stability:

experimental

fixed_afd

(experimental) Four-bit AFD value to write on all frames. Only valid when afdSignaling is FIXED.

Valid values: FIXED_0000, FIXED_0010, FIXED_0011, FIXED_0100, FIXED_1000, FIXED_1001, FIXED_1010, FIXED_1011, FIXED_1100, FIXED_1101, FIXED_1110, FIXED_1111.

Default:
  • service default

Stability:

experimental

flicker_aq

(experimental) If enabled, adjusts quantization within each frame to reduce flicker on I-frames.

Default:

FlickerAq.ENABLED

Stability:

experimental

force_field_pictures

(experimental) Controls whether coding is on a field basis or frame basis when scan type is interlaced.

Default:
  • service default

Stability:

experimental

framerate

(experimental) The video frame rate.

Default:
  • follow source

Stability:

experimental

gop_b_reference

(experimental) If enabled, uses reference B frames for GOP structures that have B frames > 1.

Default:
  • service default

Stability:

experimental

gop_closed_cadence

(experimental) Frequency of closed GOPs.

Set to 1 for streaming so decoders joining mid-stream get an IDR frame quickly.

Default:
  • service default

Stability:

experimental

gop_num_b_frames

(experimental) The number of B-frames between reference frames.

Default:
  • service default

Stability:

experimental

gop_size

(experimental) The GOP size (keyframe interval).

Default:

GopSize.seconds(1)

Stability:

experimental

level

(experimental) The H.264 level.

Valid values: H264_LEVEL_1, H264_LEVEL_1_1, H264_LEVEL_1_2, H264_LEVEL_1_3, H264_LEVEL_2, H264_LEVEL_2_1, H264_LEVEL_2_2, H264_LEVEL_3, H264_LEVEL_3_1, H264_LEVEL_3_2, H264_LEVEL_4, H264_LEVEL_4_1, H264_LEVEL_4_2, H264_LEVEL_5, H264_LEVEL_5_1, H264_LEVEL_5_2, H264_LEVEL_AUTO.

Default:

H264Level.H264_LEVEL_AUTO

Stability:

experimental

look_ahead_rate_control

(experimental) Amount of lookahead.

Low decreases latency/memory; high can produce better quality.

Default:

LookAheadRateControl.HIGH

Stability:

experimental

min_bitrate

(experimental) Minimum bitrate in bits/second.

Default:
  • service default

Stability:

experimental

min_i_interval

(experimental) Only meaningful if sceneChangeDetect is enabled.

Enforces separation between repeated (cadence) I-frames and I-frames inserted by scene change detection.

Default:
  • service default

Stability:

experimental

min_qp

(experimental) Minimum QP value.

Sets a floor on the quantization parameter.

Default:
  • service default

Stability:

experimental

num_ref_frames

(experimental) The number of reference frames to use.

The encoder might use more if B-frames or interlaced encoding is used.

Default:
  • service default

Stability:

experimental

pixel_aspect_ratio

(experimental) The pixel aspect ratio (PAR) of the video.

Default:
  • follow source (or square pixels when framerate is specified)

Stability:

experimental

profile

(experimental) The H.264 profile.

Default:

H264Profile.MAIN

Stability:

experimental

quality_level

(experimental) Quality level.

ENHANCED_QUALITY produces slightly better video without increasing bitrate.

Default:
  • service default

Stability:

experimental

rate_control

(experimental) The rate control configuration.

Default:
  • CBR with no bitrate (service default)

Stability:

experimental

scan_type

(experimental) Sets the scan type of the output.

Default:

ScanType.PROGRESSIVE

Stability:

experimental

scene_change_detect

(experimental) Whether scene change detection inserts I-frames on scene changes.

Default:

H264SceneChangeDetect.ENABLED

Stability:

experimental

slices

(experimental) Number of slices per picture.

Must be <= macroblock rows (progressive) or half (interlaced).

Default:
  • encoder chooses based on resolution

Stability:

experimental

softness

(experimental) Softness.

Selects a quantizer matrix; larger values reduce high-frequency content.

Default:
  • service default

Stability:

experimental

spatial_aq

(experimental) Whether spatial adaptive quantization adjusts quantization within each frame based on spatial variation.

Default:

H264SpatialAq.ENABLED

Stability:

experimental

subgop_length

(experimental) Sub-GOP length mode.

Default:
  • service default

Stability:

experimental

syntax

(experimental) Produces a bitstream compliant with SMPTE RP-2027.

Default:

H264Syntax.DEFAULT

Stability:

experimental

temporal_aq

(experimental) Whether temporal adaptive quantization adjusts quantization based on temporal variation between frames.

Default:

H264TemporalAq.ENABLED

Stability:

experimental

timecode_burnin

(experimental) Timecode burn-in settings to overlay timecode on the video.

Default:
  • no timecode burn-in

Stability:

experimental

timecode_insertion

(experimental) Determines how timecodes are inserted into the video elementary stream.

This controls insertion into the output elementary stream. The channel’s timecodeConfig controls the source of the timecode used for output.

Default:
  • service default

Stability:

experimental