Skip to content

automatically stop overwrite #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
armsby opened this issue Aug 14, 2019 · 2 comments · May be fixed by #871
Open

automatically stop overwrite #253

armsby opened this issue Aug 14, 2019 · 2 comments · May be fixed by #871

Comments

@armsby
Copy link

armsby commented Aug 14, 2019

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.

@153957
Copy link
Contributor

153957 commented Aug 18, 2019

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.

@JanPokorny
Copy link

JanPokorny commented Nov 25, 2020

@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 overwriting
  • overwrite_output=True -> overwrites (-y)
  • overwrite_output not specified -> same as overwrite_output=False

Expected (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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants