[Libav-user] Writing 16bit greyscale videos

Carl Eugen Hoyos ceffmpeg at gmail.com
Tue Aug 30 20:53:01 EEST 2016


Hi!

2016-08-29 17:20 GMT+02:00 Masneri, Stefano <stefano.masneri at brain.mpg.de>:
>>From: Libav-user [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos
>>>2016-08-29 10:59 GMT+02:00 Masneri, Stefano <stefano.masneri at brain.mpg.de>:

>>> Do you know of a codec that supports encoding a video using
>>> AV_PIX_FMT_GRAY16BE pixel format (or anything similar)?
>>
>> jpegls, png, tiff, dpx, sgi, ffvhuff, ffv1 (all lossless)
>> Jpeg2000, but FFmpeg needs the external library libopenjpeg for encoding
>> gray16 (lossy or lossless)
>
> Thanks Carl. I am able to create the video with 16 bit greyscale images,

> but when I try watching the video in VLC I only see a green image.

Do you think this is an issue that can be fixed within FFmpeg?

> Reading the frames one by one (with a simple class which uses FFmpeg) I see
> a strange behaviour: every second column of the video is zero, while the other
> are exactly as the input fed to the class that created the video.

Is this issue reproducible with ffmpeg (the application)?

> I guess there is somewhere a problem switching from uint16 to uint8, but I
> cannot figure it out. Any hints?

I may misunderstand but you get a uint8_t pointer that contains the exact 16bit
data you originally encoded after decoding.

Carl Eugen


More information about the Libav-user mailing list