[Libav-user] MPEG2 decoding pixelation problem (but not in ffplay)

Michael Goffioul michael.goffioul at gmail.com
Sun Jun 4 06:12:33 EEST 2017


Hi,

I'm trying to use ffmpeg to decode a MPEG2 stream and I'm running into
pixelation problem with some streams (not all of them). The fact is that
the problematic streams play fine in ffplay (or vlc), so I figured the
problem must be in the way I setup the decoder or feed data to it.

I've written a very simple code to illustrate the problem I'm having, it's
available here:
https://drive.google.com/open?id=0BwljeX6541LuTjlLRmN2bG52M3M

It doesn't do anything fancy: just initialize the mpeg2video codec, feed
the data (segmented on the picture start code boundary), drain frames,
convert to RGB and save as PNG. It accepts 2 arguments: the elementary
MPEG2 stream filename and the number of frames to extract.

I'm using this sample clip as test case, it's the elementary video stream
extracted from a MPEG/TS clip (next link):
https://drive.google.com/open?id=0BwljeX6541LuUFFHSElwaUFGYkE
https://drive.google.com/open?id=0BwljeX6541LuamdieXZzamNkNFE

The pixelation problem is illustrated in this extracted frame:
https://drive.google.com/open?id=0BwljeX6541LubmhkS2VWekc5S00

By comparison, playing the sample clip (elementary stream) with ffplay
gives this:
https://drive.google.com/open?id=0BwljeX6541LuQ0hHQmVZMlAxMmc

Clearly I must be doing something wrong. Does anybody have a hint or
suggestion?

Thanks,
Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170603/fe7ce898/attachment.html>


More information about the Libav-user mailing list