compress films

Dave dave01 at dgmm.net
Fri Aug 25 22:45:37 UTC 2006


On Friday 25 August 2006 15:47, Tsu-Fan Cheng wrote:
> Hi BSDers,
>    I am running freebsd 6.1/amd64. I sometimes download films and they are
> quite large, like 1.4GB or something. I want to make it smaller by using
>
> mencoder, the script I use is as such:
> >mencoder ddd.avi -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=352:240 -oac
>
> lavc -lavcopts acodec=mp3:abitrate=48 -o ggg.avi
>
> But sometimes the ggg.avi can still be a little larger than 700mB, is there
> any more optimization I can do, or use other app to do this better??
>
> many thanks!!

I'm using the examples from the mplayer/mencoder docs.  It seems that in 
general, the higher the quality settings chosen in 2 pass mode, the smaller 
the file to some extent.  The other obvious things to try are reducing the 
audio and/or video bitrates

#!/bin/sh
audio="-oac lavc -lavcopts acodec=mp3:abitrate=96"
#audio="-oac copy"
# VERY HIGH QUALITY
#video="-ovc lavc -lavcopts / 
vcodec=mpeg4:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:vme=5:naq:qns=2"
# HIGH QUALITY
video="-ovc lavc -lavcopts / 
vcodec=mpeg4:mbd=2:trell:v4mv:last_pred=2:dia=-1:vb_strategy=1:cmp=3:subcmp=3:precmp=0:vqcomp=0.6"
# FAST
#video="-ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:v4mv"
# VERY FAST
#video="-ovc lavc -lavcopts vcodec=mpeg4:mbd=2"
# DEFAULTS
#video="-ovc lavc -lavcopts "
#filter="-aspect 16:9 -vf scale=352:288"
bitrate="vbitrate=750"
#start="-ss 00:00:20"
#length="-endpos 00:00:5"
srcdir=/home1/incoming/
dstdir=/home1/vids
find $srcdir -name "*.mpg" | sort |
while read i
do
  infile="${i}"
  outfile="${dstdir}/`basename "${infile}"`".avi
echo "************************************************************************
  echo "  Converting $infile"
  echo "          to $outfile"
  echo "  at bitrate ${bitrate}Kbps"
echo "************************************************************************
  for j in "turbo:vpass=1 -nosound" "vpass=2 ${audio}" ; do
    nice mencoder -noskip "${infile}" ${start} ${length} ${filter} ${video}: / 
${bitrate}:${j} -ffourcc DX50 -of avi -o "${outfile}"
  done
  echo Finish `date` `basename "${infile}"` >> timestamp
  rm *.stats
  rm *.log
done
cat timestamp


More information about the freebsd-multimedia mailing list