[MPlayer-users] [BUG] mplayer/mencoder loses the last frame of xvid streams (was [BUG] movie-aspect autodetection failes...)

lists at eastcheap.org lists at eastcheap.org
Sat Mar 3 00:28:40 CET 2007


On Fri, 2 Mar 2007, Ajax wrote:

> On 3/2/07, lists at eastcheap.org <lists at eastcheap.org> wrote:

>> vd_xvid4.c has exactly the same problem.  I patched it to only
>> conditionally alter sh->aspect and am now enjoying xvid content at the
>> proper aspect ratio as well (without ffmpeg's dropped frames).
>
> W00t! Should as well patch vd_xvid4.c then, and I think of posting the
> whole thing into Bugzilla, since our beloved developers seem to
> respond faster this way :)

You should probably forget about the "dropped frames" comment.  I thought 
I had evidence that ffmpeg was losing xvid frames right and left, but for 
the life of me I can't reproduce it.  Either something changed with ffmpeg 
or I was doing something wrong, most likely the latter.

HOWEVER

What I have found is that mplayer/mencoder consistently loses (not being 
flushed?) the last frame from an xvid 1.1.2 encoded stream, regardless of 
the decoder used.  Granted it doesn't sound like much, but when you're 
editing this kind of thing can drive you nuts (it very nearly did me...all 
I knew was that I was mysteriously one frame short).

For testing, I used a 500-frame numbered frameset generated as follows:

     I created "background.png," a 320x240 image consisting solely of a
     flat (no alpha) white background and annotated it with:

         #! /bin/sh

         # Change this to "convert" to use ImageMagick instead of
         # GraphicsMagick

         CONVERT="gm convert"

         frameno=1

         while [ $frameno -le 500 ]
         do
             fnotext=`printf '%03d' $frameno`
             echo -n $fnotext
             $CONVERT -pointsize 36 -font Helvetica \
               -draw "text 70,120 \"Frame $fnotext\"" \
               background.png frame_${fnotext}.png
             frameno=$[$frameno + 1]
             echo " done"
         done

         exit 0

     I then encoded the frames in the usual ways:

         mencoder -ovc xvid -xvidencopts bitrate=200 -o test.avi \
           mf://frame_*.png

     etc.

What I found was that frame 500 is consistently being lost when the 
stream is decoded.  I.e.:

     mplayer test.avi -vo jpeg -noframedrop -benchmark test.avi
       or
     mplayer test.avi -vc xvid -vo jpeg -noframedrop -benchmark test.avi

results in 499 frames (1-499).  Likewise with mencoder.  (Quick test: 
encode with -ovc raw and -of rawvideo and count the bytes.  500 320x240 
YV12 frames should be 57600000 bytes total.)

I just tried again with mplayer r22408 with the same results.

At first I thought it was an xvid problem, but ffmpeg2theora (built 
against the same ffmpeg revision as mplayer) doesn't seem to have this 
problem.  I haven't tried transcode yet.

If someone else can reproduce this, I'd like to hear about it.



More information about the MPlayer-users mailing list