[FFmpeg-user] Decoding Raw YUV Frames From MPEG2

Andy Furniss andyqos at ukfsn.org
Sat Feb 2 21:47:59 CET 2013

Stu wrote:
> Andy
>> How far out are they?
> Frequency analysis graph shows three spikes, at values 16, 128 and 234.
> But the full range is present, 0 accounting for over 32,000 samples and 255 for over 8,000.
> Is this what is usually passed to a hardware surface during playback?

I guess so - but then I don't really know, so don't take anything I say 
as fact.

I just looked at the results of ffmpeg -i foo.xyz foo.yuy and they seem 
quite variable.

Nearly all go over/under a bit some quite a lot and they include 0 and 
255, it does seem like this is what the source provides - eg. there are 
(almost) perfectly behaved streams like


Which at least indicates that ffmpeg isn't doing anything strange.

Others in that dir are quite variable even between the 420 and 422 
(*_400.m2v) variants of the same stream.

I've looked at broadcast mpeg2/dvd and h264 and the results usually 
include out of range values.

Even a raw reference stream which has never been encoded like -


goes over/under (that's assuming it's meant to be tv levels - it looks a 
bit washed out playing full range)

 > If so, I would presume that these out of range values are clipped.

I think that's a decision for display time - and clamped rather than 

 > Can ffmpeg do this for me?

I don't know and I don't know if it would be better to just leave alone.

More information about the ffmpeg-user mailing list