typed-ffmpeg-compatible 2.1.0__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.
Files changed (45) hide show
  1. typed_ffmpeg/__init__.py +25 -0
  2. typed_ffmpeg/base.py +114 -0
  3. typed_ffmpeg/common/__init__.py +0 -0
  4. typed_ffmpeg/common/schema.py +308 -0
  5. typed_ffmpeg/common/serialize.py +132 -0
  6. typed_ffmpeg/dag/__init__.py +13 -0
  7. typed_ffmpeg/dag/compile.py +51 -0
  8. typed_ffmpeg/dag/context.py +221 -0
  9. typed_ffmpeg/dag/factory.py +31 -0
  10. typed_ffmpeg/dag/global_runnable/__init__.py +0 -0
  11. typed_ffmpeg/dag/global_runnable/global_args.py +178 -0
  12. typed_ffmpeg/dag/global_runnable/runnable.py +174 -0
  13. typed_ffmpeg/dag/io/__init__.py +0 -0
  14. typed_ffmpeg/dag/io/_input.py +197 -0
  15. typed_ffmpeg/dag/io/_output.py +318 -0
  16. typed_ffmpeg/dag/io/output_args.py +327 -0
  17. typed_ffmpeg/dag/nodes.py +479 -0
  18. typed_ffmpeg/dag/schema.py +210 -0
  19. typed_ffmpeg/dag/utils.py +41 -0
  20. typed_ffmpeg/dag/validate.py +172 -0
  21. typed_ffmpeg/exceptions.py +42 -0
  22. typed_ffmpeg/filters.py +3510 -0
  23. typed_ffmpeg/probe.py +43 -0
  24. typed_ffmpeg/py.typed +0 -0
  25. typed_ffmpeg/schema.py +29 -0
  26. typed_ffmpeg/streams/__init__.py +5 -0
  27. typed_ffmpeg/streams/audio.py +6955 -0
  28. typed_ffmpeg/streams/av.py +22 -0
  29. typed_ffmpeg/streams/channel_layout.py +39 -0
  30. typed_ffmpeg/streams/video.py +12974 -0
  31. typed_ffmpeg/types.py +119 -0
  32. typed_ffmpeg/utils/__init__.py +0 -0
  33. typed_ffmpeg/utils/escaping.py +49 -0
  34. typed_ffmpeg/utils/lazy_eval/__init__.py +0 -0
  35. typed_ffmpeg/utils/lazy_eval/operator.py +134 -0
  36. typed_ffmpeg/utils/lazy_eval/schema.py +211 -0
  37. typed_ffmpeg/utils/run.py +27 -0
  38. typed_ffmpeg/utils/snapshot.py +26 -0
  39. typed_ffmpeg/utils/typing.py +17 -0
  40. typed_ffmpeg/utils/view.py +64 -0
  41. typed_ffmpeg_compatible-2.1.0.dist-info/LICENSE +21 -0
  42. typed_ffmpeg_compatible-2.1.0.dist-info/METADATA +183 -0
  43. typed_ffmpeg_compatible-2.1.0.dist-info/RECORD +45 -0
  44. typed_ffmpeg_compatible-2.1.0.dist-info/WHEEL +4 -0
  45. typed_ffmpeg_compatible-2.1.0.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,327 @@
