mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-04-06 04:15:44 +08:00
Merge 3d88c9151dc409f95d58d3acb89f5849fb5692df into 697808d7434ad9fd5188854c0a65c9cbb2cd4217
This commit is contained in:
commit
79022f8f98
@ -109,7 +109,7 @@ def _get_output_args(node, stream_name_map):
|
|||||||
|
|
||||||
|
|
||||||
@output_operator()
|
@output_operator()
|
||||||
def get_args(stream_spec, overwrite_output=False):
|
def get_args(stream_spec, overwrite_output=True):
|
||||||
"""Get command-line arguments for ffmpeg."""
|
"""Get command-line arguments for ffmpeg."""
|
||||||
nodes = get_stream_spec_nodes(stream_spec)
|
nodes = get_stream_spec_nodes(stream_spec)
|
||||||
args = []
|
args = []
|
||||||
@ -126,8 +126,14 @@ def get_args(stream_spec, overwrite_output=False):
|
|||||||
args += ['-filter_complex', filter_arg]
|
args += ['-filter_complex', filter_arg]
|
||||||
args += reduce(operator.add, [_get_output_args(node, stream_name_map) for node in output_nodes])
|
args += reduce(operator.add, [_get_output_args(node, stream_name_map) for node in output_nodes])
|
||||||
args += reduce(operator.add, [_get_global_args(node) for node in global_nodes], [])
|
args += reduce(operator.add, [_get_global_args(node) for node in global_nodes], [])
|
||||||
if overwrite_output:
|
|
||||||
|
if bool(overwrite_output) is True:
|
||||||
args += ['-y']
|
args += ['-y']
|
||||||
|
# bool(None) evaluates to False, skip it earlier
|
||||||
|
elif overwrite_output is None:
|
||||||
|
pass
|
||||||
|
elif bool(overwrite_output) is False:
|
||||||
|
args += ['-n']
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user