5.2.11. ytpb.representations¶
Representations from MPEG-DASH MPD.
- class ytpb.representations.VideoQuality(height: int, frame_rate: float)¶
Bases:
objectRepresents a video quality (height and frame rate).
Examples
The class supports comparison operations. For example:
>>> VideoQuality(720) == VideoQuality(720, 30) True >>> VideoQuality(720) > VideoQuality(720, 60) False
- classmethod from_string(value: str) VideoQuality¶
Creates a
VideoQualityobject from string.- Parameters:
value – A video quality string. For example: “720p”, “1080p60”.
- class ytpb.representations.RepresentationInfo(itag: str, mime_type: str, codecs: str, base_url: str)¶
Bases:
objectRepresents common attributes of audio and video representations.
- class ytpb.representations.AudioRepresentationInfo(itag: str, mime_type: str, codecs: str, base_url: str, audio_sampling_rate: int)¶
Bases:
RepresentationInfoRepresents attributes of audio representations.
- class ytpb.representations.VideoRepresentationInfo(itag: str, mime_type: str, codecs: str, base_url: str, width: int, height: int, frame_rate: int)¶
Bases:
RepresentationInfoRepresents attributes of video representations.
- property quality: VideoQuality¶
Quality string (resolution and FPS), e.g. ‘720p’, ‘1080p60’.
- ytpb.representations.extract_representations(manifest_content: str) list[RepresentationInfo]¶
Extracts representations from a manifest.
- Parameters:
manifest_content – An MPEG-DASH MPD string content.
- Returns:
A list of
RepresentationInfoobjects.