Shortcuts

AudioStreamMetadata

class torchcodec.decoders.AudioStreamMetadata(duration_seconds_from_header: Optional[float], begin_stream_seconds_from_header: Optional[float], bit_rate: Optional[float], codec: Optional[str], stream_index: int, sample_rate: Optional[int], num_channels: Optional[int], sample_format: Optional[str])[source]

Metadata of a single audio stream.

Examples using AudioStreamMetadata:

Decoding audio streams with AudioDecoder

Decoding audio streams with AudioDecoder
begin_stream_seconds_from_header: Optional[float]

Beginning of the stream, in seconds, obtained from the header (float or None). Usually, this is equal to 0.

bit_rate: Optional[float]

Bit rate of the stream, in seconds (float or None).

codec: Optional[str]

Codec (str or None).

duration_seconds_from_header: Optional[float]

Duration of the stream, in seconds, obtained from the header (float or None). This could be inaccurate.

num_channels: Optional[int]

The number of channels (1 for mono, 2 for stereo, etc.)

sample_format: Optional[str]

The original sample format, as described by FFmpeg. E.g. ‘fltp’, ‘s32’, etc.

sample_rate: Optional[int]

The original sample rate.

stream_index: int

Index of the stream that this metadata refers to (int).

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources