File size: 2,940 Bytes
06555b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
from fractions import Fraction
from typing import Literal, overload

from av.audio.codeccontext import AudioCodecContext
from av.audio.format import AudioFormat
from av.descriptor import Descriptor
from av.enum import EnumFlag
from av.subtitles.codeccontext import SubtitleCodecContext
from av.video.codeccontext import VideoCodecContext
from av.video.format import VideoFormat

from .context import CodecContext

class Properties(EnumFlag):

    NONE: int

    INTRA_ONLY: int

    LOSSY: int

    LOSSLESS: int

    REORDER: int

    BITMAP_SUB: int

    TEXT_SUB: int

class Capabilities(EnumFlag):

    NONE: int

    DARW_HORIZ_BAND: int

    DR1: int

    HWACCEL: int

    DELAY: int

    SMALL_LAST_FRAME: int

    HWACCEL_VDPAU: int

    SUBFRAMES: int

    EXPERIMENTAL: int

    CHANNEL_CONF: int

    NEG_LINESIZES: int

    FRAME_THREADS: int

    SLICE_THREADS: int

    PARAM_CHANGE: int

    AUTO_THREADS: int

    VARIABLE_FRAME_SIZE: int

    AVOID_PROBING: int

    HARDWARE: int

    HYBRID: int

    ENCODER_REORDERED_OPAQUE: int

    ENCODER_FLUSH: int

class UnknownCodecError(ValueError): ...

class Codec:

    is_encoder: bool

    is_decoder: bool

    descriptor: Descriptor

    name: str

    long_name: str

    type: Literal["video", "audio", "data", "subtitle", "attachment"]

    id: int

    frame_rates: list[Fraction] | None

    audio_rates: list[int] | None

    video_formats: list[VideoFormat] | None

    audio_formats: list[AudioFormat] | None

    properties: Properties

    capabilities: Capabilities

    intra_only: bool

    lossy: bool

    lossless: bool

    reorder: bool

    bitmap_sub: bool

    text_sub: bool

    draw_horiz_band: bool

    dr1: bool

    hwaccel: bool

    delay: bool

    small_last_frame: bool

    hwaccel_vdpau: bool

    subframes: bool

    experimental: bool

    channel_conf: bool

    neg_linesizes: bool

    frame_threads: bool

    slice_threads: bool

    param_change: bool

    auto_threads: bool

    variable_frame_size: bool

    avoid_probing: bool

    hardware: bool

    hybrid: bool

    encoder_reordered_opaque: bool

    encoder_flush: bool

    def __init__(self, name: str, mode: Literal["r", "w"] = "r") -> None: ...
    @overload
    def create(self, kind: Literal["video"]) -> VideoCodecContext: ...
    @overload
    def create(self, kind: Literal["audio"]) -> AudioCodecContext: ...
    @overload
    def create(self, kind: Literal["subtitle"]) -> SubtitleCodecContext: ...
    @overload
    def create(self, kind: None = None) -> CodecContext: ...
    @overload
    def create(
        self, kind: Literal["video", "audio", "subtitle"] | None = None
    ) -> (
        VideoCodecContext | AudioCodecContext | SubtitleCodecContext | CodecContext
    ): ...

class codec_descriptor:

    name: str

    options: tuple[int, ...]



codecs_available: set[str]

def dump_codecs() -> None: ...