typed-ffmpeg-compatible 3.5.1__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.
Files changed (71) hide show
  1. typed_ffmpeg/__init__.py +4 -1
  2. typed_ffmpeg/_version.py +2 -2
  3. typed_ffmpeg/base.py +4 -1
  4. typed_ffmpeg/codecs/__init__.py +2 -0
  5. typed_ffmpeg/codecs/decoders.py +1852 -1853
  6. typed_ffmpeg/codecs/encoders.py +2001 -1782
  7. typed_ffmpeg/codecs/schema.py +6 -12
  8. typed_ffmpeg/common/__init__.py +1 -0
  9. typed_ffmpeg/common/cache.py +9 -6
  10. typed_ffmpeg/common/schema.py +11 -0
  11. typed_ffmpeg/common/serialize.py +13 -7
  12. typed_ffmpeg/compile/__init__.py +1 -0
  13. typed_ffmpeg/compile/compile_cli.py +55 -8
  14. typed_ffmpeg/compile/compile_json.py +4 -0
  15. typed_ffmpeg/compile/compile_python.py +15 -0
  16. typed_ffmpeg/compile/context.py +15 -4
  17. typed_ffmpeg/compile/validate.py +9 -8
  18. typed_ffmpeg/dag/factory.py +2 -0
  19. typed_ffmpeg/dag/global_runnable/__init__.py +1 -0
  20. typed_ffmpeg/dag/global_runnable/global_args.py +2 -2
  21. typed_ffmpeg/dag/global_runnable/runnable.py +51 -11
  22. typed_ffmpeg/dag/io/__init__.py +1 -0
  23. typed_ffmpeg/dag/io/_input.py +20 -5
  24. typed_ffmpeg/dag/io/_output.py +24 -9
  25. typed_ffmpeg/dag/io/output_args.py +21 -7
  26. typed_ffmpeg/dag/nodes.py +20 -0
  27. typed_ffmpeg/dag/schema.py +19 -6
  28. typed_ffmpeg/dag/utils.py +2 -2
  29. typed_ffmpeg/exceptions.py +2 -1
  30. typed_ffmpeg/expressions.py +884 -0
  31. typed_ffmpeg/ffprobe/__init__.py +1 -0
  32. typed_ffmpeg/ffprobe/parse.py +7 -1
  33. typed_ffmpeg/ffprobe/probe.py +3 -1
  34. typed_ffmpeg/ffprobe/schema.py +83 -1
  35. typed_ffmpeg/ffprobe/xml2json.py +8 -2
  36. typed_ffmpeg/filters.py +540 -631
  37. typed_ffmpeg/formats/__init__.py +2 -0
  38. typed_ffmpeg/formats/demuxers.py +1869 -1921
  39. typed_ffmpeg/formats/muxers.py +1382 -1107
  40. typed_ffmpeg/formats/schema.py +6 -12
  41. typed_ffmpeg/info.py +8 -0
  42. typed_ffmpeg/options/__init__.py +15 -0
  43. typed_ffmpeg/options/codec.py +711 -0
  44. typed_ffmpeg/options/format.py +196 -0
  45. typed_ffmpeg/options/framesync.py +43 -0
  46. typed_ffmpeg/options/timeline.py +22 -0
  47. typed_ffmpeg/schema.py +15 -0
  48. typed_ffmpeg/sources.py +392 -381
  49. typed_ffmpeg/streams/__init__.py +2 -0
  50. typed_ffmpeg/streams/audio.py +1071 -882
  51. typed_ffmpeg/streams/av.py +9 -3
  52. typed_ffmpeg/streams/subtitle.py +3 -3
  53. typed_ffmpeg/streams/video.py +1873 -1725
  54. typed_ffmpeg/types.py +3 -2
  55. typed_ffmpeg/utils/__init__.py +1 -0
  56. typed_ffmpeg/utils/escaping.py +8 -4
  57. typed_ffmpeg/utils/frozendict.py +31 -1
  58. typed_ffmpeg/utils/lazy_eval/__init__.py +1 -0
  59. typed_ffmpeg/utils/lazy_eval/operator.py +75 -27
  60. typed_ffmpeg/utils/lazy_eval/schema.py +176 -4
  61. typed_ffmpeg/utils/run.py +2 -0
  62. typed_ffmpeg/utils/snapshot.py +3 -2
  63. typed_ffmpeg/utils/typing.py +2 -1
  64. typed_ffmpeg/utils/view.py +2 -1
  65. {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/METADATA +1 -1
  66. typed_ffmpeg_compatible-3.6.dist-info/RECORD +73 -0
  67. typed_ffmpeg_compatible-3.5.1.dist-info/RECORD +0 -67
  68. {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/WHEEL +0 -0
  69. {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/entry_points.txt +0 -0
  70. {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/licenses/LICENSE +0 -0
  71. {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,5 @@
1
+ """DAG schema definitions for FFmpeg filter graphs."""
2
+
1
3
  from __future__ import annotations
2
4
 
3
5
  from dataclasses import dataclass, replace
@@ -12,15 +14,11 @@ from .utils import is_dag
12
14
 
13
15
  @dataclass(frozen=True, kw_only=True)
14
16
  class HashableBaseModel(Serializable):
15
- """
16
- A base class for hashable dataclasses.
17
- """
17
+ """A base class for hashable dataclasses."""
18
18
 
19
19
  @cached_property
20
20
  def hex(self) -> str:
21
- """
22
- Get the hexadecimal hash of the object.
23
- """
21
+ """Get the hexadecimal hash of the object."""
24
22
  return hex(abs(hash(self)))[2:]
25
23
 
26
24
 
@@ -31,6 +29,7 @@ class Stream(HashableBaseModel):
31
29
 
32
30
  Note:
33
31
  Each stream in the DAG is a sequence of operations that transforms the data from its input form to its output form. The stream is an essential component of the DAG, as it defines the order and the nature of the operations that are performed on the data.
32
+
34
33
  """
35
34
 
36
35
  node: Node
@@ -66,6 +65,7 @@ class Stream(HashableBaseModel):
66
65
 
67
66
  Returns:
68
67
  The file path of the visualization.
68
+
69
69
  """
70
70
  from ..utils.view import view
71
71
 
@@ -87,6 +87,7 @@ class Node(HashableBaseModel):
87
87
 
88
88
  Note:
89
89
  Each node in the DAG represents a single operation that transforms the data from its input form to its output form. The node is an essential component of the DAG, as it defines the nature of the operations that are performed on the data.
90
+
90
91
  """
91
92
 
92
93
  # Filter_Node_Option_Type
@@ -102,6 +103,13 @@ class Node(HashableBaseModel):
102
103
  """
103
104
 
104
105
  def __post_init__(self) -> None:
106
+ """
107
+ Validate that the graph is a DAG (Directed Acyclic Graph).
108
+
109
+ Raises:
110
+ ValueError: If the graph is not a DAG
111
+
112
+ """
105
113
  # Validate the DAG
106
114
  passed = set()
107
115
  nodes = [self]
@@ -127,6 +135,7 @@ class Node(HashableBaseModel):
127
135
 
128
136
  Returns:
129
137
  The representation of the node.
138
+
130
139
  """
131
140
  return repr(self)
132
141
 
@@ -140,6 +149,7 @@ class Node(HashableBaseModel):
140
149
 
141
150
  Returns:
142
151
  The new graph with the replaced node.
152
+
143
153
  """
144
154
  if self == old_node:
145
155
  return new_node
@@ -165,6 +175,7 @@ class Node(HashableBaseModel):
165
175
 
166
176
  Returns:
167
177
  The maximum depth of the node.
178
+
168
179
  """
169
180
  return max((i.node.max_depth for i in self.inputs), default=0) + 1
170
181
 
@@ -175,6 +186,7 @@ class Node(HashableBaseModel):
175
186
 
176
187
  Returns:
177
188
  The upstream nodes of the node.
189
+
178
190
  """
179
191
  output = {self}
180
192
  for input in self.inputs:
@@ -191,6 +203,7 @@ class Node(HashableBaseModel):
191
203
 
192
204
  Returns:
193
205
  The file path of the visualization.
206
+
194
207
  """
195
208
  from ..utils.view import view
196
209
 
typed_ffmpeg/dag/utils.py CHANGED
@@ -38,9 +38,9 @@ def is_dag(graph: dict[str, set[str]]) -> bool:
38
38
  graph = {"A": {"B"}, "B": {"C"}, "C": {"A"}}
39
39
  assert is_dag(graph) == False
40
40
  ```
41
- """
42
41
 
43
- in_degree = {u: 0 for u in graph} # Initialize in-degree of each node to 0
42
+ """
43
+ in_degree = dict.fromkeys(graph, 0) # Initialize in-degree of each node to 0
44
44
 
45
45
  # Calculate in-degree of each node
46
46
  for u in graph:
@@ -54,6 +54,7 @@ class FFMpegExecuteError(FFMpegError):
54
54
  stderr: The standard error output of the failed command
55
55
  cmd: The command string that was executed
56
56
  retcode: The process return code
57
+
57
58
  """
58
59
 
59
60
  def __init__(self, retcode: int | None, cmd: str, stdout: bytes, stderr: bytes):
@@ -65,8 +66,8 @@ class FFMpegExecuteError(FFMpegError):
65
66
  cmd: The FFmpeg command string that was executed
66
67
  stdout: The captured standard output from the process
67
68
  stderr: The captured standard error from the process
68
- """
69
69
 
70
+ """
70
71
  self.stdout = stdout
71
72
  self.stderr = stderr
72
73
  self.cmd = cmd