typed-ffmpeg-compatible 3.5.2__py3-none-any.whl → 3.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- typed_ffmpeg/__init__.py +4 -1
- typed_ffmpeg/_version.py +2 -2
- typed_ffmpeg/base.py +4 -1
- typed_ffmpeg/codecs/__init__.py +2 -0
- typed_ffmpeg/codecs/decoders.py +1852 -1853
- typed_ffmpeg/codecs/encoders.py +2001 -1782
- typed_ffmpeg/codecs/schema.py +6 -12
- typed_ffmpeg/common/__init__.py +1 -0
- typed_ffmpeg/common/cache.py +9 -6
- typed_ffmpeg/common/schema.py +11 -0
- typed_ffmpeg/common/serialize.py +13 -7
- typed_ffmpeg/compile/__init__.py +1 -0
- typed_ffmpeg/compile/compile_cli.py +23 -4
- typed_ffmpeg/compile/compile_json.py +4 -0
- typed_ffmpeg/compile/compile_python.py +15 -0
- typed_ffmpeg/compile/context.py +15 -4
- typed_ffmpeg/compile/validate.py +4 -3
- typed_ffmpeg/dag/factory.py +2 -0
- typed_ffmpeg/dag/global_runnable/__init__.py +1 -0
- typed_ffmpeg/dag/global_runnable/global_args.py +2 -2
- typed_ffmpeg/dag/global_runnable/runnable.py +6 -2
- typed_ffmpeg/dag/io/__init__.py +1 -0
- typed_ffmpeg/dag/io/_input.py +20 -5
- typed_ffmpeg/dag/io/_output.py +24 -9
- typed_ffmpeg/dag/io/output_args.py +21 -7
- typed_ffmpeg/dag/nodes.py +20 -0
- typed_ffmpeg/dag/schema.py +19 -6
- typed_ffmpeg/dag/utils.py +2 -2
- typed_ffmpeg/exceptions.py +2 -1
- typed_ffmpeg/expressions.py +884 -0
- typed_ffmpeg/ffprobe/__init__.py +1 -0
- typed_ffmpeg/ffprobe/parse.py +7 -1
- typed_ffmpeg/ffprobe/probe.py +3 -1
- typed_ffmpeg/ffprobe/schema.py +83 -1
- typed_ffmpeg/ffprobe/xml2json.py +8 -2
- typed_ffmpeg/filters.py +540 -631
- typed_ffmpeg/formats/__init__.py +2 -0
- typed_ffmpeg/formats/demuxers.py +1869 -1921
- typed_ffmpeg/formats/muxers.py +1382 -1107
- typed_ffmpeg/formats/schema.py +6 -12
- typed_ffmpeg/info.py +8 -0
- typed_ffmpeg/options/__init__.py +15 -0
- typed_ffmpeg/options/codec.py +711 -0
- typed_ffmpeg/options/format.py +196 -0
- typed_ffmpeg/options/framesync.py +43 -0
- typed_ffmpeg/options/timeline.py +22 -0
- typed_ffmpeg/schema.py +15 -0
- typed_ffmpeg/sources.py +392 -381
- typed_ffmpeg/streams/__init__.py +2 -0
- typed_ffmpeg/streams/audio.py +1071 -882
- typed_ffmpeg/streams/av.py +9 -3
- typed_ffmpeg/streams/subtitle.py +3 -3
- typed_ffmpeg/streams/video.py +1873 -1725
- typed_ffmpeg/types.py +3 -2
- typed_ffmpeg/utils/__init__.py +1 -0
- typed_ffmpeg/utils/escaping.py +8 -4
- typed_ffmpeg/utils/frozendict.py +31 -1
- typed_ffmpeg/utils/lazy_eval/__init__.py +1 -0
- typed_ffmpeg/utils/lazy_eval/operator.py +75 -27
- typed_ffmpeg/utils/lazy_eval/schema.py +176 -4
- typed_ffmpeg/utils/run.py +2 -0
- typed_ffmpeg/utils/snapshot.py +1 -0
- typed_ffmpeg/utils/typing.py +2 -1
- typed_ffmpeg/utils/view.py +2 -1
- {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/METADATA +1 -1
- typed_ffmpeg_compatible-3.6.dist-info/RECORD +73 -0
- typed_ffmpeg_compatible-3.5.2.dist-info/RECORD +0 -67
- {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/WHEEL +0 -0
- {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/entry_points.txt +0 -0
- {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/licenses/LICENSE +0 -0
- {typed_ffmpeg_compatible-3.5.2.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,196 @@
|
|
1
|
+
# NOTE: this file is auto-generated, do not modify
|
2
|
+
"""FFmpeg format options."""
|
3
|
+
|
4
|
+
from typing import Literal
|
5
|
+
|
6
|
+
from ..schema import FFMpegOptionGroup
|
7
|
+
from ..utils.frozendict import merge
|
8
|
+
|
9
|
+
|
10
|
+
class FFMpegAVFormatContextEncoderOption(FFMpegOptionGroup):
|
11
|
+
"""AVFormatContext Encoder options."""
|
12
|
+
|
13
|
+
|
14
|
+
class FFMpegAVFormatContextDecoderOption(FFMpegOptionGroup):
|
15
|
+
"""AVFormatContext Decoder options."""
|
16
|
+
|
17
|
+
|
18
|
+
def encoder_format_context(
|
19
|
+
*,
|
20
|
+
avioflags: str | None = None,
|
21
|
+
packetsize: int | None = None,
|
22
|
+
fflags: str | None = None,
|
23
|
+
fdebug: str | None = None,
|
24
|
+
max_delay: int | None = None,
|
25
|
+
start_time_realtime: int | None = None,
|
26
|
+
audio_preload: int | None = None,
|
27
|
+
chunk_duration: int | None = None,
|
28
|
+
chunk_size: int | None = None,
|
29
|
+
flush_packets: int | None = None,
|
30
|
+
metadata_header_padding: int | None = None,
|
31
|
+
output_ts_offset: str | None = None,
|
32
|
+
max_interleave_delta: int | None = None,
|
33
|
+
f_strict: int
|
34
|
+
| None
|
35
|
+
| Literal["very", "strict", "normal", "unofficial", "experimental"] = None,
|
36
|
+
strict: int
|
37
|
+
| None
|
38
|
+
| Literal["very", "strict", "normal", "unofficial", "experimental"] = None,
|
39
|
+
avoid_negative_ts: int
|
40
|
+
| None
|
41
|
+
| Literal["auto", "disabled", "make_non_negative", "make_zero"] = None,
|
42
|
+
dump_separator: str | None = None,
|
43
|
+
) -> FFMpegAVFormatContextEncoderOption:
|
44
|
+
"""
|
45
|
+
Encoder format context options.
|
46
|
+
|
47
|
+
Args:
|
48
|
+
avioflags: (default 0),
|
49
|
+
packetsize: set packet size (from 0 to INT_MAX) (default 0),
|
50
|
+
fflags: (default autobsf),
|
51
|
+
fdebug: print specific debug info (default 0),
|
52
|
+
max_delay: maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1),
|
53
|
+
start_time_realtime: wall-clock time when stream begins (PTS==0) (from I64_MIN to I64_MAX) (default I64_MIN),
|
54
|
+
audio_preload: microseconds by which audio packets should be interleaved earlier (from 0 to 2.14748e+09) (default 0),
|
55
|
+
chunk_duration: microseconds for each chunk (from 0 to 2.14748e+09) (default 0),
|
56
|
+
chunk_size: size in bytes for each chunk (from 0 to 2.14748e+09) (default 0),
|
57
|
+
flush_packets: enable flushing of the I/O context after each packet (from -1 to 1) (default -1),
|
58
|
+
metadata_header_padding: set number of bytes to be written as padding in a metadata header (from -1 to INT_MAX) (default -1),
|
59
|
+
output_ts_offset: set output timestamp offset (default 0),
|
60
|
+
max_interleave_delta: maximum buffering duration for interleaving (from 0 to I64_MAX) (default 10000000),
|
61
|
+
f_strict: how strictly to follow the standards (deprecated; use strict, save via avconv) (from INT_MIN to INT_MAX) (default normal),
|
62
|
+
strict: how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal),
|
63
|
+
avoid_negative_ts: shift timestamps so they start at 0 (from -1 to 2) (default auto),
|
64
|
+
dump_separator: set information dump field separator (default ", "),
|
65
|
+
|
66
|
+
Returns:
|
67
|
+
FFMpegAVFormatContextEncoderOption
|
68
|
+
|
69
|
+
"""
|
70
|
+
return FFMpegAVFormatContextEncoderOption(
|
71
|
+
merge({
|
72
|
+
"avioflags": avioflags,
|
73
|
+
"packetsize": packetsize,
|
74
|
+
"fflags": fflags,
|
75
|
+
"fdebug": fdebug,
|
76
|
+
"max_delay": max_delay,
|
77
|
+
"start_time_realtime": start_time_realtime,
|
78
|
+
"audio_preload": audio_preload,
|
79
|
+
"chunk_duration": chunk_duration,
|
80
|
+
"chunk_size": chunk_size,
|
81
|
+
"flush_packets": flush_packets,
|
82
|
+
"metadata_header_padding": metadata_header_padding,
|
83
|
+
"output_ts_offset": output_ts_offset,
|
84
|
+
"max_interleave_delta": max_interleave_delta,
|
85
|
+
"f_strict": f_strict,
|
86
|
+
"strict": strict,
|
87
|
+
"avoid_negative_ts": avoid_negative_ts,
|
88
|
+
"dump_separator": dump_separator,
|
89
|
+
})
|
90
|
+
)
|
91
|
+
|
92
|
+
|
93
|
+
def decoder_format_context(
|
94
|
+
*,
|
95
|
+
avioflags: str | None = None,
|
96
|
+
probesize: int | None = None,
|
97
|
+
formatprobesize: int | None = None,
|
98
|
+
fflags: str | None = None,
|
99
|
+
seek2any: bool | None = None,
|
100
|
+
analyzeduration: int | None = None,
|
101
|
+
cryptokey: str | None = None,
|
102
|
+
indexmem: int | None = None,
|
103
|
+
rtbufsize: int | None = None,
|
104
|
+
fdebug: str | None = None,
|
105
|
+
max_delay: int | None = None,
|
106
|
+
fpsprobesize: int | None = None,
|
107
|
+
f_err_detect: str | None = None,
|
108
|
+
err_detect: str | None = None,
|
109
|
+
use_wallclock_as_timestamps: bool | None = None,
|
110
|
+
skip_initial_bytes: int | None = None,
|
111
|
+
correct_ts_overflow: bool | None = None,
|
112
|
+
f_strict: int
|
113
|
+
| None
|
114
|
+
| Literal["very", "strict", "normal", "unofficial", "experimental"] = None,
|
115
|
+
strict: int
|
116
|
+
| None
|
117
|
+
| Literal["very", "strict", "normal", "unofficial", "experimental"] = None,
|
118
|
+
max_ts_probe: int | None = None,
|
119
|
+
dump_separator: str | None = None,
|
120
|
+
codec_whitelist: str | None = None,
|
121
|
+
format_whitelist: str | None = None,
|
122
|
+
protocol_whitelist: str | None = None,
|
123
|
+
protocol_blacklist: str | None = None,
|
124
|
+
max_streams: int | None = None,
|
125
|
+
skip_estimate_duration_from_pts: bool | None = None,
|
126
|
+
max_probe_packets: int | None = None,
|
127
|
+
) -> FFMpegAVFormatContextDecoderOption:
|
128
|
+
"""
|
129
|
+
Decoder format context options.
|
130
|
+
|
131
|
+
Args:
|
132
|
+
avioflags: (default 0),
|
133
|
+
probesize: set probing size (from 32 to I64_MAX) (default 5000000),
|
134
|
+
formatprobesize: number of bytes to probe file format (from 0 to 2.14748e+09) (default 1048576),
|
135
|
+
fflags: (default autobsf),
|
136
|
+
seek2any: allow seeking to non-keyframes on demuxer level when supported (default false),
|
137
|
+
analyzeduration: specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0),
|
138
|
+
cryptokey: decryption key,
|
139
|
+
indexmem: max memory used for timestamp index (per stream) (from 0 to INT_MAX) (default 1048576),
|
140
|
+
rtbufsize: max memory used for buffering real-time frames (from 0 to INT_MAX) (default 3041280),
|
141
|
+
fdebug: print specific debug info (default 0),
|
142
|
+
max_delay: maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1),
|
143
|
+
fpsprobesize: number of frames used to probe fps (from -1 to 2.14748e+09) (default -1),
|
144
|
+
f_err_detect: set error detection flags (deprecated; use err_detect, save via avconv) (default crccheck),
|
145
|
+
err_detect: set error detection flags (default crccheck),
|
146
|
+
use_wallclock_as_timestamps: use wallclock as timestamps (default false),
|
147
|
+
skip_initial_bytes: set number of bytes to skip before reading header and frames (from 0 to I64_MAX) (default 0),
|
148
|
+
correct_ts_overflow: correct single timestamp overflows (default true),
|
149
|
+
f_strict: how strictly to follow the standards (deprecated; use strict, save via avconv) (from INT_MIN to INT_MAX) (default normal),
|
150
|
+
strict: how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal),
|
151
|
+
max_ts_probe: maximum number of packets to read while waiting for the first timestamp (from 0 to INT_MAX) (default 50),
|
152
|
+
dump_separator: set information dump field separator (default ", "),
|
153
|
+
codec_whitelist: List of decoders that are allowed to be used,
|
154
|
+
format_whitelist: List of demuxers that are allowed to be used,
|
155
|
+
protocol_whitelist: List of protocols that are allowed to be used,
|
156
|
+
protocol_blacklist: List of protocols that are not allowed to be used,
|
157
|
+
max_streams: maximum number of streams (from 0 to INT_MAX) (default 1000),
|
158
|
+
skip_estimate_duration_from_pts: skip duration calculation in estimate_timings_from_pts (default false),
|
159
|
+
max_probe_packets: Maximum number of packets to probe a codec (from 0 to INT_MAX) (default 2500),
|
160
|
+
|
161
|
+
Returns:
|
162
|
+
FFMpegAVFormatContextDecoderOption
|
163
|
+
|
164
|
+
"""
|
165
|
+
return FFMpegAVFormatContextDecoderOption(
|
166
|
+
merge({
|
167
|
+
"avioflags": avioflags,
|
168
|
+
"probesize": probesize,
|
169
|
+
"formatprobesize": formatprobesize,
|
170
|
+
"fflags": fflags,
|
171
|
+
"seek2any": seek2any,
|
172
|
+
"analyzeduration": analyzeduration,
|
173
|
+
"cryptokey": cryptokey,
|
174
|
+
"indexmem": indexmem,
|
175
|
+
"rtbufsize": rtbufsize,
|
176
|
+
"fdebug": fdebug,
|
177
|
+
"max_delay": max_delay,
|
178
|
+
"fpsprobesize": fpsprobesize,
|
179
|
+
"f_err_detect": f_err_detect,
|
180
|
+
"err_detect": err_detect,
|
181
|
+
"use_wallclock_as_timestamps": use_wallclock_as_timestamps,
|
182
|
+
"skip_initial_bytes": skip_initial_bytes,
|
183
|
+
"correct_ts_overflow": correct_ts_overflow,
|
184
|
+
"f_strict": f_strict,
|
185
|
+
"strict": strict,
|
186
|
+
"max_ts_probe": max_ts_probe,
|
187
|
+
"dump_separator": dump_separator,
|
188
|
+
"codec_whitelist": codec_whitelist,
|
189
|
+
"format_whitelist": format_whitelist,
|
190
|
+
"protocol_whitelist": protocol_whitelist,
|
191
|
+
"protocol_blacklist": protocol_blacklist,
|
192
|
+
"max_streams": max_streams,
|
193
|
+
"skip_estimate_duration_from_pts": skip_estimate_duration_from_pts,
|
194
|
+
"max_probe_packets": max_probe_packets,
|
195
|
+
})
|
196
|
+
)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"""Framesync options. Some filters with several inputs support a common set of options. These options can only be set by name, not with the short notation."""
|
2
|
+
|
3
|
+
from typing import Literal
|
4
|
+
|
5
|
+
from ..schema import FFMpegOptionGroup
|
6
|
+
from ..utils.frozendict import merge
|
7
|
+
|
8
|
+
|
9
|
+
class FFMpegFrameSyncOption(FFMpegOptionGroup):
|
10
|
+
"""Framesync options."""
|
11
|
+
|
12
|
+
|
13
|
+
def framesync(
|
14
|
+
*,
|
15
|
+
eof_action: Literal["repeat", "pass", "endall"] | None = None,
|
16
|
+
shortest: bool | None = None,
|
17
|
+
repeatlast: bool | None = None,
|
18
|
+
ts_sync_mode: Literal["default", "nearest"] | None = None,
|
19
|
+
) -> FFMpegFrameSyncOption:
|
20
|
+
"""
|
21
|
+
Framesync options. Some filters with several inputs support a common set of options. These options can only be set by name, not with the short notation.
|
22
|
+
|
23
|
+
Args:
|
24
|
+
eof_action: Action to take when encountering EOF from secondary input (from 0 to 2) (default repeat)
|
25
|
+
shortest: force termination when the shortest input terminates (default false)
|
26
|
+
repeatlast: extend last frame of secondary streams beyond EOF (default true)
|
27
|
+
ts_sync_mode: How strictly to sync streams based on secondary input timestamps (from 0 to 1) (default default)
|
28
|
+
|
29
|
+
References:
|
30
|
+
[FFmpeg Documentation](https://ffmpeg.org/ffmpeg-filters.html#framesync)
|
31
|
+
|
32
|
+
Returns:
|
33
|
+
FFMpegFrameSyncOption
|
34
|
+
|
35
|
+
"""
|
36
|
+
return FFMpegFrameSyncOption(
|
37
|
+
merge({
|
38
|
+
"eof_action": eof_action,
|
39
|
+
"shortest": shortest,
|
40
|
+
"repeatlast": repeatlast,
|
41
|
+
"ts_sync_mode": ts_sync_mode,
|
42
|
+
})
|
43
|
+
)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"""FFmpeg timeline options module."""
|
2
|
+
|
3
|
+
from ..expressions import Expression
|
4
|
+
from ..schema import FFMpegOptionGroup
|
5
|
+
|
6
|
+
|
7
|
+
class FFMpegTimelineOption(FFMpegOptionGroup):
|
8
|
+
"""Timeline options."""
|
9
|
+
|
10
|
+
|
11
|
+
def timeline(*, enable: str | Expression) -> FFMpegTimelineOption:
|
12
|
+
"""
|
13
|
+
Create timeline options.
|
14
|
+
|
15
|
+
Args:
|
16
|
+
enable: The timeline enable parameter.
|
17
|
+
|
18
|
+
Returns:
|
19
|
+
FFMpegTimelineOption with the specified enable parameter.
|
20
|
+
|
21
|
+
"""
|
22
|
+
return FFMpegTimelineOption(enable=enable)
|
typed_ffmpeg/schema.py
CHANGED
@@ -7,6 +7,8 @@ These components form the foundation of the type annotation system that
|
|
7
7
|
enables static type checking in the FFmpeg filter graph.
|
8
8
|
"""
|
9
9
|
|
10
|
+
from typing import Any
|
11
|
+
|
10
12
|
from .common.schema import StreamType
|
11
13
|
|
12
14
|
|
@@ -24,6 +26,7 @@ class Default(str):
|
|
24
26
|
# This will use FFmpeg's default crf value
|
25
27
|
video.output("output.mp4", crf=Default("23"))
|
26
28
|
```
|
29
|
+
|
27
30
|
"""
|
28
31
|
|
29
32
|
...
|
@@ -45,11 +48,23 @@ class Auto(Default):
|
|
45
48
|
# The number of inputs is automatically derived from the length of streams
|
46
49
|
hstack(*streams, inputs=Auto("len(streams)"))
|
47
50
|
```
|
51
|
+
|
52
|
+
"""
|
53
|
+
|
54
|
+
|
55
|
+
class FFMpegOptionGroup(dict[str, Any]):
|
56
|
+
"""
|
57
|
+
Represents a group of FFmpeg options.
|
58
|
+
|
59
|
+
This class is used to group options together, such as a codec or format.
|
48
60
|
"""
|
49
61
|
|
62
|
+
...
|
63
|
+
|
50
64
|
|
51
65
|
__all__ = [
|
52
66
|
"Auto",
|
53
67
|
"Default",
|
54
68
|
"StreamType",
|
69
|
+
"FFMpegOptionGroup",
|
55
70
|
]
|