[MEncoder-users] Many "1 duplicate frame(s)!" when capturing from TV

A. Schmid sahib at phreaker.net
Tue Apr 15 12:32:10 CEST 2008


> Hi. When I use mencoder to capture TV, I get a lot of "1 duplicate
> frame(s)!" and also "Skipping frame!" messages.
> 
> I have googled a bit, but I cannot understand why is mencoder finding
> so much "duplicate frames".

I had exactly the same problem since upgrading my Distro. But since I 
compile MPlayer from source, MPlayer stayed the same. So i figured out 
it must be a driver and/or configuration issue.

Mencoder skips or duplicates frames to maintain audio/video 
synchronization (it doesn't _find_ them, it _makes_ them!). I also tried 
-noskip. That worked, but resulted in A/V drift.
What seemed strange to me was that there were so much skips and 
duplicates _directly_ following each other. Clearly, this doesn't make 
any sense (if the fps from TV-input don't change, there should only be 
occasional skips _or_ occasional duplicates, but never both of them 
intermixed). Skips and dups following each other cancel themselves out - 
with a delay of just one frame. So all you get is a jerky Video!

 > Info: I live in Brasil. Here we use PAL-M, which means NTSC dimensions
 > and framerate with PAL color encoding.
 >
 > The relevant parts of my .mplayer/config :
 > tv=driver=v4l2:norm=PAL-M:chanlist=us-cable:alsa=yes:audiorate=32000

This looks like it has something to do with (audio) buffering. I could 
verify this by switching off the -tv alsa option: There were no more 
excessive skips/dups and no drift - but sound quality was just terrible.

After extensive experimenting I could solve the problem by setting the 
ALSA period_size from 1024 to 256. Now i only get 6 skips and 2 dups in 
3 minutes of TV-capturing. Also, they don't directly follow each other 
anymore (minimum 30 frames distance).

To set period_size, I used the ~/.asoundrc from 
http://wiki.ubuntuusers.de/.asoundrc
(I think I just concatenated the "Initialisierung", "Mixing" and the 
"OSS" listings). Then I changed period_size in the pcm.dsnooper section 
to 256.

Regards,
Alex







More information about the MEncoder-users mailing list