typed-ffmpeg-compatible 3.2.1__py3-none-any.whl → 3.2.2__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/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '3.2.1'
21
- __version_tuple__ = version_tuple = (3, 2, 1)
20
+ __version__ = version = '3.2.2'
21
+ __version_tuple__ = version_tuple = (3, 2, 2)
@@ -317,37 +317,21 @@ def parse_global(
317
317
  For tokens like ['-y', '-loglevel', 'quiet', '-i', 'input.mp4']:
318
318
  Returns ({'y': True, 'loglevel': 'quiet'}, ['-i', 'input.mp4'])
319
319
  """
320
- global_params: dict[str, str | bool] = {}
321
- remaining_tokens = tokens.copy()
322
-
323
- # Process tokens until we hit an input file marker (-i)
324
- while remaining_tokens and remaining_tokens[0] != "-i":
325
- if remaining_tokens[0].startswith("-"):
326
- option_name = remaining_tokens[0][1:]
327
- assert option_name in ffmpeg_options, (
328
- f"Unknown global option: {option_name}"
329
- )
330
- option = ffmpeg_options[option_name]
331
-
332
- if not option.is_global_option:
333
- continue
334
-
335
- if len(remaining_tokens) > 1 and not remaining_tokens[1].startswith("-"):
336
- # Option with value
337
- global_params[option_name] = remaining_tokens[1]
338
- remaining_tokens = remaining_tokens[2:]
320
+ options = parse_options(tokens[: tokens.index("-i")])
321
+ remaining_tokens = tokens[tokens.index("-i") :]
322
+ parameters: dict[str, str | bool] = {}
323
+
324
+ for key, value in options.items():
325
+ assert key in ffmpeg_options, f"Unknown option: {key}"
326
+ option = ffmpeg_options[key]
327
+
328
+ if option.is_global_option:
329
+ # Process only recognized global options
330
+ if value[-1] is None:
331
+ parameters[key] = True
339
332
  else:
340
- # Boolean option
341
- if option_name.startswith("no"):
342
- global_params[option_name[2:]] = False
343
- else:
344
- global_params[option_name] = True
345
- remaining_tokens = remaining_tokens[1:]
346
- else:
347
- # Skip non-option tokens
348
- remaining_tokens = remaining_tokens[1:]
349
-
350
- return global_params, remaining_tokens
333
+ parameters[key] = value[-1]
334
+ return parameters, remaining_tokens
351
335
 
352
336
 
353
337
  def parse(cli: str) -> Stream:
@@ -356,7 +340,7 @@ def parse(cli: str) -> Stream:
356
340
  ffmpeg_filters = get_filter_dict()
357
341
 
358
342
  tokens = shlex.split(cli)
359
- assert tokens[0] == "ffmpeg"
343
+ assert tokens[0].lower().split(".")[0] == "ffmpeg"
360
344
  tokens = tokens[1:]
361
345
 
362
346
  # Parse global options first
@@ -72,7 +72,6 @@ def _parse_obj_from_dict(data: Any, cls: type[T]) -> T | None:
72
72
  Returns:
73
73
  The parsed dataclass instance
74
74
  """
75
-
76
75
  if data is None:
77
76
  return None
78
77
 
@@ -104,6 +103,7 @@ def _parse_obj_from_dict(data: Any, cls: type[T]) -> T | None:
104
103
  continue
105
104
  item_type = tuple_args[0]
106
105
  value = data.get(field_name, [])
106
+ # NOTE: if the value is a single item, convert it to a list (xml's issue)
107
107
  if not isinstance(value, list):
108
108
  value = [value]
109
109
  kwargs[field_name] = tuple(
@@ -26,15 +26,15 @@ class packetsType:
26
26
 
27
27
  @dataclass(kw_only=True, frozen=True)
28
28
  class framesType:
29
- frame: Optional["frameType"] = None
30
- subtitle: Optional["subtitleType"] = None
29
+ frame: tuple["frameType", ...] | None = None
30
+ subtitle: tuple["subtitleType", ...] | None = None
31
31
 
32
32
 
33
33
  @dataclass(kw_only=True, frozen=True)
34
34
  class packetsAndFramesType:
35
- packet: Optional["packetType"] = None
36
- frame: Optional["frameType"] = None
37
- subtitle: Optional["subtitleType"] = None
35
+ packet: tuple["packetType", ...] | None = None
36
+ frame: tuple["frameType", ...] | None = None
37
+ subtitle: tuple["subtitleType", ...] | None = None
38
38
 
39
39
 
40
40
  @dataclass(kw_only=True, frozen=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: typed-ffmpeg-compatible
3
- Version: 3.2.1
3
+ Version: 3.2.2
4
4
  Summary: Modern Python FFmpeg wrappers offer comprehensive support for complex filters, complete with detailed typing and documentation.
5
5
  Author-email: lucemia <lucemia@gmail.com>
6
6
  License-Expression: MIT
@@ -1,5 +1,5 @@
1
1
  typed_ffmpeg/__init__.py,sha256=n1SZfENc9xhZ0eA3ZzkBNPuIY-Pt3-rOwB8-uUj5olU,1592
2
- typed_ffmpeg/_version.py,sha256=XRi79FWoZnvkU9YpUCVq-_6vnTUrxKmzOwOlvrJYqm4,511
2
+ typed_ffmpeg/_version.py,sha256=VfQFwh2Vyb8ry8WT1y6VfXFKIN0E2GC1aed16irkCFQ,511
3
3
  typed_ffmpeg/base.py,sha256=C5Tqbx2I0c-09D7aXKZoGkspu-lAAeAhuOns5zr3PXQ,6304
4
4
  typed_ffmpeg/exceptions.py,sha256=D4SID6WOwkjVV8O8mAjrEDHWn-8BRDnK_jteaDof1SY,2474
5
5
  typed_ffmpeg/filters.py,sha256=_lBpGZgPHK3KgGVrw-TCdQEsBRuEXVIgwggYNGd80MU,110076
@@ -13,7 +13,7 @@ typed_ffmpeg/common/cache.py,sha256=j0JvfX7jewLpdJWxgo7Pwze0BkUJdYGHX2uGR8BZ-9M,
13
13
  typed_ffmpeg/common/schema.py,sha256=qM8yfMX9UU3EAQSNsTrr-SAmyqKx8eQCXTtu3RJWkEk,19673
14
14
  typed_ffmpeg/common/serialize.py,sha256=dLim0DBP5CdJ1JiMV9xEmmh1XMSIhBOWs61EopAL15s,7719
15
15
  typed_ffmpeg/compile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- typed_ffmpeg/compile/compile_cli.py,sha256=wzLW0_JYS6vth-8YGfkzVaGJg1er-_-ekX-X0KxDC_I,29042
16
+ typed_ffmpeg/compile/compile_cli.py,sha256=nLrTV5nuC1ETff8C7_ZgZDKPtvXJoQfZsAbm_oq1WA8,28397
17
17
  typed_ffmpeg/compile/compile_json.py,sha256=YCiTyfAnUVSbFr7BiQpmJYs13K5sa-xo77Iih33mb6I,992
18
18
  typed_ffmpeg/compile/compile_python.py,sha256=oo4e8Ldwk0OkrZtHucfuGR5JDFF8xY8omNKPMDyUpQ8,11506
19
19
  typed_ffmpeg/compile/context.py,sha256=macQ3HhEJ73j_WbWYtU9GCQCzcB_KQGAPimcuU-WOac,10946
@@ -31,9 +31,9 @@ typed_ffmpeg/dag/io/_input.py,sha256=KRLTSQPEfmgPcPEAJdeWRHZhNsClaJCB9Ac6czMOrmE
31
31
  typed_ffmpeg/dag/io/_output.py,sha256=_no6ffAOABznbLNTki8CYr7pvr4Sa0LweRfn38-cszs,12470
32
32
  typed_ffmpeg/dag/io/output_args.py,sha256=SThIhZh9PXs2m6Fz5JsSy8oS-Te7GM_oz7HRuZo0-eI,13901
33
33
  typed_ffmpeg/ffprobe/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
- typed_ffmpeg/ffprobe/parse.py,sha256=9Lp7VgFOjAlyPOgtyW1iomRrt-O8Hbsm71gqtolpPjs,3706
34
+ typed_ffmpeg/ffprobe/parse.py,sha256=fq1cGFkUpUdvyVi3S-TAQ7qn-tXUdae6ADhymZt7-t4,3791
35
35
  typed_ffmpeg/ffprobe/probe.py,sha256=D_opsKp3OgT2HSBzhxgY1b9SIqXpDhz3xh_k9HUGux0,10367
36
- typed_ffmpeg/ffprobe/schema.py,sha256=QmFN3ZxGvQmE7gRWbRUmgznPMe9HZ28nGc5srxwwUhY,13586
36
+ typed_ffmpeg/ffprobe/schema.py,sha256=PBgBWYGO8wKnI0Lae9oCJ1Nprhv2ciPkdLrumzPVllY,13631
37
37
  typed_ffmpeg/ffprobe/xml2json.py,sha256=1TSuxR7SYc-M_-JmE-1khHGbXCapgW0Oap9kzL0nwNg,2455
38
38
  typed_ffmpeg/streams/__init__.py,sha256=Nt9uWpcVI1sQLl5Qt_kBCBcWOGZA1vczCQ0qvFbSko0,141
39
39
  typed_ffmpeg/streams/audio.py,sha256=2oNRhb5UetWtlPG3NW73AjUZoFPl303yMv-6W1sGWt0,259054
@@ -50,8 +50,9 @@ typed_ffmpeg/utils/view.py,sha256=QCSlQoQkRBI-T0sWjiywGgM9DlKd8Te3CB2ZYX-pEVU,34
50
50
  typed_ffmpeg/utils/lazy_eval/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  typed_ffmpeg/utils/lazy_eval/operator.py,sha256=QWybd-UH3VdDa8kgWkqAMi3WV0b0WF1d1JixQr6is2E,4136
52
52
  typed_ffmpeg/utils/lazy_eval/schema.py,sha256=WSg-E3MS3itN1AT6Dq4Z9btnRHEReuN3o6zruXou7h4,9623
53
- typed_ffmpeg_compatible-3.2.1.dist-info/licenses/LICENSE,sha256=8Aaya5i_09Cou2i3QMxTwz6uHGzi_fGA4uhkco07-A4,1066
54
- typed_ffmpeg_compatible-3.2.1.dist-info/METADATA,sha256=bqpqg08AUkgGm22Htg9TrOjhUrvOJncpspmOCmIzgMk,8385
55
- typed_ffmpeg_compatible-3.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
56
- typed_ffmpeg_compatible-3.2.1.dist-info/top_level.txt,sha256=vuASJGVRQiNmhWY1pt0RXESWSNkknWXqWLIRAU7H_L4,13
57
- typed_ffmpeg_compatible-3.2.1.dist-info/RECORD,,
53
+ typed_ffmpeg_compatible-3.2.2.dist-info/licenses/LICENSE,sha256=8Aaya5i_09Cou2i3QMxTwz6uHGzi_fGA4uhkco07-A4,1066
54
+ typed_ffmpeg_compatible-3.2.2.dist-info/METADATA,sha256=eJv1JAMT41NxhuCYDvTZOBNyU5n2XoiFfyDTVtohI28,8385
55
+ typed_ffmpeg_compatible-3.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
56
+ typed_ffmpeg_compatible-3.2.2.dist-info/entry_points.txt,sha256=kUQvZ27paV-07qtkIFV-emKsYtjFOTw9kknBRSXPs04,45
57
+ typed_ffmpeg_compatible-3.2.2.dist-info/top_level.txt,sha256=vuASJGVRQiNmhWY1pt0RXESWSNkknWXqWLIRAU7H_L4,13
58
+ typed_ffmpeg_compatible-3.2.2.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ scripts = scripts.main:app