[FFmpeg-user] Encoding v210 fails when using PIX_FMT_YUV422P16LE even though PIX_FMT_YUV422P10LE is deprecated

Baptiste Coudurier baptiste.coudurier at gmail.com
Thu Jun 2 17:37:25 CEST 2011


Hi Thomas,

On 05/27/2011 10:50 PM, Thomas Worth wrote:
>>
>>> If I change pix_fmt to PIX_FMT_YUV422P10LE, I don't get any errors but
>>> the
>>>> packing appears to be wrong. My code is already set up to pack
>>> YUV422P16.
>>>
>>> Appears to be wrong ?
>>>
>>
>> Sorry, I should have clarified that. The packing is different, and doesn't
>> work with my code. It is different from YUV422P16 so I'd like to get it
>> working in that format so I don't have to rewrite my packing code. This all
>> worked before the ffmpeg/libav split and now only works with libav. I
>> believe the first go at supporting v210 in ffmpeg was with YUV422P16, which
>> is why my code expects frames in that format.
>>
> 
> Never mind. The encoder expects planar data, so it was easier than I
> thought. The reason it wasn't working before is because the endian order was
> reversed for each unsigned 16 bit value (since v210 expects uint16_t). It's
> working now with YUV422P10LE. Thanks for your help!

No problem. Although you may not that it is YUV422P10, and not only
YUV422P10LE, it means it's native endian. That is you must write the
values as int16_t directly in your buffer like:
int16_t data[0][0] = <value> for the first Y value for example,
wether you are on a little or big endian architecture.

-- 
Baptiste COUDURIER
Key fingerprint          8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                           http://www.ffmpeg.org


More information about the ffmpeg-user mailing list