ContainerMetadata#
- class torchcodec.decoders.ContainerMetadata(duration_seconds_from_header: float | None, bit_rate_from_header: float | None, best_video_stream_index: int | None, best_audio_stream_index: int | None, streams: list[StreamMetadata])[source]#
Metadata of a container and of every stream in it.
Unlike
DemuxerMetadata, which describes the container alone, this also lists the streams, including the ones that cannot be decoded.- best_audio_stream_index: int | None#
Index of the best stream of audio type (int or None).
- best_video_stream_index: int | None#
Index of the best stream of video type (int or None).
- duration_seconds_from_header: float | None#
Duration of the container, in seconds, obtained from the header (float or None).
- streams: list[StreamMetadata]#
One entry per stream in the file, indexed by stream index.
A video stream comes back as a
VideoStreamHeaderMetadataand an audio stream as anAudioStreamHeaderMetadata. The rest will be plainStreamMetadata. Themedia_typeattribute tells the entries apart.