Skip to content

Commit

Permalink
fix #412 remove kwargs (#413)
Browse files Browse the repository at this point in the history
* fix #412 remove kwargs

* fix

* fix snapshot

* fix

* revert

* fix
  • Loading branch information
lucemia authored Jan 5, 2025
1 parent 0c4152a commit f2a669e
Show file tree
Hide file tree
Showing 21 changed files with 765 additions and 1,523 deletions.
3 changes: 0 additions & 3 deletions src/ffmpeg/dag/global_runnable/global_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def global_args(
qphist: Func = None,
vsync: Func = None,
extra_options: dict[str, Any] = None,
**kwargs: Any,
) -> GlobalStream:
"""
Set global options.
Expand Down Expand Up @@ -116,7 +115,6 @@ def global_args(
qphist: deprecated, does nothing
vsync: set video sync method globally; deprecated, use -fps_mode
extra_options: Additional options
**kwargs: Additional options
Returns:
GlobalStream: GlobalStream instance
Expand Down Expand Up @@ -176,6 +174,5 @@ def global_args(
if v is not None
}
| (extra_options or {})
| kwargs
),
).stream()
4 changes: 1 addition & 3 deletions src/ffmpeg/dag/io/_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def input(
dn: Boolean = None,
top: Int = None,
extra_options: dict[str, Any] = None,
**kwargs: Any
) -> AVStream:
"""
Input file URL (ffmpeg ``-i`` option)
Expand Down Expand Up @@ -125,7 +124,6 @@ def input(
dn: disable data
top: deprecated, use the setfield video filter
extra_options: ffmpeg's input file options
**kwargs: ffmpeg's input file options
Returns:
Input stream
Expand Down Expand Up @@ -196,4 +194,4 @@ def input(
if v is not None
}

return InputNode(filename=str(filename), kwargs=tuple((options | (extra_options or {}) | kwargs).items())).stream()
return InputNode(filename=str(filename), kwargs=tuple((options | (extra_options or {})).items())).stream()
4 changes: 1 addition & 3 deletions src/ffmpeg/dag/io/_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def output(
dn: Boolean = None,
top: Int = None,
extra_options: dict[str, Any] = None,
**kwargs: Any
) -> OutputStream:
"""
Output file URL
Expand Down Expand Up @@ -210,7 +209,6 @@ def output(
dn: disable data
top: deprecated, use the setfield video filter
extra_options: the arguments for the output
**kwargs: the arguments for the output
Returns:
the output stream
Expand Down Expand Up @@ -318,5 +316,5 @@ def output(
}

return OutputNode(
inputs=streams, filename=str(filename), kwargs=tuple((options | (extra_options or {}) | kwargs).items())
inputs=streams, filename=str(filename), kwargs=tuple((options | (extra_options or {})).items())
).stream()
4 changes: 1 addition & 3 deletions src/ffmpeg/dag/io/output_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ def output(
dn: Boolean = None,
top: Int = None,
extra_options: dict[str, Any] = None,
**kwargs: Any,
) -> OutputStream:
"""
Output file URL
Expand Down Expand Up @@ -219,7 +218,6 @@ def output(
dn: disable data
top: deprecated, use the setfield video filter
extra_options: the arguments for the output
**kwargs: the arguments for the output
Returns:
the output stream
Expand Down Expand Up @@ -326,4 +324,4 @@ def output(
if v is not None
}

return self._output_node(*streams, filename=filename, **options, **(extra_options or {}), **kwargs).stream()
return self._output_node(*streams, filename=filename, **options, **(extra_options or {})).stream()
5 changes: 4 additions & 1 deletion src/ffmpeg/dag/tests/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
id="filter-node",
),
pytest.param(
input(filename="tmp.mp4").output(filename="temp").global_args(y=True, no=False, speed=1).node,
input(filename="tmp.mp4")
.output(filename="temp")
.global_args(y=True, extra_options={"no": False, "speed": 1})
.node,
GlobalNode,
id="global-node",
),
Expand Down
Loading

0 comments on commit f2a669e

Please sign in to comment.