4 echo "Usage: [vcodec=s] [vbitrate=n] [vscale=s] [acodec=s] [abitrate=n] [ascale=s] [pass=n] $0 input.avi [-transcode_options]"
8 if [ -z "$vcodec" ]; then
14 if [ -z "$vbitrate" ]; then
20 if [ -n "$vscale" ]; then
24 if [ -z "$acodec" ]; then
30 if [ -z "$abitrate" ]; then
36 if [ -n "$ascale" ]; then
40 if [ "$vcodec" = ffmpeg ]; then
43 elif [ "$vcodec" = h264 ]; then
46 elif [ "$vcodec" = xvid ]; then
49 elif [ "$vcodec" = copy ]; then
53 echo "Unknown video codec $vcodec; known codecs are ffmpeg, h264, xvid, copy" >&2
57 if [ "$acodec" = mp3 ]; then
59 elif [ "$acodec" = copy ]; then
62 echo "Unknown audio codec $acodec; known codecs are mp3 and copy" >&2
66 if [ -z "$pass" ]; then
75 if [ "$pass" -eq 1 ]; then
76 exec transcode -i "$input" -y $tc_vcodec $vopts -u 50 -w "$vbitrate" -b "$abitrate" $vscale $ascale -o output.avi "$@"
78 elif [ "$pass" -eq 2 ]; then
80 transcode -i "$input" -y $tc_vcodec,null $vopts -u 50 -w "$vbitrate" -b "$abitrate" -R1 -x auto,null $vscale -o /dev/null "$@" &&
81 exec transcode -i "$input" -y $tc_vcodec $vopts -u 50 -w "$vbitrate" -b "$abitrate" -R2 $vscale $ascale -o output.avi "$@"
84 echo "Can only do 1 or 2 pass." >&2