[FFmpeg-user] Lossless and colour preserving pix_fmt?

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu Jan 11 06:15:14 EET 2018


2018-01-11 4:52 GMT+01:00 Jim DeLaHunt <from.ffmpeg-user at jdlh.com>:
> On 2018-01-07 21:29, Jim DeLaHunt wrote:
>>
>> Hello, ffmpeg'rs:
>>
>> I'm trying to overlay animated GIFS onto one white background, with some
>> text at the top.  I'm looking for an incantation which a) does the job and
>> b) leaves all the colours of the animated gifs unchanged.
>>
>> What options tell ffmpeg not to mess with the colour values, not to change
>> colour spaces, not to reduce precision of colour coordinate values?
>
>
> The best answer to this appeared in an answer to SuperUser question,
> /Lossless universal video format /[1]
> <https://superuser.com/questions/486325/lossless-universal-video-format>.

Because of its age, this "answer" is not only outdated but in your
context simply wrong.

> Preserve colour space? Sorry, none. The Animated GIF colour values are
> defined as 24-bit RGB values in sRGB space.  As far as I can tell it's hard
> to get FFmpeg to use RGB for its operations, it really pushes you to YUV
> (luminance and two chroma values).

This is - in the context you provide - not true, the overlay filter supports rgb
which should visually improve the quality of your output video.

The better choice for a lossless video is typically ffv1.

Carl Eugen


More information about the ffmpeg-user mailing list