#!/bin/sh def_seconds=5 def_aspect=2 help(){ cat < Options: -t n Number secnods per image ($def_seconds) -s n n=1 letterbox, n=2 crop ($def_aspect) END exit 1 } seconds=$def_seconds aspect=$def_aspect while getopts t:s:h name "$@" do case $name in t) seconds=$OPTARG ;; s) aspect=$OPTARG ;; *) help ;; esac done let shiftind=$OPTIND-1 shift $shiftind if test "$#" != "1" then help fi case $1 in *.jpg) ifilter=jpegtopnm input="$1" base=`echo $input | sed "s/\.jpg$//"` ;; *.png) ifilter=pngtopnm input="$1" base=`echo $input | sed "s/\.png$//"` ;; *) help ;; esac case $aspect in 1) yinfer=PAD ;; *) yinfer=CLIP ;; esac $ifilter $input | ppmtoy4m | y4mscaler -I sar=1:1 -O infer=${yinfer} -O infer=EXACT \ -O sar=1:1 -O size=1920x1088 -O chromass=420jpeg | yuvfps -v0 -ip -s 1:$seconds -r 30000:1001 | yuv2lav -I0 -b2048 -fa -o "$base".avi