dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles # fast
git clone https://src.adamsgaard.dk/dotfiles.git # slow
Log | Files | Refs | README | LICENSE Back to index

ffmpeg-bounce (520B)


      1 #!/bin/sh
      2 
      3 die() {
      4 	printf '%s: error: %s\n' "${0%%*/}" "$1" >&2
      5 	exit 1
      6 }
      7 
      8 usage() {
      9 	printf '%s [-h] [-n repeats] file\n' "${0%%*/}"
     10 }
     11 
     12 n=5
     13 while :; do
     14 	case "$1" in
     15 		-h)
     16 			usage
     17 			exit 0;;
     18 		-n)
     19 			n="$2"
     20 			shift;;
     21 		-*)
     22 			usage
     23 			exit 1;;
     24 		*)
     25 			break;;
     26 	esac
     27 	shift
     28 done
     29 
     30 if test $# -lt 1 -o "$n" -lt 1; then
     31 	usage
     32 	exit 1
     33 fi
     34 
     35 n=$(( n - 1 ))
     36 for f in "$@"; do
     37 	ext="${f##*.}"
     38 	out="${f%.*}-bounce.${ext}"
     39 	ffmpeg -i "$f" -filter_complex "[0]reverse[r];[0][r]concat,loop=${n}:250,setpts=N/25/TB" "$out"
     40 done