[MEncoder-users] Bad calculation of start frame position

TAJTHY Tamás tajthy at mailbox.hu
Thu Feb 28 00:20:48 CET 2008


Dear List,

I have a strange problem. I have captured a film by VirtualDub (25fps,
video:ffmjpeg, audio:mp3). I tried to cut the film into chunks. I detected the
first and last frames of the film parts in the captured file by VirtualDub. But
if I do the encoding by mencoder some frames added at the end of the parts and
sometimes at the beginning also. 

I did some tests:

/usr/local/mplayer/mencoder.exe -oac copy -ovc copy -o x1.avi -ss  47.840 -endpos
 4.840 input.avi
/usr/local/mplayer/mencoder.exe -oac copy -ovc copy -o x2.avi -ss 1:13:34.560
-endpos 11.480 input.avi
/usr/local/mplayer/mencoder.exe -oac copy -ovc copy -o x3.avi -ss 2:33:14.520
-endpos  4.400 input.avi

The result: 
* x1.avi starts correcty, but 2 frames added at the end
* x2.avi starts correcty, but 4 frames added at the end
* x3.avi starts 1 frame before and 1 frame added at the end

I checked the output of mencoder. In the fisrt case 2 frames were skipped, in
second case 4 frames were skipped and in the last case 2 frames were skipped. But
this work properly if I use -frames instead of -endpos.

But I can not solve that situation if one frame is added to the beggining of the
part. I tried to reduce the start pos (-ss) by one frame. I expexted the one
frame from the previous scene would be added to the cut part.

The result: x1.avi: 2 frames were added, x2: 1 frame, x2: still 1 frame ( I
expected 2).

Hmmm... I started to think this is some rounding problem. So I added 1 ms to the
start position. This solved the problem!

So I went back to the original problem. I added 1 ms to the start position and I
substracted 40 ms from the length and the cuts become exact!

Could anybody explain why mencoder starts the coding 1 frame before if the start
position is in the end region of a 2 hour film (the file size is almos 13 GB)?
Could it be a bug?

Thanks in advance!
_____________________________________________________________A legnagyobb TORRENT kereső napi 25000 új letöltés - www.warez.hu


More information about the MEncoder-users mailing list