[MEncoder-users] Skipped and duplicate frames

Peter pscientist at inbox.com
Wed Apr 1 17:32:28 CEST 2009


The Wanderer wrote:

> Of course not. Those options were not supposed to remove the messages;
> they were supposed to fix problems which might be there in spite of or
> as a side effect of those messages, and they can have negative side
> effects of their own.
> 
> The messages just mean "in order to maintain A/V sync, MEncoder had to
> duplicate or drop a frame". If you get rid of them without introducing
> some other way of maintaining that, audio and video will be out of sync.

Thank you for answering. The original video is in sync. I know I sound 
ungrateful, but I'm trying to reduce some digital camera videos (which are in a 
somewhat inefficient "MJPEG" format because it's simpler for the camera) for 
archiving; the original will be deleted. Therefore I can't accept any 
perceptible reduction in quality. Duplicating or skipping frames sounds like a 
reduction in quality.

> 
>> I tried "-nosound" just for the hell of it, and it killed MOST (but
>> not all) of them.
> 
> That's because, with no audio, there's no need to keep the video in sync
> with it.

Right. I guess I was trying to double check that the a/v sync was the cause of it.

> 
> Just offhand, my guess as to the reason for there being some such
> messages left would be that there is a difference in frame rate between
> the input and the output, and so frames have to be added or dropped in
> order to maintain the same effective playback rate at the new frame
> rate.

You are probably on to something there; my original is 30fps but apparently 
that's not a valid framerate for the coder. I put "-r 30000/1001" before my 
input file, and it cleared the error; because of this, I wouldn't be surprised 
to see one skipped or duplicated frame in 1000 - I could accept that. This is 
probably where the remaining one or two came from when I used "-nosound".

I tried FFmpeg with the "-vstats" option, and all I see is exact timestamps at 
30fps. At the end of the video, frame 1200 has time "40.000" and all frames in 
between seem perfectly timed. Unfortunately, there doesn't seem to be any 
-astats command; is there any way that I could check my input file for timestamp 
sanity? I looked at mencoder's "dumpstream" but that seems to dump the whole 
data, not just stats about it.

I can't find a windows binary for ffprobe, and I don't even know if it would help.

> 
>> I have switched to ffmpeg, because for some reason, it does not give
>> these errors.
> 
> This would be because either it uses a different method for maintaining
> A/V sync, or (more likely), it simply doesn't tell you every time it
> duplicates or drops a frame - in other words, it's still doing it, it's
> just not telling you about it. I don't see how this would be better, but
> if you prefer ffmpeg, that's certainly no skin off my nose...
> 

I don't prefer either; I just want a fairly simple way to compress this kind of 
movie file (ffmpeg output):

Input #0, avi, from 'S6301641.AVI':
   Duration: 00:01:20.14, start: 0.000000, bitrate: 4853 kb/s
     Stream #0.0: Video: mjpeg, yuvj422p, 640x480, 30.00 tb(r)
     Stream #0.1: Audio: pcm_s16le, 22050 Hz, mono, s16, 352 kb/s

into something smaller, for archive purposes. Encode time is not an issue, and 
it would be ideal if it were playable on my Philips DivX DVD player.

I believe my original files to be without errors or "issues" (unlike my HD 
camcorder which sometimes omits frames as it starts up) therefore, sadly I have 
to conclude that if mencoder claims to be fixing something, it's probably 
mistaken and could be breaking it...

Again, thank you for answering!

--
Peter




More information about the MEncoder-users mailing list