Debian Codegraph @

av/container/output.pyi

raw
1 from fractions import Fraction
2 from typing import Sequence, TypeVar, overload
3
4 from av.audio import _AudioCodecName
5 from av.audio.stream import AudioStream
6 from av.packet import Packet
7 from av.stream import AttachmentStream, DataStream, Stream
8 from av.subtitles.stream import SubtitleStream
9 from av.video import _VideoCodecName
10 from av.video.stream import VideoStream
11
12 from .core import Container
13
14 _StreamT = TypeVar("_StreamT", bound=Stream)
15
16 class OutputContainer(Container):
17 def __enter__(self) -> OutputContainer: ...
18 @overload
19 def add_stream(
20 self,
21 codec_name: _AudioCodecName,
22 rate: int | None = None,
23 options: dict[str, str] | None = None,
24 **kwargs,
25 ) -> AudioStream: ...
26 @overload
27 def add_stream(
28 self,
29 codec_name: _VideoCodecName,
30 rate: Fraction | int | None = None,
31 options: dict[str, str] | None = None,
32 **kwargs,
33 ) -> VideoStream: ...
34 @overload
35 def add_stream(
36 self,
37 codec_name: str,
38 rate: Fraction | int | None = None,
39 options: dict[str, str] | None = None,
40 **kwargs,
41 ) -> VideoStream | AudioStream | SubtitleStream: ...
42 def add_mux_stream(
43 self,
44 codec_name: str,
45 rate: Fraction | int | None = None,
46 **kwargs,
47 ) -> Stream: ...
48 def add_stream_from_template(
49 self, template: _StreamT, opaque: bool | None = None, **kwargs
50 ) -> _StreamT: ...
51 def add_attachment(
52 self, name: str, mimetype: str, data: bytes
53 ) -> AttachmentStream: ...
54 def add_data_stream(
55 self, codec_name: str | None = None, options: dict[str, str] | None = None
56 ) -> DataStream: ...
57 def start_encoding(self) -> None: ...
58 def mux(self, packets: Packet | Sequence[Packet]) -> None: ...
59 def mux_one(self, packet: Packet) -> None: ...
60 @property
61 def default_video_codec(self) -> str: ...
62 @property
63 def default_audio_codec(self) -> str: ...
64 @property
65 def default_subtitle_codec(self) -> str: ...
66 @property
67 def supported_codecs(self) -> set[str]: ...