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