<div dir="ltr">Hi,<div><br></div><div>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.</div><div><br></div><div>I've written a very simple code to illustrate the problem I'm having, it's available here:</div><div><a href="https://drive.google.com/open?id=0BwljeX6541LuTjlLRmN2bG52M3M">https://drive.google.com/open?id=0BwljeX6541LuTjlLRmN2bG52M3M</a><br></div><div><br></div><div>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.</div><div><br></div><div>I'm using this sample clip as test case, it's the elementary video stream extracted from a MPEG/TS clip (next link):</div><div><a href="https://drive.google.com/open?id=0BwljeX6541LuUFFHSElwaUFGYkE">https://drive.google.com/open?id=0BwljeX6541LuUFFHSElwaUFGYkE</a><br></div><div><a href="https://drive.google.com/open?id=0BwljeX6541LuamdieXZzamNkNFE">https://drive.google.com/open?id=0BwljeX6541LuamdieXZzamNkNFE</a><br></div><div><br></div><div>The pixelation problem is illustrated in this extracted frame:</div><div><a href="https://drive.google.com/open?id=0BwljeX6541LubmhkS2VWekc5S00">https://drive.google.com/open?id=0BwljeX6541LubmhkS2VWekc5S00</a><br></div><div><br></div><div>By comparison, playing the sample clip (elementary stream) with ffplay gives this:</div><div><a href="https://drive.google.com/open?id=0BwljeX6541LuQ0hHQmVZMlAxMmc">https://drive.google.com/open?id=0BwljeX6541LuQ0hHQmVZMlAxMmc</a><br></div><div><br></div><div>Clearly I must be doing something wrong. Does anybody have a hint or suggestion?</div><div><br></div><div>Thanks,</div><div>Michael.</div><div><br></div></div>