X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/4b06eb26103a8f0840915532fdf411ef82e9ad24..89cf694280e02442fb435d5fe516ac09783d776a:/bin/ffmerge diff --git a/bin/ffmerge b/bin/ffmerge new file mode 100755 index 0000000..581d2ea --- /dev/null +++ b/bin/ffmerge @@ -0,0 +1,62 @@ +#! /bin/bash + +print_help() { +echo "Usage: $(basename $0) INPUT... -o OUTPUT" +echo " or: $(basename $0) INPUT... 3> OUTPUT" +echo "Merge INPUT(s) videos to single OUTPUT" +} + +inputs=() +while [ "$#" -gt 0 ]; do + case $1 in + -h | --help) + print_help + exit 0 + ;; + -o | --output) + if [ "$2" != ' ' ] + then + output=$2 + else + echo "$(basename $0): No output file after '-o'" >&2 + echo "Try '$(basename $0) --help' for more information." >&2 + exit -1 + fi + shift; shift + ;; + -i | --interactive) + interactive="true" + shift + ;; + *) + inputs=( "${inputs[@]}" "$1" ) + shift + ;; + esac +done + +while [ $interactive ] +do + echo $interactive + echo "$(basename $0): merging '${inputs[@]}' to '${output}'" + echo "Do you want to continue? [Y/n] " + read ans + case $ans in + n | no) + exit 1 + ;; + y | yes | '') + echo "yes" + unset interactive + ;; + esac +done + +if [ -n "$output" ] +then + mencoder -forceidx -ovc copy -oac copy "${inputs[@]}" -o "$output" +# mv "${inputs[@]}" /mnt/Skaro/ffmerge.backup/ +else + echo "$(basename $0): No output arguments" >&2 + echo "Try '$(basename $0) --help' for more information." >&2 +fi