PNG to video without any colour range loss?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

PNG to video without any colour range loss?

Thomas Howe-2
Hi all,

I'm trying to make a video from a single .png file where the colours are
preserved properly, but I can't figure it out.

I posted on Reddit:
and then used this Facebook post for reference:
and it still didn't work :((
If anyone can tweak my commands below to work properly, that would be
I'm not attached to any particular video codec.

Here is the original image (attached as rainbow.png):
It is a 1920x1080 image for screenshotting purposes, with containing a
100x640 rainbow pattern in the top left corner.

To turn this into a video, as per the Facebook advice, I used this:
ffmpeg -loop 1 -i rainbow.png -c:v libx265 -x265-params lossless -pix_fmt
yuvj420p -t 5 rainbow.mp4

and then extracted a frame like this:
ffmpeg -ss 00:00:02 -i rainbow.mp4 -vframes 1 rainbow-extract.png

and then took screenshots for comparison from SMPlayer, and YouTube (both
Firefox and Chromium).
Here is an annotated comparison (attached as rainbow-comparisons.png):
The screenshots all look very similar. Something I find odd is that the
extracted frame is visibly slightly different to the source picture.

Anyways, any help appreciated,

ffmpeg-user mailing list
[hidden email]

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

rainbow-comparisons.png (80K) Download Attachment
rainbow.png (15K) Download Attachment