[MEncoder-users] Mpeg duration too short

Peter B. pb at das-werkstatt.com
Tue Jan 10 17:54:00 CET 2012


Hello,

I'm using mencoder to generate DVD-conform MPEGs from lossless  
FFv1/pcm_16sle AVI files. While doing so, I've realized that in 9/10  
of all cases, the resulting mpegs are too short.

Sometimes just a few frames, but often a few seconds - and once even 7  
minutes!

== Example and infos about reproducing the error:

1) Original lossless video - duration=1500 frames:
http://download.das-werkstatt.com/pb/mthk/examples/mencoder_mpeg/vx-04690_01-026s.avi

2) Resulting MPEG - duration=1475 frames:
http://download.das-werkstatt.com/pb/mthk/examples/mencoder_mpeg/vx-04690_01-026s.mpg

3) Command line and uncut output of encoding:
http://pastebin.com/JcRCQy5y

4) FFprobe output to see the duration:
Original: http://pastebin.com/49VU3hmb
MPEG: http://pastebin.com/ekkqLP1K


== Additional information:
The resulting MPEGs are very often too short, but not always. It seems  
to be depending on the material within the video - and even the audio  
(!). In one case, I've removed the audio stream from the original  
lossless AVI and the resulting MPEG then had the full duration.

Another thing I've noticed is, that the number of missing frames at  
the end somehow correlates with the keyframe-interval (keyint) used.
In this case, the MPEG was encoded with keyint=25. Exactly the number  
of missing frames at the end.

It seems that the missing frames are only dropped at the end of the  
video - not in between. I've verified that.


I'd be very very happy for any information about why this happens -  
and how to resolve this, as I'd need the MPEG to match the original  
duration frame-exact.

Thank you very much,
Peter B.









More information about the MEncoder-users mailing list