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:
https://www.reddit.com/r/ffmpeg/comments/bu8znh/advice_for_preserving_colours_from_png_rgb_to/
and then used this Facebook post for reference:
https://www.facebook.com/permalink.php?story_fbid=2413101932257643&id=100006735798590
and it still didn't work :((
If anyone can tweak my commands below to work properly, that would be
perfect.
I'm not attached to any particular video codec.

Here is the original image (attached as rainbow.png):
https://drive.google.com/open?id=15ny3ROv0JduYdSd3k8vSvna96oA9KIou
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):
https://drive.google.com/open?id=12wgVPPzdp2Qi-tEMBoVg-3E8CIZW6Jvh
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,
Tom

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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

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