I know that you can automatically overwrite if output exist with .overwrite_output()
but what if you don't want to overwrite?
it is not possible to add overwrite_output=True for over write and overwrite_output=False for not.
If you call ffmpeg-python like this:
import ffmpeg
stream = ffmpeg.input('input.mp4')
stream = ffmpeg.output(stream, 'output.mp4')
ffmpeg.run(stream, overwrite_output=False)
You can provide the overwrite_output keyword when calling run or other 'output' methods.
Here is the option in the source code for the run method: https://github.com/kkroening/ffmpeg-python/blob/master/ffmpeg/_run.py#L297
Note that 'False' is already the default. If you simply do not specify it it will not overwrite it.
The other output_operators also have that keyword.
@153957
Note that 'False' is already the default. If you simply do not specify it it will not overwrite it.
I was not able to confirm this behavior. overwrite_output=False acts as if neither -y nor -n was specified, making it ask interactively and then error out when file exists, whereas one would expect overwrite_output=False to just _not overwrite_ the file.
Current behavior:
overwrite_output=False -> asks interactively, errors out when not overwritingoverwrite_output=True -> overwrites (-y)overwrite_output not specified -> same as overwrite_output=FalseExpected (intuitive) behavior:
overwrite_output=False -> does not overwrite (-n)overwrite_output=True -> overwrites (-y)overwrite_output not specified (perhaps the default should be overwrite_output=None) -> errors out when file exists
Most helpful comment
@153957
I was not able to confirm this behavior.
overwrite_output=Falseacts as if neither-ynor-nwas specified, making it ask interactively and then error out when file exists, whereas one would expectoverwrite_output=Falseto just _not overwrite_ the file.Current behavior:
overwrite_output=False-> asks interactively, errors out when not overwritingoverwrite_output=True-> overwrites (-y)overwrite_outputnot specified -> same asoverwrite_output=FalseExpected (intuitive) behavior:
overwrite_output=False-> does not overwrite (-n)overwrite_output=True-> overwrites (-y)overwrite_outputnot specified (perhaps the default should beoverwrite_output=None) -> errors out when file exists