Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55883 - media-video/mplayer mencoder -ovc copy -oac mp3lame skipping frames
Summary: media-video/mplayer mencoder -ovc copy -oac mp3lame skipping frames
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Media-video project
Depends on:
Reported: 2004-07-02 07:42 UTC by Honza
Modified: 2006-05-01 11:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Honza 2004-07-02 07:42:12 UTC
mencoder (media-video/mplayer-1.0_pre4) have some code for maintain A/V sync or something, which can skips frames. It's nessesary for video files with irregular frame length, but I see no reason for this for avi.
Yet, on most recoding it skips two frames near the beginning of avi file.
Problem is, with -ovc copy this result in broken avi in (usual) case any other frame depend on skipped frame. This error can crash sensitive decoders and if it's not in black screen it's clearly visible (luckily in many cases it is in black screen).

Without -ovc copy, missing frame is usually not noticable.
With -ovc copy -oac copy, no skipping frame is present.
With -oac lavc -lavcopts acodec!=mp3 or -oac pcm, another frames is skipped.
(Maybee some audio codec don't skip frames ?)

Reproducible: Always
Steps to Reproduce:
1. mencoder something.avi -ovc copy -oac copy -o result.avi
2. notice "skipping frame" message
3. play result.avi

Actual Results:  
Writing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp
Pos:   0.9s     22f ( 0%)   0fps Trem:   0min   0mb  A-V:0.084 [0:169]
Skipping frame!
Pos:   1.6s     40f ( 0%)   0fps Trem:   4min 177mb  A-V:0.080 [904:172]]
Skipping frame!
Pos:  87.2s   2182f (10%) 110fps Trem:   2min 180mb  A-V:0.045 [1670:194]

Expected Results:  
Writing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp
Pos:  87.2s   2182f (10%) 110fps Trem:   2min 180mb  A-V:0.045 [1670:194]

Portage 2.0.50-r8 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.4.26)
System uname: 2.4.26 i686 AMD Duron(tm) Processor
Gentoo Base System version 1.4.16
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
CFLAGS="-O2 -mcpu=athlon -march=i686 -fomit-frame-pointer -pipe"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=athlon -march=i686 -fomit-frame-pointer -pipe"
FEATURES="autoaddcvs ccache distcc sandbox"
USE="3dnow X Xaw3d aalib apache2 apm arts avi berkdb caps cdr crypt cups curl
dga doc dvd encode esd flac foomaticdb gd gdbm gif gpm gtk gtk2 imagemagick
imlib innodb ipv6 java jpeg lcms lesstif libg++ libwww mad mbox mcal memlimit
mikmod mmx mng motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam
pdflib perl png python qt quicktime readline samba sdl slang snmp spell sqlite
sse ssl svga tcltk tcpd tetex theora tiff truetype unicode usb vhosts videos wmf
x86 xml xml2 xmms xosd xv zlib"
Comment 1 Honza 2004-09-02 12:08:40 UTC
Someone told me that "-mc 0" can help in this cases. I didn't test it yet ... and I still think this can be only workaround, not repair.
Comment 2 Chris White (RETIRED) gentoo-dev 2005-03-28 21:20:08 UTC
*bump* latest mplayer fixes this?
Comment 3 Honza 2005-03-29 06:58:43 UTC
Which one ? mplayer-1.0_pre5-r5 still has that problem.
Comment 4 Jan Brinkmann (RETIRED) gentoo-dev 2005-05-12 13:18:09 UTC
what about one of the newer versions?
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-07-14 04:13:48 UTC
Please try with pre7. 
Comment 6 Honza 2005-07-14 12:18:39 UTC
Problem is still present with media-video/mplayer-1.0_pre7.

Note: I just noticed I made mistake in bug report. First step to reproduce is
1. mencoder something.avi -ovc copy -oac mp3lame -o result.avi

(or mencoder something.avi -ovc copy -oac lavc -lavcopts acodec=mp3, but it skip
different frame(s) in -pre7. Also it seems it skips less frames.)

Sorry to all who didn't get it from sentence "With -oac lavc -lavcopts
acodec!=mp3 or -oac pcm, another frames is skipped."
Comment 7 Honza 2005-10-03 17:16:33 UTC
Note: just noticed three skipped frames after command 'mencoder *801* -o
8xx-Znelka.avi -ss 1:03 -endpos 0:1:0 -oac copy -ovc copy'. It also was visible
in video (skipped frame referenced from later frame problem). -mc 0 workaround
worked.<BR>mplayer-1.0_pre7-r1 (1.0pre7try2-3.3.2)
Comment 8 David Morgan 2006-04-27 05:05:44 UTC
No activity on this for ~6 months - does it still happen with 1.0.20060415?

Can anyone even reproduce this? It works fine here.
Comment 9 Honza 2006-04-27 14:01:53 UTC
Yes, it still happens. On first video I tried one missing frame. Or, more reproducible: download (it's free trailer), then mencoder -ovc copy -oac mp3lame -o ice_age.avi. Two skipped frames.
Comment 10 David Morgan 2006-04-28 15:25:07 UTC
Ok, I can reproduce this now.

You can use -noskip -mc 0, to stop this happening - does that get rid of the crashing with certain decoders that you reported?

Apart from that, I think this is more of an upstream issue (I'm only a lowly arch tester, though).
Comment 11 Honza 2006-04-29 01:19:28 UTC
After almost two years I don't remember what sensitive decoders I was talking about (I suppose it was something on windows). But I reported the crashing and visibility of error only to prove skipping frames with -ovc copy is bug (also, theoretically, if only frames just before I-frames will be skipped, it won't be bug, but I think -ovc copy don't have access to information about what frames are I-frames). There's no reason while decoders should crash if no frames is skipped.

While -noskip don't work, I already reported -mc 0 is usable workaround.

It probably is upstream issue. But I still don't lost belief that peoples from gentoo bugzilla have contact with developers and even if they don't, we can at least track the bug (and workarounds) here for peoples searching for it.
Comment 12 Luca Barbato gentoo-dev 2006-04-29 08:34:47 UTC
I'm sorry about that, hopefully the problem will be mitigated in the future once the support for this kind of files improves.

I'm marking it as REMIND
Comment 13 Reimar Döffinger 2006-04-30 12:33:28 UTC
Due to the way -ovc copy works, I don't think there is a way to properly fix this.
You should use -mc 0 -noskip (I think using only -mc 0 can lead to A-V desync in some cases).
(Yes, of course it would be possible to make -ovc copy imply these options, but that would reduce functionality e.g. for raw streams or all-keyframes streams, thus I think the "workaround" is the right solution).
Comment 14 Honza 2006-05-01 11:20:57 UTC
I was thinking there is in fact some bug in A-V sync code, because recoded video should be already synced (of course, there might be bug in A-V sync of program used to create it). Or something as using algorithm which is correct in most cases instead of optimal algorithm, and it doesn't work on begin of stream ... And this bug is only product of this hidden bug.

And there is still that posibility with deleting frames just before keyframes or something like that.

But yes, with -mc 0 workaround this bug is not so severe.

Also, maybee this should be mentioned in documentation ...