Updated for Ubuntu 22.04. Also fixed merge videos cmin check
[videoscripts/.git] / avi2divx
1 #!/bin/bash
2
3 MINBITRATE=6000
4 MAXBITRATE=8000
5
6 BITRATE="vbitrate=$MINBITRATE:vrc_maxrate=$MAXBITRATE:vrc_buf_size=1835:vrc_minrate=$MINBITRATE"
7 PASS1_OPTS="-mc 0 -oac mp3lame -lameopts cbr:cbr=196 -ffourcc XVID -fps 29.97 -ovc lavc "
8 PASS1_OPTS="$PASS1_OPTS -lavcopts vcodec=mpeg4:vhq:keyint=15:vpass=1:$BITRATE -vf pp=ci"
9 PASS2_OPTS="-mc 0 -oac mp3lame -lameopts cbr:cbr=196 -ffourcc XVID -fps 29.97 -ovc lavc "
10 PASS2_OPTS="$PASS2_OPTS -lavcopts vcodec=mpeg4:vhq:keyint=15:vpass=2:$BITRATE -vf pp=ci"
11
12 INFILE=$*
13 OUTFILE=`echo $* | sed 's/\.avi/\.divx.avi/g'`
14
15 date
16 echo "-> 1st pass: /usr/bin/mencoder $PASS1_OPTS -o \"$OUTFILE\" -idx \"$INFILE\""
17 /usr/bin/mencoder $PASS1_OPTS -o "$OUTFILE" -idx "$INFILE"
18 date
19 echo "-> 2nd pasS: /usr/bin/mencoder $PASS2_OPTS -o \"$OUTFILE\" -idx \"$INFILE\""
20 /usr/bin/mencoder $PASS2_OPTS -o "$OUTFILE" -idx "$INFILE"
21 date
22