#!/bin/sh # http://wjd.nu/notes/2012#mencoder-canon-mjpeg # $ mencoder -oac copy -ovc x264 -o ${input%.avi}-h264.avi $input # ... or, if you need it rotated clockwise: # $ mencoder -oac copy -ovc x264 -vf rotate=1 -o ${input%.avi}-h264.avi $input if test "$1" = -1 || test "$1" = -2 || test "$3" = -3; then opts="-vf rotate=`echo $1 | sed -e 's/-//'`" shift echo "Adding option: $opts" fi for input in "$@"; do output=`echo "$input" | sed -e 's/\.[^./]*$//'`-h264.avi echo echo $input '->' $output echo if test -f "$output"; then echo 'EXISTS ALREADY! Skipping...' echo else mencoder -oac copy -ovc x264 $opts -o "$output" "$input" fi done