[vdr] how to convert vdr to divx?
Craig Sanders
cas at taz.net.au
Thu Mar 24 00:03:56 CET 2005
On Wed, Mar 23, 2005 at 10:17:18PM +0100, Gr?goire Favre wrote:
> it's probably not a great idea to do the conversion in only one pass if
> you want to keep a good quality...
yep, that's my next step...to make it do a good quality two-pass transcoding.
even with the default settings as in the script, the quality is reasonable.
artifacts are only really noticable in graphics and lettering on signs etc.
> You could for example have a look at :
>
> http://magma.epfl.ch/greg/scripts/MENCODER
thanks.
modifying my script to use the same two-pass technique, results in:
note: untested, but if the original (yours?) works, this should work the same.
---cut here---
#! /bin/bash
# vdr2dix.sh [dir]
#
# e.g. vdr2divx.sh /video/FooBar/2005-03-22.23.59.99.99.rec
# will convert to divx & save as /video/DIVX/FooBar.2005.03.22.avi
# user-tweakable constants
OUTDIR='/video/DIVX'
TMPDIR='/video/tmp'
VBR=1000
# i don't use scaling, so don't have useful values for $C and $S
# uncomment and provide good values if you want to scale.
#C=""
#S=""
#SCALE="-vf crop=$C,scale=$S -sws 2"
AUDIO="-oac copy"
VIDEO="-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=$VBR:trell:mv0:mbd=2:v4mv:qprd:cmp=10:subcmp=10:mbcmp=10:predia=2:dia=2"
PASS1="$SCALE $AUDIO $VIDEO:vpass=1:turbo"
PASS2="$SCALE $AUDIO $VIDEO:vpass=2:turbo"
# arg processing
IN="$1"
show=$(echo "$IN" | sed -e 's=/video/==' -e 's=/.*==')
date=$(echo "$IN" | sed -e 's=.*\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\).*=\1=')
OUT="$OUTDIR/$show.$date.avi"
#echo $IN "===>" $OUT
cd $TMPDIR
for f in vdrsync1.mpg frameno.avi divx2pass.log ; do
[ -e $f ] && rm -f $f
done
vdrsync.pl $IN -mpeg2 -o $TMPDIR/
mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts cbr:br=96 $TMPDIR/vdrsync1.mpg
mencoder $PASS1 -o /dev/null $TMPDIR/vdrsync1.mpg
mencoder $PASS2 -o $OUT $TMPDIR/vdrsync1.mpg
rm -f frameno.avi divx2pass.log vdrsync1.mpg
---cut here---
(does "br=96" in lameopts give reasonable sound quality?)
next on the TODO list:
- make one-pass or two-pass selectable from command line, e.g. "-1" or "-2"
(probably default to 2 pass)
- allow overide of output filename
(default to filename derived by sed)
usage would then be:
vdr2divx.sh [-1|-2] [-o filename] <dir>
> BUT, I have learn something about sed with your script, thank you for
> it !!!
sed's a useful tool...but a bit "clumsier" to use than perl. i tend to
use sh + sed + awk etc for small, simple scripts and for wrapper scripts
that mostly call other programs to do the work, and perl for anything
more complex.
craig
--
craig sanders <cas at taz.net.au> (part time cyborg)
More information about the vdr
mailing list