typed-ffmpeg-compatible 3.3.1__py3-none-any.whl → 3.4.1__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 (30) hide show
  1. typed_ffmpeg/__init__.py +3 -1
  2. typed_ffmpeg/_version.py +2 -2
  3. typed_ffmpeg/base.py +1 -1
  4. typed_ffmpeg/codecs/__init__.py +3 -0
  5. typed_ffmpeg/codecs/decoders.py +6644 -0
  6. typed_ffmpeg/codecs/encoders.py +6401 -0
  7. typed_ffmpeg/codecs/schema.py +17 -0
  8. typed_ffmpeg/common/serialize.py +1 -1
  9. typed_ffmpeg/dag/global_runnable/global_args.py +59 -55
  10. typed_ffmpeg/dag/io/_input.py +76 -64
  11. typed_ffmpeg/dag/io/_output.py +118 -105
  12. typed_ffmpeg/dag/io/output_args.py +122 -104
  13. typed_ffmpeg/dag/nodes.py +1 -1
  14. typed_ffmpeg/dag/schema.py +1 -1
  15. typed_ffmpeg/filters.py +1717 -675
  16. typed_ffmpeg/formats/__init__.py +3 -0
  17. typed_ffmpeg/formats/demuxers.py +6664 -0
  18. typed_ffmpeg/formats/muxers.py +3774 -0
  19. typed_ffmpeg/formats/schema.py +17 -0
  20. typed_ffmpeg/sources.py +1641 -571
  21. typed_ffmpeg/streams/audio.py +1994 -1554
  22. typed_ffmpeg/streams/video.py +4540 -2843
  23. typed_ffmpeg/utils/{forzendict.py → frozendict.py} +56 -1
  24. typed_ffmpeg/utils/run.py +1 -1
  25. {typed_ffmpeg_compatible-3.3.1.dist-info → typed_ffmpeg_compatible-3.4.1.dist-info}/METADATA +1 -1
  26. {typed_ffmpeg_compatible-3.3.1.dist-info → typed_ffmpeg_compatible-3.4.1.dist-info}/RECORD +30 -22
  27. {typed_ffmpeg_compatible-3.3.1.dist-info → typed_ffmpeg_compatible-3.4.1.dist-info}/WHEEL +0 -0
  28. {typed_ffmpeg_compatible-3.3.1.dist-info → typed_ffmpeg_compatible-3.4.1.dist-info}/entry_points.txt +0 -0
  29. {typed_ffmpeg_compatible-3.3.1.dist-info → typed_ffmpeg_compatible-3.4.1.dist-info}/licenses/LICENSE +0 -0
  30. {typed_ffmpeg_compatible-3.3.1.dist-info → typed_ffmpeg_compatible-3.4.1.dist-info}/top_level.txt +0 -0
@@ -1,11 +1,24 @@
1
1
  # NOTE: this file is auto-generated, do not modify
2
+
3
+
2
4
  from __future__ import annotations
3
5
 
4
6
  from abc import ABC, abstractmethod
5
7
  from pathlib import Path
6
8
  from typing import TYPE_CHECKING, Any
7
9
 
8
- from ...types import Boolean, Float, Func, Int, Int64, String, Time
10
+ from ...codecs.schema import FFMpegEncoderOption
11
+ from ...formats.schema import FFMpegMuxerOption
12
+ from ...types import (
13
+ Boolean,
14
+ Float,
15
+ Func,
16
+ Int,
17
+ Int64,
18
+ String,
19
+ Time,
20
+ )
21
+ from ...utils.frozendict import merge
9
22
 
10
23
  if TYPE_CHECKING:
11
24
  from ..nodes import FilterableStream, OutputNode, OutputStream
@@ -115,7 +128,9 @@ class OutputArgs(ABC):
115
128
  dcodec: String = None,
116
129
  dn: Boolean = None,
117
130
  top: Int = None,
118
- extra_options: dict[str, Any] = None,
131
+ encoder_options: FFMpegEncoderOption | None = None,
132
+ muxer_options: FFMpegMuxerOption | None = None,
133
+ extra_options: dict[str, Any] | None = None,
119
134
  ) -> OutputStream:
120
135
  """
121
136
  Output file URL
@@ -218,113 +233,116 @@ class OutputArgs(ABC):
218
233
  dcodec: alias for -c:d (select encoder/decoder for data streams)
219
234
  dn: disable data
220
235
  top: deprecated, use the setfield video filter
236
+ encoder_options: ffmpeg's encoder options
237
+ muxer_options: FFMpegMuxerOption | None = None,
221
238
  extra_options: the arguments for the output
222
239
 
223
240
  Returns:
224
241
  the output stream
225
242
  """
