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.
- typed_ffmpeg/__init__.py +4 -1
- typed_ffmpeg/_version.py +2 -2
- typed_ffmpeg/base.py +4 -1
- typed_ffmpeg/codecs/__init__.py +2 -0
- typed_ffmpeg/codecs/decoders.py +1852 -1853
- typed_ffmpeg/codecs/encoders.py +2001 -1782
- typed_ffmpeg/codecs/schema.py +6 -12
- typed_ffmpeg/common/__init__.py +1 -0
- typed_ffmpeg/common/cache.py +9 -6
- typed_ffmpeg/common/schema.py +11 -0
- typed_ffmpeg/common/serialize.py +13 -7
- typed_ffmpeg/compile/__init__.py +1 -0
- typed_ffmpeg/compile/compile_cli.py +55 -8
- typed_ffmpeg/compile/compile_json.py +4 -0
- typed_ffmpeg/compile/compile_python.py +15 -0
- typed_ffmpeg/compile/context.py +15 -4
- typed_ffmpeg/compile/validate.py +9 -8
- typed_ffmpeg/dag/factory.py +2 -0
- typed_ffmpeg/dag/global_runnable/__init__.py +1 -0
- typed_ffmpeg/dag/global_runnable/global_args.py +2 -2
- typed_ffmpeg/dag/global_runnable/runnable.py +51 -11
- typed_ffmpeg/dag/io/__init__.py +1 -0
- typed_ffmpeg/dag/io/_input.py +20 -5
- typed_ffmpeg/dag/io/_output.py +24 -9
- typed_ffmpeg/dag/io/output_args.py +21 -7
- typed_ffmpeg/dag/nodes.py +20 -0
- typed_ffmpeg/dag/schema.py +19 -6
- typed_ffmpeg/dag/utils.py +2 -2
- typed_ffmpeg/exceptions.py +2 -1
- typed_ffmpeg/expressions.py +884 -0
- typed_ffmpeg/ffprobe/__init__.py +1 -0
- typed_ffmpeg/ffprobe/parse.py +7 -1
- typed_ffmpeg/ffprobe/probe.py +3 -1
- typed_ffmpeg/ffprobe/schema.py +83 -1
- typed_ffmpeg/ffprobe/xml2json.py +8 -2
- typed_ffmpeg/filters.py +540 -631
- typed_ffmpeg/formats/__init__.py +2 -0
- typed_ffmpeg/formats/demuxers.py +1869 -1921
- typed_ffmpeg/formats/muxers.py +1382 -1107
- typed_ffmpeg/formats/schema.py +6 -12
- typed_ffmpeg/info.py +8 -0
- typed_ffmpeg/options/__init__.py +15 -0
- typed_ffmpeg/options/codec.py +711 -0
- typed_ffmpeg/options/format.py +196 -0
- typed_ffmpeg/options/framesync.py +43 -0
- typed_ffmpeg/options/timeline.py +22 -0
- typed_ffmpeg/schema.py +15 -0
- typed_ffmpeg/sources.py +392 -381
- typed_ffmpeg/streams/__init__.py +2 -0
- typed_ffmpeg/streams/audio.py +1071 -882
- typed_ffmpeg/streams/av.py +9 -3
- typed_ffmpeg/streams/subtitle.py +3 -3
- typed_ffmpeg/streams/video.py +1873 -1725
- typed_ffmpeg/types.py +3 -2
- typed_ffmpeg/utils/__init__.py +1 -0
- typed_ffmpeg/utils/escaping.py +8 -4
- typed_ffmpeg/utils/frozendict.py +31 -1
- typed_ffmpeg/utils/lazy_eval/__init__.py +1 -0
- typed_ffmpeg/utils/lazy_eval/operator.py +75 -27
- typed_ffmpeg/utils/lazy_eval/schema.py +176 -4
- typed_ffmpeg/utils/run.py +2 -0
- typed_ffmpeg/utils/snapshot.py +3 -2
- typed_ffmpeg/utils/typing.py +2 -1
- typed_ffmpeg/utils/view.py +2 -1
- {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/METADATA +1 -1
- typed_ffmpeg_compatible-3.6.dist-info/RECORD +73 -0
- typed_ffmpeg_compatible-3.5.1.dist-info/RECORD +0 -67
- {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/WHEEL +0 -0
- {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/entry_points.txt +0 -0
- {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/licenses/LICENSE +0 -0
- {typed_ffmpeg_compatible-3.5.1.dist-info → typed_ffmpeg_compatible-3.6.dist-info}/top_level.txt +0 -0
typed_ffmpeg/dag/schema.py
CHANGED
@@ -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
|
-
|
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:
|
typed_ffmpeg/exceptions.py
CHANGED
@@ -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
|