Skip to content
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

"do not overwrite" option #140

Open
veikk0 opened this issue Apr 22, 2023 · 2 comments
Open

"do not overwrite" option #140

veikk0 opened this issue Apr 22, 2023 · 2 comments

Comments

@veikk0
Copy link

veikk0 commented Apr 22, 2023

I often use ab-av1 auto-encode to process sets of short video files using a for loop. However, sometimes I'd like to stop the loop before it finishes and resume it later. If ab-av1 is in sampling mode when quitting the loop, this could easily be done with --enc n, which tells FFmpeg to not overwrite the output file. And even when stopping a final encoding process, I could continue by restarting the loop, as long as I remember to delete the incomplete output file prior.

However, ab-av1 currently disallows the use of the ffmpeg -n switch and it seems that -y is used at all times, with the result that output files are always overwritten.

@alexheretic
Copy link
Owner

alexheretic commented Apr 22, 2023

Yep we simply overwrite currently.

I think it would be best to control this with ab-av1 args rather than inner ffmpeg.

For explicitly named output i think overwriting is a reasonable behaviour. For auto-named outputs not as much. Perhaps they should be auto named to avoid overwrites e.g. appending a number of necessary. Ideally I'd like to avoid interactive prompts, like ffmpeg defaults to.

We could add an option --no-overwrite-output (or similar) that would check if the output file already exists and exit early with a distinct code if so.

I wonder how useful this is though. In your loop you'll perhaps need to check this exit code to distinguish from other errors. It may end up easier just checking if the output already exists in your script before calling ab-av1.

So maybe we should return success 0 code? That could make sense of the option was named something like --skip-if-output-exists.

Any preferences?

@veikk0
Copy link
Author

veikk0 commented Apr 25, 2023

Mine isn't a very elaborate use case. It's just a basic Bash loop written directly in the terminal, not even a script. So I don't really have preferences for return codes or such.

If the default behavior is going to be overwriting, then --no-overwrite-output would be a reasonable name.

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

No branches or pull requests

2 participants