#! /bin/sh if [ -z "$8" ]; then echo "Usage: $0 input title aid1 bitrate1 scale1 aid2 bitrate2 scale2 [transcode options]" >&2 exit 1 fi input="$1" title="$2" aid1="$3" bitrate1="$4" scale1="$5" aid2="$6" bitrate2="$7" scale2="$8" shift 8 echo "INAM $title" | iconv -f koi8-r -t utf-8 >avi_comments.txt echo "ICMT Codec: FFmpeg (DivX5)" >>avi_comments.txt abitrate="$bitrate1" ascale="$scale1" tc_encode "$input" -a "$aid1" "$@" && tc_extract_a1_comments "$input" "$aid2" -b "$bitrate2" -s "$scale2" && mv output2.avi "$title".avi && exec rm avi_comments.txt divx4.log a"$aid2".mp3 output.avi