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,
> =A0 =A0I am running freebsd 6.1/amd64. I sometimes download films and the=
y 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=3Dmpeg4 -vf scale=3D352:240 =
=2Doac
>
> lavc -lavcopts acodec=3Dmp3:abitrate=3D48 -o ggg.avi
>
> But sometimes the ggg.avi can still be a little larger than 700mB, is the=
re
> 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=20
general, the higher the quality settings chosen in 2 pass mode, the smaller=
=20
the file to some extent.  The other obvious things to try are reducing the=
=20
audio and/or video bitrates

#!/bin/sh
audio=3D"-oac lavc -lavcopts acodec=3Dmp3:abitrate=3D96"
#audio=3D"-oac copy"
# VERY HIGH QUALITY
#video=3D"-ovc lavc -lavcopts /=20
vcodec=3Dmpeg4:mbd=3D2:mv0:trell:v4mv:cbp:last_pred=3D3:predia=3D2:dia=3D2:=
vb_strategy=3D1:precmp=3D2:cmp=3D2:subcmp=3D2:preme=3D2:vme=3D5:naq:qns=3D2"
# HIGH QUALITY
video=3D"-ovc lavc -lavcopts /=20
vcodec=3Dmpeg4:mbd=3D2:trell:v4mv:last_pred=3D2:dia=3D-1:vb_strategy=3D1:cm=
p=3D3:subcmp=3D3:precmp=3D0:vqcomp=3D0.6"
# FAST
#video=3D"-ovc lavc -lavcopts vcodec=3Dmpeg4:mbd=3D2:trell:v4mv"
# VERY FAST
#video=3D"-ovc lavc -lavcopts vcodec=3Dmpeg4:mbd=3D2"
# DEFAULTS
#video=3D"-ovc lavc -lavcopts "
#filter=3D"-aspect 16:9 -vf scale=3D352:288"
bitrate=3D"vbitrate=3D750"
#start=3D"-ss 00:00:20"
#length=3D"-endpos 00:00:5"
srcdir=3D/home1/incoming/
dstdir=3D/home1/vids
find $srcdir -name "*.mpg" | sort |
while read i
do
  infile=3D"${i}"
  outfile=3D"${dstdir}/`basename "${infile}"`".avi
echo "*********************************************************************=
***
  echo "  Converting $infile"
  echo "          to $outfile"
  echo "  at bitrate ${bitrate}Kbps"
echo "*********************************************************************=
***
  for j in "turbo:vpass=3D1 -nosound" "vpass=3D2 ${audio}" ; do
    nice mencoder -noskip "${infile}" ${start} ${length} ${filter} ${video}=
: /=20
${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>