typed-ffmpeg-compatible 3.0.0a0__py3-none-any.whl → 3.0.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.
@@ -160,8 +160,16 @@ def get_stream_label(stream: Stream, context: DAGContext | None = None) -> str:
160
160
  case AVStream():
161
161
  return f"{get_node_label(stream.node, context)}"
162
162
  case VideoStream():
163
+ if stream.index is not None:
164
+ return (
165
+ f"{get_node_label(stream.node, context)}:v:{stream.index}"
166
+ )
163
167
  return f"{get_node_label(stream.node, context)}:v"
164
168
  case AudioStream():
169
+ if stream.index is not None:
170
+ return (
171
+ f"{get_node_label(stream.node, context)}:a:{stream.index}"
172
+ )
165
173
  return f"{get_node_label(stream.node, context)}:a"
166
174
  case _:
167
175
  raise FFMpegValueError(
@@ -77,7 +77,10 @@ def get_input_var_name(
77
77
  case VideoStream():
78
78
  match stream.node:
79
79
  case InputNode():
80
- return f"{get_output_var_name(stream.node, context)}.video"
80
+ if stream.index is not None:
81
+ return f"{get_output_var_name(stream.node, context)}.video_stream({stream.index})"
82
+ else:
83
+ return f"{get_output_var_name(stream.node, context)}.video"
81
84
  case FilterNode():
82
85
  if filter_data_dict[stream.node.name].is_dynamic_output:
83
86
  return f"{get_output_var_name(stream.node, context)}.video({filter_stream_typed_index(stream, context)})"
@@ -91,7 +94,10 @@ def get_input_var_name(
91
94
  case AudioStream():
92
95
  match stream.node:
93
96
  case InputNode():
94
- return f"{get_output_var_name(stream.node, context)}.audio"
97
+ if stream.index is not None:
98
+ return f"{get_output_var_name(stream.node, context)}.audio_stream({stream.index})"
99
+ else:
100
+ return f"{get_output_var_name(stream.node, context)}.audio"
95
101
  case FilterNode():
96
102
  if filter_data_dict[stream.node.name].is_dynamic_output:
97
103
  return f"{get_output_var_name(stream.node, context)}.audio({filter_stream_typed_index(stream, context)})"
typed_ffmpeg/dag/nodes.py CHANGED
@@ -337,9 +337,7 @@ class FilterableStream(Stream, OutputArgs):
337
337
  )
338
338
 
339
339
  def __post_init__(self) -> None:
340
- if isinstance(self.node, InputNode):
341
- assert self.index is None, "Input streams cannot have an index"
342
- else:
340
+ if not isinstance(self.node, InputNode):
343
341
  assert self.index is not None, "Filter streams must have an index"
344
342
 
345
343
 
@@ -1,5 +1,4 @@
1
1
  from ..dag.nodes import InputNode
2
- from ..utils.typing import override
3
2
  from .audio import AudioStream
4
3
  from .video import VideoStream
5
4
 
@@ -12,11 +11,45 @@ class AVStream(AudioStream, VideoStream):
12
11
  node: InputNode
13
12
 
14
13
  @property
15
- @override
16
14
  def video(self) -> VideoStream:
15
+ """
16
+ Get the video stream from the input node.
17
+
18
+ Returns:
19
+ VideoStream: The video stream from the input node.
20
+ """
17
21
  return VideoStream(node=self.node, index=self.index)
18
22
 
19
23
  @property
20
- @override
21
24
  def audio(self) -> AudioStream:
25
+ """
26
+ Get the audio stream from the input node.
27
+
28
+ Returns:
29
+ AudioStream: The audio stream from the input node.
30
+ """
22
31
  return AudioStream(node=self.node, index=self.index)
32
+
33
+ def video_stream(self, index: int) -> VideoStream:
34
+ """
35
+ Get the video stream from the input node with a specified index.
36
+
37
+ Args:
38
+ index: The index of the video stream.
39
+
40
+ Returns:
41
+ VideoStream: The video stream from the input node.
42
+ """
43
+ return VideoStream(node=self.node, index=index)
44
+
45
+ def audio_stream(self, index: int) -> AudioStream:
46
+ """
47
+ Get the audio stream from the input node with a specified index.
48
+
49
+ Args:
50
+ index: The index of the audio stream.
51
+
52
+ Returns:
53
+ AudioStream: The audio stream from the input node.
54
+ """
55
+ return AudioStream(node=self.node, index=index)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: typed-ffmpeg-compatible
3
- Version: 3.0.0a0
3
+ Version: 3.0.1
4
4
  Summary: Modern Python FFmpeg wrappers offer comprehensive support for complex filters, complete with detailed typing and documentation.
5
5
  Home-page: https://livingbio.github.io/typed-ffmpeg/
6
6
  License: MIT
@@ -43,13 +43,14 @@ typed_ffmpeg/common/cache/FFMpegFilterManuallyDefined/vstack.json,sha256=MMulT4N
43
43
  typed_ffmpeg/common/cache/FFMpegFilterManuallyDefined/xmedian.json,sha256=Er7eTcYZCop6QMZT0OXC9QV6tf76mRBYXjqPIqdKDtU,212
44
44
  typed_ffmpeg/common/cache/FFMpegFilterManuallyDefined/xstack.json,sha256=6Svn1w2FopoYufK0kWCJR7xZndMyTItRs63-TafWMnk,211
45
45
  typed_ffmpeg/common/cache/list/filters.json,sha256=s5-tRP3Jrun2nlj5nV_StPozuC5y3cNcb_xCc4OSulg,2390250
46
+ typed_ffmpeg/common/cache/list/options.json,sha256=bmODg-h8ZI90IWICSW44CllVkPRnUs6nJ4pOOQ__cqw,40453
46
47
  typed_ffmpeg/common/cache.py,sha256=j0JvfX7jewLpdJWxgo7Pwze0BkUJdYGHX2uGR8BZ-9M,1386
47
48
  typed_ffmpeg/common/schema.py,sha256=qM8yfMX9UU3EAQSNsTrr-SAmyqKx8eQCXTtu3RJWkEk,19673
48
49
  typed_ffmpeg/common/serialize.py,sha256=dLim0DBP5CdJ1JiMV9xEmmh1XMSIhBOWs61EopAL15s,7719
49
50
  typed_ffmpeg/compile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
- typed_ffmpeg/compile/compile_cli.py,sha256=EE3TE1p3bBusuivR9lYZxYZZuciFfTvpavwpgkIY-dI,14436
51
+ typed_ffmpeg/compile/compile_cli.py,sha256=qwcBtl4-ha7rYAY6dWoM12ngbP8i6QzqwtrQrL3mqC0,14826
51
52
  typed_ffmpeg/compile/compile_json.py,sha256=YCiTyfAnUVSbFr7BiQpmJYs13K5sa-xo77Iih33mb6I,992
52
- typed_ffmpeg/compile/compile_python.py,sha256=taI4QN0oTAr4GECHqgWqn_gKOXEZ7zYYKr9PHzrKI_U,11150
53
+ typed_ffmpeg/compile/compile_python.py,sha256=rsoF4spI3cq6uMHU3iN-j8QByj2yE5pEqjatWCaf0D4,11522
53
54
  typed_ffmpeg/compile/context.py,sha256=macQ3HhEJ73j_WbWYtU9GCQCzcB_KQGAPimcuU-WOac,10946
54
55
  typed_ffmpeg/compile/validate.py,sha256=QsWksdvlRwWw6hnatFo-ABakms1qDXRbEmvMQGRLrD8,9579
55
56
  typed_ffmpeg/dag/__init__.py,sha256=qAApSNqjbZ1DtUaV5bSku9RwG7MpMPa1HJO764cSBt4,849
@@ -61,7 +62,7 @@ typed_ffmpeg/dag/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
61
62
  typed_ffmpeg/dag/io/_input.py,sha256=KRLTSQPEfmgPcPEAJdeWRHZhNsClaJCB9Ac6czMOrmE,7214
62
63
  typed_ffmpeg/dag/io/_output.py,sha256=_no6ffAOABznbLNTki8CYr7pvr4Sa0LweRfn38-cszs,12470
63
64
  typed_ffmpeg/dag/io/output_args.py,sha256=SThIhZh9PXs2m6Fz5JsSy8oS-Te7GM_oz7HRuZo0-eI,13901
64
- typed_ffmpeg/dag/nodes.py,sha256=fEySoGvqFFF-5rlWxhSYm83XB_bL-t3LzvBnf3lFqQc,20612
65
+ typed_ffmpeg/dag/nodes.py,sha256=lfHChT8JqRs3UUDWtgrWnnXn845HXSD5S1QmHpIUT4U,20526
65
66
  typed_ffmpeg/dag/schema.py,sha256=dSq0o8e9qFazyd55k2yXcxbjoKZJEtqeROd91w1O3Wo,5728
66
67
  typed_ffmpeg/dag/utils.py,sha256=hydh7_kjpOCw8WEGhXMxIXR4Ek-3DeoOt6esInuK2Xw,1941
67
68
  typed_ffmpeg/exceptions.py,sha256=D4SID6WOwkjVV8O8mAjrEDHWn-8BRDnK_jteaDof1SY,2474
@@ -73,7 +74,7 @@ typed_ffmpeg/schema.py,sha256=KVtmyGeJutjFot70r6Nj8W8WBqwvfg2-rSgjdhPVh-o,1615
73
74
  typed_ffmpeg/sources.py,sha256=ASt0l8FMW82X-70qw72167xpyBY7tQQClVuhy8r0HfU,86026
74
75
  typed_ffmpeg/streams/__init__.py,sha256=Nt9uWpcVI1sQLl5Qt_kBCBcWOGZA1vczCQ0qvFbSko0,141
75
76
  typed_ffmpeg/streams/audio.py,sha256=2oNRhb5UetWtlPG3NW73AjUZoFPl303yMv-6W1sGWt0,259054
76
- typed_ffmpeg/streams/av.py,sha256=SWcy8Q9hk36ZZJ4WosG08NR-r1f2IzOgZ4tsAZ7nX18,544
77
+ typed_ffmpeg/streams/av.py,sha256=Nu6M7uV4aMNQf_kxADZuBdpDwFx_B7Z7x0p5j32n9iA,1500
77
78
  typed_ffmpeg/streams/channel_layout.py,sha256=hGagaoc1tnWS8K1yiITp4f_92qq5e7C_zB15bHOL0DI,1162
78
79
  typed_ffmpeg/streams/video.py,sha256=cQwHfew75YO_dbZjmpUYd-nXt1JHN0M7suFKKe5UH5s,453576
79
80
  typed_ffmpeg/types.py,sha256=ly3zLtg7KxRa_jsDDrFPAxRZRjTQdWVpiQzOD9NdrFM,4137
@@ -87,8 +88,8 @@ typed_ffmpeg/utils/run.py,sha256=mSoAdcvD-InldqkRgWNc8iXKgJJoEMAOE4PL2gVmtqw,217
87
88
  typed_ffmpeg/utils/snapshot.py,sha256=mKILRm6qiQV2egaD-70MSUEl-DFoLD5w_v9GZIequI4,2181
88
89
  typed_ffmpeg/utils/typing.py,sha256=DBQn_gCF8C_DTwsfMHeCgfnNUROwAjlIcHrQ7lNDOoE,1187
89
90
  typed_ffmpeg/utils/view.py,sha256=QCSlQoQkRBI-T0sWjiywGgM9DlKd8Te3CB2ZYX-pEVU,3413
90
- typed_ffmpeg_compatible-3.0.0a0.dist-info/LICENSE,sha256=8Aaya5i_09Cou2i3QMxTwz6uHGzi_fGA4uhkco07-A4,1066
91
- typed_ffmpeg_compatible-3.0.0a0.dist-info/METADATA,sha256=DPuESX4-XFIKqUCRM3CKzxfnzuUXYu9RoMpF3gO8j-0,7251
92
- typed_ffmpeg_compatible-3.0.0a0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
93
- typed_ffmpeg_compatible-3.0.0a0.dist-info/entry_points.txt,sha256=KfZmNsM16GT_lF1otASIN6E3i6xXHXoB1gMeEdlptjA,44
94
- typed_ffmpeg_compatible-3.0.0a0.dist-info/RECORD,,
91
+ typed_ffmpeg_compatible-3.0.1.dist-info/LICENSE,sha256=8Aaya5i_09Cou2i3QMxTwz6uHGzi_fGA4uhkco07-A4,1066
92
+ typed_ffmpeg_compatible-3.0.1.dist-info/METADATA,sha256=LfhzfDCrQibFfmOQwWYOh1oPPbkA8LBPkJjvQW_Vmag,7249
93
+ typed_ffmpeg_compatible-3.0.1.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
94
+ typed_ffmpeg_compatible-3.0.1.dist-info/entry_points.txt,sha256=KfZmNsM16GT_lF1otASIN6E3i6xXHXoB1gMeEdlptjA,44
95
+ typed_ffmpeg_compatible-3.0.1.dist-info/RECORD,,