[MPlayer-dev-eng] Help Wanted: MPEG Demuxer Parse_PSM corrputs video frames, caused by nicodvb's patch on 4/6/2005

Jeff Doozan mplayer at doozan.com
Thu May 18 16:53:55 CEST 2006


I've been noticing some corruption (garbled video frames) in videos that 
I'm transcoding from vob to avi.  I would estimate that this happens 
between 1 and 3 times per 90 minute video.  I've finally had a chance to 
track down the source and it seems to be the result of a patch applied 
by nicodvb to libmpdemux/demux_mpg.c on 4/6/2005.

His patch, revision 1.55, is stated to 'add support for other codecs 
(mpeg4/h264/aac) in mpeg-ps parsing the PSM'.  I don't understand enough 
about what his patch is doing to make any useful changes so I'm hoping 
to find someone more experienced with this code to help find a solution.

I've created a small patch that disables part of the parse_psm() 
function and restores mencoder to its previous behavior - this is only 
to demonstrate the effects of this bug, I have no idea what my patch is 
disabling.

To help others recreate the problems, I've prepared some sample files 
that anyone looking into this problem can use to reproduce what I'm 
experiencing.

I don't know who nicodvb is, and I can't find his email address, or else 
I would just email him directly.

Everything is compiled with gcc 4.0.4 on AMD64 from mplayer CVS and 
ffmpeg CVS snapshots from 5/17/2006.  In the example commands, I'm 
transcoding with lavc, but because the problems is in the mpg demuxer, 
the corruption is also apparent with xvid, h264 and others.

Commands run
============
mencoder-patched test.vob -o result-patched.avi -oac copy -ffourcc DIVX 
-ovc lavc -lavcopts vbitrate=1200

mencoder-unpatched test.vob -o result-unpatched.avi -oac copy -ffourcc 
DIVX -ovc lavc -lavcopts vbitrate=1200

Output files
============
http://mplayer.tcbmi.com/result-patched.avi  (1.6Mb expected output)
http://mplayer.tcbmi.com/result-unpatched.avi (1.6Mb corrupted output)

Input file
==========
http://mplayer.tcbmi.com/test.vob (6.5Mb)

Patch
=====

--- main/libmpdemux/demux_mpg.c.old     2006-05-18 09:48:28.000000000 -0400
+++ main/libmpdemux/demux_mpg.c 2006-05-18 09:48:45.000000000 -0400
@@ -50,7 +50,7 @@

    c = stream_read_char(demux->stream);
    if(! (c & 0x80)) {
-    stream_skip(demux->stream, len - 1);  //not yet valid, discard
+//    stream_skip(demux->stream, len - 1);  //not yet valid, discard
      return 0;
    }
    stream_skip(demux->stream, 1);



Thanks,

Jeff Doozan




More information about the MPlayer-dev-eng mailing list