]> git.rmz.io Git - dotfiles.git/blob - bin/ffmerge
nvim: add FPP copyright snippet
[dotfiles.git] / bin / ffmerge
1 #! /bin/bash
2
3 print_help() {
4 echo "Usage: $(basename $0) INPUT... -o OUTPUT"
5 echo " or: $(basename $0) INPUT... 3> OUTPUT"
6 echo "Merge INPUT(s) videos to single OUTPUT"
7 }
8
9 inputs=()
10 while [ "$#" -gt 0 ]; do
11 case $1 in
12 -h | --help)
13 print_help
14 exit 0
15 ;;
16 -o | --output)
17 if [ "$2" != ' ' ]
18 then
19 output=$2
20 else
21 echo "$(basename $0): No output file after '-o'" >&2
22 echo "Try '$(basename $0) --help' for more information." >&2
23 exit -1
24 fi
25 shift; shift
26 ;;
27 -i | --interactive)
28 interactive="true"
29 shift
30 ;;
31 *)
32 inputs=( "${inputs[@]}" "$1" )
33 shift
34 ;;
35 esac
36 done
37
38 while [ $interactive ]
39 do
40 echo $interactive
41 echo "$(basename $0): merging '${inputs[@]}' to '${output}'"
42 echo "Do you want to continue? [Y/n] "
43 read ans
44 case $ans in
45 n | no)
46 exit 1
47 ;;
48 y | yes | '')
49 echo "yes"
50 unset interactive
51 ;;
52 esac
53 done
54
55 if [ -n "$output" ]
56 then
57 mencoder -forceidx -ovc copy -oac copy "${inputs[@]}" -o "$output"
58 else
59 echo "$(basename $0): No output arguments" >&2
60 echo "Try '$(basename $0) --help' for more information." >&2
61 fi