Bitrate

class aws_cdk.Bitrate(*args: Any, **kwargs)

Bases: object

Represents a bitrate value.

The amount can be specified either as a literal value (e.g: 10) which cannot be negative, or as an unresolved number token.

When the amount is passed as a token, unit conversion is not possible.

ExampleMetadata:

infused

Example:

from aws_cdk.aws_mediapackagev2_alpha import FilterConfiguration
# channel: Channel


OriginEndpoint(self, "Endpoint",
    channel=channel,
    segment=Segment.cmaf(),
    manifests=[
        Manifest.hls(
            manifest_name="index",
            filter_configuration=FilterConfiguration(
                manifest_filter=[
                    ManifestFilter.bitrate_range(BitrateFilterKey.VIDEO_BITRATE, Bitrate.mbps(1), Bitrate.mbps(5)),
                    ManifestFilter.numeric_range(NumericFilterKey.VIDEO_HEIGHT, 720, 1080),
                    ManifestFilter.video_codec_list([VideoCodec.H264, VideoCodec.H265]),
                    ManifestFilter.numeric(NumericFilterKey.AUDIO_CHANNELS, 2),
                    ManifestFilter.text_list(TextFilterKey.AUDIO_LANGUAGE, ["en-US", "fr"])
                ],
                time_delay=Duration.seconds(30)
            )
        )
    ]
)

Methods

is_unresolved()

Checks if bitrate is a token or a resolvable object.

Return type:

bool

to_bps()

Return the total number of bits per second.

Return type:

Union[int, float]

to_gbps()

Return the total number of gigabits per second.

Return type:

Union[int, float]

to_kbps()

Return the total number of kilobits per second.

Return type:

Union[int, float]

to_mbps()

Return the total number of megabits per second.

Return type:

Union[int, float]

Static Methods

classmethod bps(amount)

Create a Bitrate representing an amount of bits per second.

Parameters:

amount (Union[int, float]) – the amount of bits per second.

Return type:

Bitrate

classmethod gbps(amount)

Create a Bitrate representing an amount of gigabits per second.

Parameters:

amount (Union[int, float]) – the amount of gigabits per second.

Return type:

Bitrate

classmethod kbps(amount)

Create a Bitrate representing an amount of kilobits per second.

Parameters:

amount (Union[int, float]) – the amount of kilobits per second.

Return type:

Bitrate

classmethod mbps(amount)

Create a Bitrate representing an amount of megabits per second.

Parameters:

amount (Union[int, float]) – the amount of megabits per second.

Return type:

Bitrate