Encoding bitrate calculation?
Hi all, It seems every OGM encoding i produce is always way under the target size i specify. AFAIK the calculation im using is correct. For example, i specify a total movie size of 1.4GB, i end up with a final OGM of 950Mb. Can anyone see a problem in the following? Thanks. AUDIO=`ls -l audio.ogg | awk '{printf $5}'` RBITRATE=$((($TARGET - $AUDIO)/$LENGTH/1028*8)) echo "BITRATE: $RBITRATE" #VIDEO PASS1 cat $VOBS | nice -+19 mencoder -o movie-p1.avi -nosound -oac copy -ovc lavc -lavcopts \ vcodec=mpeg4:vbitrate=$RBITRATE:trell:mbd=2:v4mv:vb_strategy=0:vlelim=0:vcelim=7:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4:vpass=1 \ -vop denoise3d,pp=lb/tn:64:128:256/dr/h1/v1,scale=$SCALEXY,crop=$CROPXY - #PASS2 cat $VOBS | nice -+19 mencoder -o movie-p2.avi -nosound -oac copy -ovc lavc -lavcopts \ vcodec=mpeg4:vbitrate=$RBITRATE:trell:mbd=2:v4mv:vb_strategy=0:vlelim=0:vcelim=7:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4:vpass=2 \ -vop denoise3d,pp=lb/tn:64:128:256/dr/h1/v1,scale=$SCALEXY,crop=$CROPXY -
On Fri, 16 Jan 2004 23:57:58 +1030 "Mark Williams (MWP)" <mwp@internode.on.net> wrote:
For example, i specify a total movie size of 1.4GB, i end up with a final OGM of 950Mb.
Can anyone see a problem in the following?
Thanks.
AUDIO=`ls -l audio.ogg | awk '{printf $5}'` RBITRATE=$((($TARGET - $AUDIO)/$LENGTH/1028*8))
That should be 1000*8 You may be getting some rounding errors, shell only does integer maths. You are using the size of the ogg file which includes the ogg container overhead, on the other hand you are making no allowance for the ogm overhead. You may not need all that bitrate, what does mplayer say the final file's bitrate is? Does it match the calculation? Martin
participants (2)
-
Mark Williams (MWP) -
Martin Collins