[FFmpeg-devel] Two problems with MPEG2 decoder

Michael Niedermayer michaelni at gmx.at
Tue Feb 26 19:40:23 CET 2013


On Tue, Feb 26, 2013 at 02:16:34PM +0000, Joseph Artsimovich wrote:
> Hi,
> 
> I uploaded a sample here: http://rghost.net/44123751
> It's XDCAM HD 422 (a variant of MPEG2) in a .mov container. It was
> cut from a larger file we received from a client. I don't know which
> software generated it (the vendor fourcc in the original is filled
> with zeros), but it's something from broadcasting environment.
> 
> The file plays fine in Apple's QuickTime player using a demo version
> of CalibratedQ XD Decode plugin.
> FFMpeg on the other hand has 2 issues with it:
> 
> 1. Artifacts in the bottom area and errors on the console:
> [mpeg2video @ 0x1e55140] end mismatch left=299 60E2
> [mpeg2video @ 0x1e55140] Warning MVs not available
> I can get rid of both artifacts and errors if I force the value of
> is_d10 variable to 1 in mpeg_decode_slice() in mpeg12.c
> That's obviously a hack, as this format is not D10.

fixed
the is_d10 variable could be renamed now though ...


> 
> 2. One of the frames fails to decode.
> The frame in question is frame 16 (counting from 0, ignoring the
> edit list and 2 initial B-frames that can't be decoded as the stream
> is open GOP).
> If you use ffmpeg to convert the file to another format:
> ffmpeg -i segment.mov -an -vcodec qtrle out.mov
> You'll get a duplicated frame in positions 16 and 17.
> Now, it turns out the frame that fails to decode has a redundant
> (and probably invalid) second picture header in MPEG2 stream. That
> is, the frame is encoded as a single picture, yet it has 2 picture
> headers. If I modify the code to ignore the second picture header,
> like this:
>         case PICTURE_START_CODE:
> +            if (picture_start_code_seen) {
> +               break;
> +            } else {
> +               picture_start_code_seen = 1;
> +            }
> [in decode_chunks() in mpeg12.c; variable initialization not shown]
> Then the frame in question decodes fine.
> The code above is again just a hack, as a frame can be encoded with
> more than one pictures.

is it just one frame in the video or does the original full video
have more with this issue ?


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130226/81d0c2ae/attachment.asc>


More information about the ffmpeg-devel mailing list