[MEncoder-users] Last two frames missing

Mark Himsley mark at mdsh.com
Tue Jul 7 13:50:45 CEST 2009


On Mon, Jul 06, 2009 at 08:25:21PM -0400, Reuben Budiardja wrote:
> On Tuesday 23 June 2009 17:35:01 Mark Himsley wrote:
> > Hi mencoder experts.
> <snip>
> > If I play that file in mplayer and step through the last few frames the
> > last two frames are not displayed.
> >
> > I convert that file BACK to a DV25 MOV with this command:
> >
> > </SNIP>
> >
> > But the last two frames cannot be seen in mplayer or QuickTime.
> 
> Hello,
> 
> Mark, did you ever find a solution for this problem originally posted on the 
> mencoder-user mailing list ?

No, not completely.

I CAN get every frame if I encode with NO B-frames, that is - setting 
bframes=0 in your example. But that kind-of defeats the point of using 
h.264.

If I encode with bframes=3 but without b_pyramid then I only loose 
one frame off the end of my test clip, instead of two.


Interestingly, I get similar same results if I encode with ffmpeg into a .avi 
container except with one more frame, I mean bframes=3 with b_pyramid I loose
one frame and bframes=3 without b_pyramid I loose NO frames.


I need to make a full table to results and post it somewhere useful so that
people more clever than I can say "oh, I know how to fix that" ;-)



 
> I stumbled on this post from searching in Google. I believe I have the same 
> problem, from a slightly different situation: 
> 
> I have a number of PNG files which are visualization output of a computer 
> simulations. So I know exactly how many files there are, and that there are 
> visualization time stamped as part of the graphic in the file, which helps to 
> identify the frames.
> 
> I encode the files to H.264 using 2-pass encoding and put it into the mp4 
> container as follow (excuse the line wrapping):
> 
> mencoder -ovc x264 -oac copy -x264encopts \ 
> pass=1:turbo:bitrate=1000:bframes=1:me=umh:partitions=all \
> :trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \
> mf://*.png -of rawvideo -o /dev/null
> 
> mencoder -ovc x264 -oac copy -x264encopts \ 
> pass=2:turbo:bitrate=1000:frameref=5:bframes=1:me=umh:partitions=all \ 
> :trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \
> mf://${1} -of rawvideo -o output.264 
> 
> MP4Box -add output.264 output.mp4
> 
> I step through the frames and found that last two frames are missing. Even 
> with just 1-pass encoding, there are two frames that are missing. 
> 
> The output of those commands above says that I have the same number of frames 
> as there are PNG files, but the last two just do not make it into the movie.
> 
> This does not happen if I just encode it to MPEG-4, using the example in the 
> manual:
> mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc lavc \
>     -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi
> 
> Any help is appreciated
> 
> Thank you.
> RDB

-- 
Mark Himsley


More information about the MEncoder-users mailing list