Skip to content

Commit

Permalink
ffmw#optimize: add -I option
Browse files Browse the repository at this point in the history
  • Loading branch information
XPhyro committed Jan 23, 2024
1 parent 23fd8ef commit 81b335b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/sh/soft-wrapper/ffmw
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ printhelp() {
Overwrite the output file if it exists.
-h, --help
Print help message.
-I, --ignore-outfile
Ignore TEMPOUTFILE if given in [INFILE]...
-i, --interactive
Prompt before overwriting the output file if it exists.
-M, --move-to-original
Expand Down Expand Up @@ -333,6 +335,7 @@ parseargs_optimize() {
b) backup="1";;
f) overwrite="-y";;
h) printhelp "optimize"; exit 0;;
I) ignoreoutfl="1";;
i) overwrite="";;
M) moveorig="1";;
n) overwrite="-n";;
Expand All @@ -351,6 +354,7 @@ parseargs_optimize() {
backup) backup="1";;
force) overwrite="-y";;
help) printhelp "optimize"; exit 0;;
ignore-outfile) ignoreoutfl="1";;
interactive) overwrite="";;
move-to-original) moveorig="1";;
no-clobber) overwrite="-n";;
Expand Down Expand Up @@ -913,8 +917,13 @@ optimize() {
exit 1
}
[ "$outfl" = "$fl" ] && {
printf 'INFILE and TEMPOUTFILE [%s] cannot be the same.\n' "$fl"
exit 1
if [ "$ignoreoutfl" = "1" ]; then
printf "Ignoring TEMPOUTFILE [%s] in INFILEs.\n" "$fl" >&2
continue
else
printf 'INFILE and TEMPOUTFILE [%s] cannot be the same.\n' "$fl"
exit 1
fi
}
[ "$norepeat" = "1" ] && {
ffprobe -hide_banner -v error -select_streams v:0 -show_entries stream_tags=encoder -of default=nokey=1:noprint_wrappers=1 -i "file:$fl" | grep -Exq 'Lavc[0-9.]+\s+libx265' && {
Expand Down

0 comments on commit 81b335b

Please sign in to comment.