#!/bin/sh # (C) 2002 Marcello Barnaba set -x test "$#" -lt 2 && { echo "Usage: $0 "; exit 1; } bitrate=$1 shift files="$@" for file in $files; do name=`echo $file | sed 's#\(.*\)\.\(.*\)$#\1#'` ext=`echo $file | sed 's#\(.*\)\.\(.*\)$#\2#'` mencoder \ -oac copy \ -ovc lavc \ -lavcopts vcodec=mpeg4:vqscale=2:vhq:v4mv:vpass=1:vbitrate=$bitrate \ -o /dev/null \ "$file" mencoder \ -oac mp3lame \ -lameopts vbr=2:aq=0:q=4 \ -ovc lavc \ -lavcopts vcodec=mpeg4:vqscale=2:vhq:v4mv:vpass=2:vbitrate=$bitrate \ -o "${name}-2pass.$ext" \ "$file" done