226
243
 
227
- options = {
228
- k: v
229
- for k, v in {
230
- "f": f,
231
- "c": c,
232
- "codec": codec,
233
- "pre": pre,
234
- "map": map,
235
- "map_metadata": map_metadata,
236
- "map_chapters": map_chapters,
237
- "t": t,
238
- "to": to,
239
- "fs": fs,
240
- "ss": ss,
241
- "timestamp": timestamp,
242
- "metadata": metadata,
243
- "program": program,
244
- "stream_group": stream_group,
245
- "dframes": dframes,
246
- "target": target,
247
- "shortest": shortest,
248
- "shortest_buf_duration": shortest_buf_duration,
249
- "bitexact": bitexact,
250
- "apad": apad,
251
- "copyinkf": copyinkf,
252
- "copypriorss": copypriorss,
253
- "frames": frames,
254
- "tag": tag,
255
- "q": q,
256
- "qscale": qscale,
257
- "profile": profile,
258
- "filter": filter,
259
- "filter_script": filter_script,
260
- "attach": attach,
261
- "disposition": disposition,
262
- "thread_queue_size": thread_queue_size,
263
- "bits_per_raw_sample": bits_per_raw_sample,
264
- "stats_enc_pre": stats_enc_pre,
265
- "stats_enc_post": stats_enc_post,
266
- "stats_mux_pre": stats_mux_pre,
267
- "stats_enc_pre_fmt": stats_enc_pre_fmt,
268
- "stats_enc_post_fmt": stats_enc_post_fmt,
269
- "stats_mux_pre_fmt": stats_mux_pre_fmt,
270
- "vframes": vframes,
271
- "r": r,
272
- "fpsmax": fpsmax,
273
- "s": s,
274
- "aspect": aspect,
275
- "pix_fmt": pix_fmt,
276
- "vn": vn,
277
- "rc_override": rc_override,
278
- "vcodec": vcodec,
279
- "timecode": timecode,
280
- "pass": _pass,
281
- "passlogfile": passlogfile,
282
- "vf": vf,
283
- "intra_matrix": intra_matrix,
284
- "inter_matrix": inter_matrix,
285
- "chroma_intra_matrix": chroma_intra_matrix,
286
- "vtag": vtag,
287
- "fps_mode": fps_mode,
288
- "force_fps": force_fps,
289
- "streamid": streamid,
290
- "force_key_frames": force_key_frames,
291
- "b": b,
292
- "autoscale": autoscale,
293
- "fix_sub_duration_heartbeat": fix_sub_duration_heartbeat,
294
- "aframes": aframes,
295
- "aq": aq,
296
- "ar": ar,
297
- "ac": ac,
298
- "an": an,
299
- "acodec": acodec,
300
- "ab": ab,
301
- "atag": atag,
302
- "sample_fmt": sample_fmt,
303
- "channel_layout": channel_layout,
304
- "ch_layout": ch_layout,
305
- "af": af,
306
- "sn": sn,
307
- "scodec": scodec,
308
- "stag": stag,
309
- "muxdelay": muxdelay,
310
- "muxpreload": muxpreload,
311
- "sdp_file": sdp_file,
312
- "time_base": time_base,
313
- "enc_time_base": enc_time_base,
314
- "bsf": bsf,
315
- "apre": apre,
316
- "vpre": vpre,
317
- "spre": spre,
318
- "fpre": fpre,
319
- "max_muxing_queue_size": max_muxing_queue_size,
320
- "muxing_queue_data_threshold": muxing_queue_data_threshold,
321
- "dcodec": dcodec,
322
- "dn": dn,
323
- "top": top,
324
- }.items()
325
- if v is not None
326
- }
327
-
328
244
  return self._output_node(
329
- *streams, filename=filename, **options, **(extra_options or {})
245
+ *streams,
246
+ filename=filename,
247
+ **merge(
248
+ {
249
+ "f": f,
250
+ "c": c,
251
+ "codec": codec,
252
+ "pre": pre,
253
+ "map": map,
254
+ "map_metadata": map_metadata,
255
+ "map_chapters": map_chapters,
256
+ "t": t,
257
+ "to": to,
258
+ "fs": fs,
259
+ "ss": ss,
260
+ "timestamp": timestamp,
261
+ "metadata": metadata,
262
+ "program": program,
263
+ "stream_group": stream_group,
264
+ "dframes": dframes,
265
+ "target": target,
266
+ "shortest": shortest,
267
+ "shortest_buf_duration": shortest_buf_duration,
268
+ "bitexact": bitexact,
269
+ "apad": apad,
270
+ "copyinkf": copyinkf,
271
+ "copypriorss": copypriorss,
272
+ "frames": frames,
273
+ "tag": tag,
274
+ "q": q,
275
+ "qscale": qscale,
276
+ "profile": profile,
277
+ "filter": filter,
278
+ "filter_script": filter_script,
279
+ "attach": attach,
280
+ "disposition": disposition,
281
+ "thread_queue_size": thread_queue_size,
282
+ "bits_per_raw_sample": bits_per_raw_sample,
283
+ "stats_enc_pre": stats_enc_pre,
284
+ "stats_enc_post": stats_enc_post,
285
+ "stats_mux_pre": stats_mux_pre,
286
+ "stats_enc_pre_fmt": stats_enc_pre_fmt,
287
+ "stats_enc_post_fmt": stats_enc_post_fmt,
288
+ "stats_mux_pre_fmt": stats_mux_pre_fmt,
289
+ "vframes": vframes,
290
+ "r": r,
291
+ "fpsmax": fpsmax,
292
+ "s": s,
293
+ "aspect": aspect,
294
+ "pix_fmt": pix_fmt,
295
+ "vn": vn,
296
+ "rc_override": rc_override,
297
+ "vcodec": vcodec,
298
+ "timecode": timecode,
299
+ "pass": _pass,
300
+ "passlogfile": passlogfile,
301
+ "vf": vf,
302
+ "intra_matrix": intra_matrix,
303
+ "inter_matrix": inter_matrix,
304
+ "chroma_intra_matrix": chroma_intra_matrix,
305
+ "vtag": vtag,
306
+ "fps_mode": fps_mode,
307
+ "force_fps": force_fps,
308
+ "streamid": streamid,
309
+ "force_key_frames": force_key_frames,
310
+ "b": b,
311
+ "autoscale": autoscale,
312
+ "fix_sub_duration_heartbeat": fix_sub_duration_heartbeat,
313
+ "aframes": aframes,
314
+ "aq": aq,
315
+ "ar": ar,
316
+ "ac": ac,
317
+ "an": an,
318
+ "acodec": acodec,
319
+ "ab": ab,
320
+ "atag": atag,
321
+ "sample_fmt": sample_fmt,
322
+ "channel_layout": channel_layout,
323
+ "ch_layout": ch_layout,
324
+ "af": af,
325
+ "sn": sn,
326
+ "scodec": scodec,
327
+ "stag": stag,
328
+ "muxdelay": muxdelay,
329
+ "muxpreload": muxpreload,
330
+ "sdp_file": sdp_file,
331
+ "time_base": time_base,
332
+ "enc_time_base": enc_time_base,
333
+ "bsf": bsf,
334
+ "apre": apre,
335
+ "vpre": vpre,
336
+ "spre": spre,
337
+ "fpre": fpre,
338
+ "max_muxing_queue_size": max_muxing_queue_size,
339
+ "muxing_queue_data_threshold": muxing_queue_data_threshold,
340
+ "dcodec": dcodec,
341
+ "dn": dn,
342
+ "top": top,
343
+ },
344
+ encoder_options.kwargs if encoder_options else {},
345
+ muxer_options.kwargs if muxer_options else {},
346
+ extra_options,
347
+ ),
330
348
  ).stream()
typed_ffmpeg/dag/nodes.py CHANGED
@@ -8,7 +8,7 @@ from typing import TYPE_CHECKING, Any
8
8
 
9
9
  from ..exceptions import FFMpegTypeError, FFMpegValueError
10
10
  from ..schema import StreamType
11
- from ..utils.forzendict import FrozenDict
11
+ from ..utils.frozendict import FrozenDict
12
12
  from ..utils.typing import override
13
13
  from .global_runnable.runnable import GlobalRunable
14
14
  from .io.output_args import OutputArgs
@@ -5,7 +5,7 @@ from functools import cached_property
5
5
  from typing import Literal
6
6
 
7
7
  from ..common.serialize import Serializable
8
- from ..utils.forzendict import FrozenDict
8
+ from ..utils.frozendict import FrozenDict
9
9
  from ..utils.lazy_eval.schema import LazyValue
10
10
  from .utils import is_dag
11
11