1
+ # NOTE: this file is auto-generated, do not modify
2
+ from __future__ import annotations
3
+
4
+ from abc import ABC, abstractmethod
5
+ from pathlib import Path
6
+ from typing import TYPE_CHECKING, Any
7
+
8
+ from ...types import Boolean, Float, Func, Int, Int64, String, Time
9
+
10
+ if TYPE_CHECKING:
11
+ from ..nodes import FilterableStream, OutputNode, OutputStream
12
+
13
+
14
+ class OutputArgs(ABC):
15
+ @abstractmethod
16
+ def _output_node(self, *streams: FilterableStream, filename: str | Path, **kwargs: Any) -> OutputNode:
17
+ ...
18
+
19
+ def output(
20
+ self,
21
+ *streams: "FilterableStream",
22
+ filename: str | Path,
23
+ f: String = None,
24
+ c: String = None,
25
+ codec: String = None,
26
+ pre: String = None,
27
+ map: Func = None,
28
+ map_metadata: String = None,
29
+ map_chapters: Int = None,
30
+ t: Time = None,
31
+ to: Time = None,
32
+ fs: Int64 = None,
33
+ ss: Time = None,
34
+ timestamp: Func = None,
35
+ metadata: String = None,
36
+ program: String = None,
37
+ stream_group: String = None,
38
+ dframes: Int64 = None,
39
+ target: Func = None,
40
+ shortest: Boolean = None,
41
+ shortest_buf_duration: Float = None,
42
+ bitexact: Boolean = None,
43
+ apad: String = None,
44
+ copyinkf: Boolean = None,
45
+ copypriorss: Int = None,
46
+ frames: Int64 = None,
47
+ tag: String = None,
48
+ q: Func = None,
49
+ qscale: Func = None,
50
+ profile: Func = None,
51
+ filter: String = None,
52
+ filter_script: String = None,
53
+ attach: Func = None,
54
+ disposition: String = None,
55
+ thread_queue_size: Int = None,
56
+ bits_per_raw_sample: Int = None,
57
+ stats_enc_pre: String = None,
58
+ stats_enc_post: String = None,
59
+ stats_mux_pre: String = None,
60
+ stats_enc_pre_fmt: String = None,
61
+ stats_enc_post_fmt: String = None,
62
+ stats_mux_pre_fmt: String = None,
63
+ vframes: Int64 = None,
64
+ r: String = None,
65
+ fpsmax: String = None,
66
+ s: String = None,
67
+ aspect: String = None,
68
+ pix_fmt: String = None,
69
+ vn: Boolean = None,
70
+ rc_override: String = None,
71
+ vcodec: String = None,
72
+ timecode: Func = None,
73
+ _pass: Int = None,
74
+ passlogfile: String = None,
75
+ vf: String = None,
76
+ intra_matrix: String = None,
77
+ inter_matrix: String = None,
78
+ chroma_intra_matrix: String = None,
79
+ vtag: String = None,
80
+ fps_mode: String = None,
81
+ force_fps: Boolean = None,
82
+ streamid: Func = None,
83
+ force_key_frames: String = None,
84
+ b: Func = None,
85
+ autoscale: Boolean = None,
86
+ fix_sub_duration_heartbeat: Boolean = None,
87
+ aframes: Int64 = None,
88
+ aq: Func = None,
89
+ ar: Int = None,
90
+ ac: Int = None,
91
+ an: Boolean = None,
92
+ acodec: String = None,
93
+ ab: Func = None,
94
+ atag: String = None,
95
+ sample_fmt: String = None,
96
+ channel_layout: String = None,
97
+ ch_layout: String = None,
98
+ af: String = None,
99
+ sn: Boolean = None,
100
+ scodec: String = None,
101
+ stag: String = None,
102
+ muxdelay: Float = None,
103
+ muxpreload: Float = None,
104
+ sdp_file: Func = None,
105
+ time_base: String = None,
106
+ enc_time_base: String = None,
107
+ bsf: String = None,
108
+ apre: String = None,
109
+ vpre: String = None,
110
+ spre: String = None,
111
+ fpre: String = None,
112
+ max_muxing_queue_size: Int = None,
113
+ muxing_queue_data_threshold: Int = None,
114
+ dcodec: String = None,
115
+ dn: Boolean = None,
116
+ top: Int = None,
117
+ **kwargs: Any,
118
+ ) -> OutputStream:
119
+ """
120
+ Output file URL
121
+
122
+ Args:
123
+ *streams: the streams to output
124
+ filename: the filename to output to
125
+ f: force container format (auto-detected otherwise)
126
+ c: select encoder/decoder ('copy' to copy stream without reencoding)
127
+ codec: alias for -c (select encoder/decoder)
128
+ pre: preset name
129
+ map: set input stream mapping
130
+ map_metadata: set metadata information of outfile from infile
131
+ map_chapters: set chapters mapping
132
+ t: stop transcoding after specified duration
133
+ to: stop transcoding after specified time is reached
134
+ fs: set the limit file size in bytes
135
+ ss: start transcoding at specified time
136
+ timestamp: set the recording timestamp ('now' to set the current time)
137
+ metadata: add metadata
138
+ program: add program with specified streams
139
+ stream_group: add stream group with specified streams and group type-specific arguments
140
+ dframes: set the number of data frames to output
141
+ target: specify target file type (\"vcd\", \"svcd\", \"dvd\", \"dv\" or \"dv50\
142
+ "with optional prefixes \"pal-\", \"ntsc-\" or \"film-\")
143
+ shortest: finish encoding within shortest input
144
+ shortest_buf_duration: maximum buffering duration (in seconds) for the -shortest option
145
+ bitexact: bitexact mode
146
+ apad: audio pad
147
+ copyinkf: copy initial non-keyframes
148
+ copypriorss: copy or discard frames before start time
149
+ frames: set the number of frames to output
150
+ tag: force codec tag/fourcc
151
+ q: use fixed quality scale (VBR)
152
+ qscale: use fixed quality scale (VBR)
153
+ profile: set profile
154
+ filter: apply specified filters to audio/video
155
+ filter_script: deprecated, use -/filter
156
+ attach: add an attachment to the output file
157
+ disposition: disposition
158
+ thread_queue_size: set the maximum number of queued packets from the demuxer
159
+ bits_per_raw_sample: set the number of bits per raw sample
160
+ stats_enc_pre: write encoding stats before encoding
161
+ stats_enc_post: write encoding stats after encoding
162
+ stats_mux_pre: write packets stats before muxing
163
+ stats_enc_pre_fmt: format of the stats written with -stats_enc_pre
164
+ stats_enc_post_fmt: format of the stats written with -stats_enc_post
165
+ stats_mux_pre_fmt: format of the stats written with -stats_mux_pre
166
+ vframes: set the number of video frames to output
167
+ r: override input framerate/convert to given output framerate (Hz value, fraction or abbreviation)
168
+ fpsmax: set max frame rate (Hz value, fraction or abbreviation)
169
+ s: set frame size (WxH or abbreviation)
170
+ aspect: set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
171
+ pix_fmt: set pixel format
172
+ vn: disable video
173
+ rc_override: rate control override for specific intervals
174
+ vcodec: alias for -c:v (select encoder/decoder for video streams)
175
+ timecode: set initial TimeCode value.
176
+ _pass: select the pass number (1 to 3)
177
+ passlogfile: select two pass log file name prefix
178
+ vf: alias for -filter:v (apply filters to video streams)
179
+ intra_matrix: specify intra matrix coeffs
180
+ inter_matrix: specify inter matrix coeffs
181
+ chroma_intra_matrix: specify intra matrix coeffs
182
+ vtag: force video tag/fourcc
183
+ fps_mode: set framerate mode for matching video streams; overrides vsync
184
+ force_fps: force the selected framerate, disable the best supported framerate selection
185
+ streamid: set the value of an outfile streamid
186
+ force_key_frames: force key frames at specified timestamps
187
+ b: video bitrate (please use -b:v)
188
+ autoscale: automatically insert a scale filter at the end of the filter graph
189
+ fix_sub_duration_heartbeat: set this video output stream to be a heartbeat stream for fix_sub_duration, according to which subtitles should be split at random access points
190
+ aframes: set the number of audio frames to output
191
+ aq: set audio quality (codec-specific)
192
+ ar: set audio sampling rate (in Hz)
193
+ ac: set number of audio channels
194
+ an: disable audio
195
+ acodec: alias for -c:a (select encoder/decoder for audio streams)
196
+ ab: alias for -b:a (select bitrate for audio streams)
197
+ atag: force audio tag/fourcc
198
+ sample_fmt: set sample format
199
+ channel_layout: set channel layout
200
+ ch_layout: set channel layout
201
+ af: alias for -filter:a (apply filters to audio streams)
202
+ sn: disable subtitle
203
+ scodec: alias for -c:s (select encoder/decoder for subtitle streams)
204
+ stag: force subtitle tag/fourcc
205
+ muxdelay: set the maximum demux-decode delay
206
+ muxpreload: set the initial demux-decode delay
207
+ sdp_file: specify a file in which to print sdp information
208
+ time_base: set the desired time base hint for output stream (1:24, 1:48000 or 0.04166, 2.0833e-5)
209
+ enc_time_base: set the desired time base for the encoder (1:24, 1:48000 or 0.04166, 2.0833e-5). two special values are defined - 0 = use frame rate (video) or sample rate (audio),-1 = match source time base
210
+ bsf: A comma-separated list of bitstream filters
211
+ apre: set the audio options to the indicated preset
212
+ vpre: set the video options to the indicated preset
213
+ spre: set the subtitle options to the indicated preset
214
+ fpre: set options from indicated preset file
215
+ max_muxing_queue_size: maximum number of packets that can be buffered while waiting for all streams to initialize
216
+ muxing_queue_data_threshold: set the threshold after which max_muxing_queue_size is taken into account
217
+ dcodec: alias for -c:d (select encoder/decoder for data streams)
218
+ dn: disable data
219
+ top: deprecated, use the setfield video filter
220
+ **kwargs: the arguments for the output
221
+
222
+ Returns:
223
+ the output stream
224
+ """
225
+
226
+ options = {
227
+ k: v
228
+ for k, v in {
229
+ "f": f,
230
+ "c": c,
231
+ "codec": codec,
232
+ "pre": pre,
233
+ "map": map,
234
+ "map_metadata": map_metadata,
235
+ "map_chapters": map_chapters,
236
+ "t": t,
237
+ "to": to,
238
+ "fs": fs,
239
+ "ss": ss,
240
+ "timestamp": timestamp,
241
+ "metadata": metadata,
242
+ "program": program,
243
+ "stream_group": stream_group,
244
+ "dframes": dframes,
245
+ "target": target,
246
+ "shortest": shortest,
247
+ "shortest_buf_duration": shortest_buf_duration,
248
+ "bitexact": bitexact,
249
+ "apad": apad,
250
+ "copyinkf": copyinkf,
251
+ "copypriorss": copypriorss,
252
+ "frames": frames,
253
+ "tag": tag,
254
+ "q": q,
255
+ "qscale": qscale,
256
+ "profile": profile,
257
+ "filter": filter,
258
+ "filter_script": filter_script,
259
+ "attach": attach,
260
+ "disposition": disposition,
261
+ "thread_queue_size": thread_queue_size,
262
+ "bits_per_raw_sample": bits_per_raw_sample,
263
+ "stats_enc_pre": stats_enc_pre,
264
+ "stats_enc_post": stats_enc_post,
265
+ "stats_mux_pre": stats_mux_pre,
266
+ "stats_enc_pre_fmt": stats_enc_pre_fmt,
267
+ "stats_enc_post_fmt": stats_enc_post_fmt,
268
+ "stats_mux_pre_fmt": stats_mux_pre_fmt,
269
+ "vframes": vframes,
270
+ "r": r,
271
+ "fpsmax": fpsmax,
272
+ "s": s,
273
+ "aspect": aspect,
274
+ "pix_fmt": pix_fmt,
275
+ "vn": vn,
276
+ "rc_override": rc_override,
277
+ "vcodec": vcodec,
278
+ "timecode": timecode,
279
+ "pass": _pass,
280
+ "passlogfile": passlogfile,
281
+ "vf": vf,
282
+ "intra_matrix": intra_matrix,
283
+ "inter_matrix": inter_matrix,
284
+ "chroma_intra_matrix": chroma_intra_matrix,
285
+ "vtag": vtag,
286
+ "fps_mode": fps_mode,
287
+ "force_fps": force_fps,
288
+ "streamid": streamid,
289
+ "force_key_frames": force_key_frames,
290
+ "b": b,
291
+ "autoscale": autoscale,
292
+ "fix_sub_duration_heartbeat": fix_sub_duration_heartbeat,
293
+ "aframes": aframes,
294
+ "aq": aq,
295
+ "ar": ar,
296
+ "ac": ac,
297
+ "an": an,
298
+ "acodec": acodec,
299
+ "ab": ab,
300
+ "atag": atag,
301
+ "sample_fmt": sample_fmt,
302
+ "channel_layout": channel_layout,
303
+ "ch_layout": ch_layout,
304
+ "af": af,
305
+ "sn": sn,
306
+ "scodec": scodec,
307
+ "stag": stag,
308
+ "muxdelay": muxdelay,
309
+ "muxpreload": muxpreload,
310
+ "sdp_file": sdp_file,
311
+ "time_base": time_base,
312
+ "enc_time_base": enc_time_base,
313
+ "bsf": bsf,
314
+ "apre": apre,
315
+ "vpre": vpre,
316
+ "spre": spre,
317
+ "fpre": fpre,
318
+ "max_muxing_queue_size": max_muxing_queue_size,
319
+ "muxing_queue_data_threshold": muxing_queue_data_threshold,
320
+ "dcodec": dcodec,
321
+ "dn": dn,
322
+ "top": top,
323
+ }.items()
324
+ if v is not None
325
+ }
326
+
327
+ return self._output_node(*streams, filename=filename, **options, **kwargs).stream()