[MPlayer-users] libavcodec bitrate problems (NOVIRUS NODAEMON challenge-response systems suck)

Matthew W. Miller mwmiller at columbus.rr.com
Wed Sep 24 19:25:50 CEST 2003


I checked out today's MPlayer snapshot (20030924) and as-close-to-today-
as-the-notoriously-flaky-Sourceforge-CVS-server-would-come ffmpeg
(newest file was 20th September 2003) and did some testing on the sample
that Angel put up, with a simplified version of the command line that
Angel used.

After making sure there is no frameno.avi or divx2pass.log lying around,
I do a simple one-pass encode to mpeg4, requesting 1500 kbit/s as
Angel's original command line did:

$ mencoder -nosound -noaspect -fps 29.97 -ofps 23.976 -vf \
crop=708:462:6:6,scale=640:352:0:0 -sws 2 -ovc lavc -lavcopts \
vcodec=mpeg4:vbitrate=1500 -of avi -o badboys.01.avi bad_boys_source.vob

And here are the results:

$ mplayer -ao null -vo null -frames 0 -identify badboys.01.avi 2>&1 | \
grep -s ^ID_ | grep -sv ^ID_FILENAME= | column
ID_VIDEO_FORMAT=DIVX    ID_VIDEO_HEIGHT=352     ID_LENGTH=60
ID_VIDEO_BITRATE=971528 ID_VIDEO_FPS=23.976
ID_VIDEO_WIDTH=640      ID_VIDEO_ASPECT=0.0000

Average bitrate 971528 bit/s.  (When mencoder finished it said 971.529
kbit/s.  Not a big difference, but it explains what I tried next...)

$ calc "1500000*1500/971529"
2315.937044

All right, let's try a second one-pass encode then.

$ mencoder -nosound -noaspect -fps 29.97 -ofps 23.976 -vf \
crop=708:462:6:6,scale=640:352:0:0 -sws 2 -ovc lavc -lavcopts \
vcodec=mpeg4:vbitrate=2315937 -of avi -o badboys.02.avi \
bad_boys_source.vob

And here are the results:

$ mplayer -ao null -vo null -frames 0 -identify badboys.02.avi 2>&1 | \
grep -s ^ID_ | grep -sv ^ID_FILENAME= | column
ID_VIDEO_FORMAT=DIVX    ID_VIDEO_HEIGHT=352     ID_LENGTH=60
ID_VIDEO_BITRATE=971528 ID_VIDEO_FPS=23.976
ID_VIDEO_WIDTH=640      ID_VIDEO_ASPECT=0.0000

Average bitrate... 971528 bit/s again?  That's not right...

$ ls -l badboys.01.avi badboys.02.avi
-rw-r--r--    1 mwmiller users     7376914 Sep 24 11:21 badboys.01.avi
-rw-r--r--    1 mwmiller users     7376914 Sep 24 12:50 badboys.02.avi
$ cksum badboys.01.avi badboys.02.avi
1604361277 7376914 badboys.01.avi
1604361277 7376914 badboys.02.avi
$ sha1sum badboys.01.avi badboys.02.avi
250a80036723bfb4e2eeea8d9fe64336b69b0bba  badboys.01.avi
250a80036723bfb4e2eeea8d9fe64336b69b0bba  badboys.02.avi
$ md5sum badboys.01.avi badboys.02.avi
9cc5aef0e55fbf829ba2fae5098f5360  badboys.01.avi
9cc5aef0e55fbf829ba2fae5098f5360  badboys.02.avi

For some reason libavcodec's ratecontrol is running at the exact same
bitrates and producing the exact same data no matter what bitrate is
requested in the command line.  Bizarre!  Does anyone have any ideas on 
about which revisions/snapshots this started happening?
-- 
Matthew W. Miller <mwmiller at columbus.rr.com>



More information about the MPlayer-users mailing list