Skip to content

Commit

Permalink
fix #338 support nooption for input and output
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemia committed Jan 16, 2025
1 parent 997592b commit 12447d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"-accurate_seek",
"-display_rotation",
"1.0",
"-nodisplay_vflip",
"-i",
"input.mp4",
"output.mp4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"-c",
"copy",
"-shortest",
"-noforce_fps",
"-ar",
"44100",
"output.mp4"
Expand Down
7 changes: 4 additions & 3 deletions src/ffmpeg/dag/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ def get_args(self, context: DAGContext = None) -> list[str]:
if isinstance(value, bool):
if value is True:
commands += [f"-{key}"]
# NOTE: the -nooption is not supported
elif value is False:
commands += [f"-no{key}"]
else:
commands += [f"-{key}", str(value)]
commands += ["-i", self.filename]
Expand Down Expand Up @@ -398,7 +399,8 @@ def get_args(self, context: DAGContext = None) -> list[str]:
if isinstance(value, bool):
if value is True:
commands += [f"-{key}"]
# NOTE: the -nooption is not supported
elif value is False:
commands += [f"-no{key}"]
else:
commands += [f"-{key}", str(value)]
commands += [self.filename]
Expand Down Expand Up @@ -453,7 +455,6 @@ def get_args(self, context: DAGContext = None) -> list[str]:
commands += [f"-{key}"]
elif value is False:
commands += [f"-no{key}"]
# NOTE: the -no{key} format since not really for global options
else:
commands += [f"-{key}", str(value)]
return commands
Expand Down

0 comments on commit 12447d8

Please sign in to comment.