Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Aug 2006 23:45:21 +0100
From:      Dave <dave01@dgmm.net>
To:        freebsd-multimedia@freebsd.org
Subject:   Re: compress films
Message-ID:  <200608252345.22709.dave01@dgmm.net>
In-Reply-To: <f84c38580608250747ycf4a26ax752139f772587d32@mail.gmail.com>
References:  <f84c38580608250747ycf4a26ax752139f772587d32@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608252345.22709.dave01>