File size: 2,382 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
from fractions import Fraction
from typing import Any, Literal

from av.enum import EnumFlag, EnumItem
from av.packet import Packet

from .codec import Codec

class ThreadType(EnumFlag):
    NONE: int
    FRAME: int
    SLICE: int
    AUTO: int

class SkipType(EnumItem):
    NONE: int
    DEFAULT: int
    NONREF: int
    BIDIR: int
    NONINTRA: int
    NONKEY: int
    ALL: int

class Flags(EnumFlag):
    NONE: int
    UNALIGNED: int
    QSCALE: int
    # 4MV
    OUTPUT_CORRUPT: int
    QPEL: int
    DROPCHANGED: int
    PASS1: int
    PASS2: int
    LOOP_FILTER: int
    GRAY: int
    PSNR: int
    INTERLACED_DCT: int
    LOW_DELAY: int
    GLOBAL_HEADER: int
    BITEXACT: int
    AC_PRED: int
    INTERLACED_ME: int
    CLOSED_GOP: int

class Flags2(EnumFlag):
    NONE: int
    FAST: int
    NO_OUTPUT: int
    LOCAL_HEADER: int
    CHUNKS: int
    IGNORE_CROP: int
    SHOW_ALL: int
    EXPORT_MVS: int
    SKIP_MANUAL: int
    RO_FLUSH_NOOP: int

class CodecContext:

    extradata: bytes | None
    extradata_size: int
    is_open: bool
    is_encoder: bool
    is_decoder: bool
    name: str
    codec: Codec
    options: dict[str, str]
    type: Literal["video", "audio", "data", "subtitle", "attachment"]
    profile: str | None
    time_base: Fraction
    codec_tag: str
    bit_rate: int | None
    max_bit_rate: int | None
    bit_rate_tolerance: int
    thread_count: int
    thread_type: Any
    skip_frame: Any

    # flgas
    unaligned: bool
    qscale: bool
    four_mv: bool
    output_corrupt: bool
    qpel: bool
    drop_changed: bool
    recon_frame: bool
    copy_opaque: bool
    frame_duration: bool
    pass1: bool
    pass2: bool
    loop_filter: bool
    gray: bool
    psnr: bool
    interlaced_dct: bool
    low_delay: bool
    global_header: bool
    bitexact: bool
    ac_pred: bool
    interlaced_me: bool
    closed_gop: bool
    delay: bool

    def open(self, strict: bool = True) -> None: ...
    def close(self, strict: bool = True) -> None: ...
    @staticmethod
    def create(
        codec: str | Codec, mode: Literal["r", "w"] | None = None
    ) -> CodecContext: ...
    def parse(
        self, raw_input: bytes | bytearray | memoryview | None = None
    ) -> list[Packet]: ...
    def flush_buffers(self) -> None: ...