VideoCodecSettings
- class aws_cdk.aws_medialive_alpha.VideoCodecSettings
Bases:
object(experimental) Video codec settings.
Use the static factory methods to create.
- 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")] ) ] )
- Stability:
experimental
Static Methods
- classmethod av1(*, afd_signaling=None, bit_depth=None, buf_size=None, color_space_settings=None, fixed_afd=None, framerate=None, gop_size=None, level=None, look_ahead_rate_control=None, min_bitrate=None, min_i_interval=None, pixel_aspect_ratio=None, rate_control=None, scene_change_detect=None, spatial_aq=None, temporal_aq=None, timecode_burnin=None, timecode_insertion=None)
(experimental) Create AV1 codec settings.
- Parameters:
afd_signaling (
Optional[AfdSignaling]) – (experimental) AFD signaling mode. Default: AfdSignaling.NONEbit_depth (
Optional[Av1BitDepth]) – (experimental) Bit depth for the AV1 encode. Default: - service defaultbuf_size (
Union[int,float,None]) – (experimental) Size of buffer (HRD buffer model) in bits. Default: - service defaultcolor_space_settings (
Optional[Av1ColorSpaceSettings]) – (experimental) Color space settings for the video. Default: - service defaultfixed_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 defaultframerate (
Optional[Framerate]) – (experimental) The video frame rate. Default: - follow sourcegop_size (
Optional[GopSize]) – (experimental) The GOP size (keyframe interval). Default: GopSize.seconds(1)level (
Optional[Av1Level]) – (experimental) The AV1 level. Valid values: AV1_LEVEL_2, AV1_LEVEL_2_1, AV1_LEVEL_3, AV1_LEVEL_3_1, AV1_LEVEL_4, AV1_LEVEL_4_1, AV1_LEVEL_5, AV1_LEVEL_5_1, AV1_LEVEL_5_2, AV1_LEVEL_5_3, AV1_LEVEL_6, AV1_LEVEL_6_1, AV1_LEVEL_6_2, AV1_LEVEL_6_3, AV1_LEVEL_AUTO. Default: Av1Level.AV1_LEVEL_AUTOlook_ahead_rate_control (
Optional[LookAheadRateControl]) – (experimental) Amount of lookahead. Low decreases latency/memory; high can produce better quality. Default: LookAheadRateControl.HIGHmin_bitrate (
Union[int,float,None]) – (experimental) Minimum bitrate in bits/second. Default: - service defaultmin_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 defaultpixel_aspect_ratio (
Optional[PixelAspectRatio]) – (experimental) The pixel aspect ratio (PAR) of the video. Default: - service defaultrate_control (
Optional[Av1RateControl]) – (experimental) The rate control configuration. Default: - service defaultscene_change_detect (
Optional[Av1SceneChangeDetect]) – (experimental) Scene change detection. Default: Av1SceneChangeDetect.ENABLEDspatial_aq (
Optional[Av1SpatialAq]) – (experimental) Spatial adaptive quantization. Default: Av1SpatialAq.ENABLEDtemporal_aq (
Optional[Av1TemporalAq]) – (experimental) Temporal adaptive quantization. Default: Av1TemporalAq.ENABLEDtimecode_burnin (
Union[TimecodeBurninSettings,Dict[str,Any],None]) – (experimental) Timecode burn-in settings to overlay timecode on the video. Default: - no timecode burn-intimecode_insertion (
Optional[Av1TimecodeInsertion]) – (experimental) Timecode insertion mode. Default: - service default
- Stability:
experimental
- Return type:
- classmethod frame_capture(*, capture_interval=None, timecode_burnin=None)
(experimental) Create frame capture codec settings.
- Parameters:
capture_interval (
Optional[Duration]) – (experimental) The interval between frame captures. Default: - service defaulttimecode_burnin (
Union[TimecodeBurninSettings,Dict[str,Any],None]) – (experimental) Timecode burn-in settings to overlay timecode on the video. Default: - no timecode burn-in
- Stability:
experimental
- Return type:
- classmethod h264(*, 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)
(experimental) Create H.264 (AVC) codec settings.
- Parameters:
adaptive_quantization (
Optional[H264AdaptiveQuantization]) – (experimental) The adaptive quantization. This allows intra-frame quantizers to vary to improve visual quality. Default: H264AdaptiveQuantization.AUTOafd_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.NONEbuf_fill_pct (
Union[int,float,None]) – (experimental) Percentage of the buffer that should initially be filled (HRD buffer model). Default: - service defaultbuf_size (
Union[int,float,None]) – (experimental) Size of the buffer (HRD buffer model) in bits/second. Default: - service defaultcolor_metadata (
Optional[ColorMetadata]) – (experimental) Whether to include color space metadata in the output. Default: - service defaultcolor_space_settings (
Optional[H264ColorSpaceSettings]) – (experimental) Color space settings for the video. Default: - service defaultentropy_encoding (
Optional[H264EntropyEncoding]) – (experimental) The entropy encoding mode. CABAC requires Main or High profile. Default: - service defaultfilter_settings (
Optional[H264FilterSettings]) – (experimental) Optional video filter settings. Default: - service defaultfixed_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 defaultflicker_aq (
Optional[FlickerAq]) – (experimental) If enabled, adjusts quantization within each frame to reduce flicker on I-frames. Default: FlickerAq.ENABLEDforce_field_pictures (
Optional[H264ForceFieldPictures]) – (experimental) Controls whether coding is on a field basis or frame basis when scan type is interlaced. Default: - service defaultframerate (
Optional[Framerate]) – (experimental) The video frame rate. Default: - follow sourcegop_b_reference (
Optional[GopBReference]) – (experimental) If enabled, uses reference B frames for GOP structures that have B frames > 1. Default: - service defaultgop_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 defaultgop_num_b_frames (
Union[int,float,None]) – (experimental) The number of B-frames between reference frames. Default: - service defaultgop_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_AUTOlook_ahead_rate_control (
Optional[LookAheadRateControl]) – (experimental) Amount of lookahead. Low decreases latency/memory; high can produce better quality. Default: LookAheadRateControl.HIGHmin_bitrate (
Union[int,float,None]) – (experimental) Minimum bitrate in bits/second. Default: - service defaultmin_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 defaultmin_qp (
Union[int,float,None]) – (experimental) Minimum QP value. Sets a floor on the quantization parameter. Default: - service defaultnum_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 defaultpixel_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.MAINquality_level (
Optional[H264QualityLevel]) – (experimental) Quality level. ENHANCED_QUALITY produces slightly better video without increasing bitrate. Default: - service defaultrate_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.PROGRESSIVEscene_change_detect (
Optional[H264SceneChangeDetect]) – (experimental) Whether scene change detection inserts I-frames on scene changes. Default: H264SceneChangeDetect.ENABLEDslices (
Union[int,float,None]) – (experimental) Number of slices per picture. Must be <= macroblock rows (progressive) or half (interlaced). Default: - encoder chooses based on resolutionsoftness (
Union[int,float,None]) – (experimental) Softness. Selects a quantizer matrix; larger values reduce high-frequency content. Default: - service defaultspatial_aq (
Optional[H264SpatialAq]) – (experimental) Whether spatial adaptive quantization adjusts quantization within each frame based on spatial variation. Default: H264SpatialAq.ENABLEDsubgop_length (
Optional[SubgopLength]) – (experimental) Sub-GOP length mode. Default: - service defaultsyntax (
Optional[H264Syntax]) – (experimental) Produces a bitstream compliant with SMPTE RP-2027. Default: H264Syntax.DEFAULTtemporal_aq (
Optional[H264TemporalAq]) – (experimental) Whether temporal adaptive quantization adjusts quantization based on temporal variation between frames. Default: H264TemporalAq.ENABLEDtimecode_burnin (
Union[TimecodeBurninSettings,Dict[str,Any],None]) – (experimental) Timecode burn-in settings to overlay timecode on the video. Default: - no timecode burn-intimecode_insertion (
Optional[TimecodeInsertion]) – (experimental) Determines how timecodes are inserted into the video elementary stream. This controls insertion into the output elementary stream. The channel’stimecodeConfigcontrols the source of the timecode used for output. Default: - service default
- Stability:
experimental
- Return type:
- classmethod h265(*, framerate, adaptive_quantization=None, afd_signaling=None, alternative_transfer_function=None, buf_size=None, color_metadata=None, color_space_settings=None, deblocking=None, filter_settings=None, fixed_afd=None, flicker_aq=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, mv_over_picture_boundaries=None, mv_temporal_predictor=None, pixel_aspect_ratio=None, profile=None, rate_control=None, scan_type=None, scene_change_detect=None, slices=None, subgop_length=None, tier=None, tile_height=None, tile_padding=None, tile_width=None, timecode_burnin=None, timecode_insertion=None, treeblock_size=None)
(experimental) Create H.265 (HEVC) codec settings. Framerate is required for H.265.
- Parameters:
framerate (
Framerate) – (experimental) The video frame rate. Required for H.265.adaptive_quantization (
Optional[H265AdaptiveQuantization]) – (experimental) The adaptive quantization. Allows intra-frame quantizers to vary to improve visual quality. Default: H265AdaptiveQuantization.AUTOafd_signaling (
Optional[AfdSignaling]) – (experimental) AFD signaling mode. Default: AfdSignaling.NONEalternative_transfer_function (
Optional[H265AlternativeTransferFunction]) – (experimental) Whether to insert an Alternative Transfer Function SEI message for backwards compatibility with non-HDR decoders. Default: - service defaultbuf_size (
Union[int,float,None]) – (experimental) Size of buffer (HRD buffer model) in bits. Default: - service defaultcolor_metadata (
Optional[ColorMetadata]) – (experimental) Whether to include color space metadata in the output. Default: - service defaultcolor_space_settings (
Optional[H265ColorSpaceSettings]) – (experimental) Color space settings for the video. Default: - service defaultdeblocking (
Optional[H265Deblocking]) – (experimental) Deblocking filter control. Default: - service defaultfilter_settings (
Optional[H265FilterSettings]) – (experimental) Optional video filter settings. Default: - service defaultfixed_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 defaultflicker_aq (
Optional[FlickerAq]) – (experimental) If enabled, adjusts quantization within each frame to reduce flicker on I-frames. Default: - service defaultgop_b_reference (
Optional[GopBReference]) – (experimental) If enabled, uses reference B frames for GOP structures that have B frames > 1. Default: - service defaultgop_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 defaultgop_num_b_frames (
Union[int,float,None]) – (experimental) Number of B-frames between reference frames. Default: - service defaultgop_size (
Optional[GopSize]) – (experimental) The GOP size (keyframe interval). Default: GopSize.seconds(1)level (
Optional[H265Level]) – (experimental) The H.265 level. Valid values: H265_LEVEL_1, H265_LEVEL_2, H265_LEVEL_2_1, H265_LEVEL_3, H265_LEVEL_3_1, H265_LEVEL_4, H265_LEVEL_4_1, H265_LEVEL_5, H265_LEVEL_5_1, H265_LEVEL_5_2, H265_LEVEL_6, H265_LEVEL_6_1, H265_LEVEL_6_2, H265_LEVEL_AUTO. Default: - service default (auto)look_ahead_rate_control (
Optional[LookAheadRateControl]) – (experimental) Amount of lookahead. Low decreases latency/memory; high can produce better quality. Default: - service defaultmin_bitrate (
Union[int,float,None]) – (experimental) Minimum bitrate in bits/second. Default: - service defaultmin_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 defaultmin_qp (
Union[int,float,None]) – (experimental) Minimum QP value. Default: - service defaultmv_over_picture_boundaries (
Optional[H265MvOverPictureBoundaries]) – (experimental) Whether motion vectors can cross picture boundaries. Default: - service defaultmv_temporal_predictor (
Optional[H265MvTemporalPredictor]) – (experimental) Whether to use temporal motion vector prediction. Default: - service defaultpixel_aspect_ratio (
Optional[PixelAspectRatio]) – (experimental) The pixel aspect ratio (PAR) of the video. Default: - square pixelsprofile (
Optional[H265Profile]) – (experimental) The H.265 profile. Default: H265Profile.MAINrate_control (
Optional[H265RateControl]) – (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.PROGRESSIVEscene_change_detect (
Optional[H265SceneChangeDetect]) – (experimental) Whether scene change detection inserts I-frames on scene changes. Default: H265SceneChangeDetect.ENABLEDslices (
Union[int,float,None]) – (experimental) Number of slices per picture. Default: - encoder chooses based on resolutionsubgop_length (
Optional[SubgopLength]) – (experimental) Sub-GOP length mode. Default: - service defaulttier (
Optional[H265Tier]) – (experimental) The H.265 tier. Default: H265Tier.MAINtile_height (
Union[int,float,None]) – (experimental) Tile height in pixels. Must be a multiple of the CTU size. Default: - service defaulttile_padding (
Optional[H265TilePadding]) – (experimental) Tile padding mode. Default: - service defaulttile_width (
Union[int,float,None]) – (experimental) Tile width in pixels. Must be a multiple of the CTU size. Default: - service defaulttimecode_burnin (
Union[TimecodeBurninSettings,Dict[str,Any],None]) – (experimental) Timecode burn-in settings to overlay timecode on the video. Default: - no timecode burn-intimecode_insertion (
Optional[TimecodeInsertion]) – (experimental) Determines how timecodes are inserted into the video elementary stream. This controls insertion into the output elementary stream. The channel’stimecodeConfigcontrols the source of the timecode used for output. Default: - service defaulttreeblock_size (
Optional[H265TreeblockSize]) – (experimental) Treeblock size for the encoder. Default: - service default
- Stability:
experimental
- Return type: