[FFmpeg-user] Different output when overlaying blank jpg and png

Cvetelin Andreev cvetelin.andreev at picamaze.com
Fri Oct 23 09:21:47 EEST 2020

Hi All,

I'm having a different output when overlaying a video over png and jpg. I
like what I get with the png, but my app is using user's images to overlay
an animation on top and I don't have control over the image so sometimes
users get different colors than expected. How can I avoid this?

I'm using the following command to overlay video onto image:
ffmpeg -y -i white.png \
-i video.mov \
-filter_complex "[1:v][0:v]scale2ref='iw:ow/mdar'[scaled-overlay][image];\
[image][scaled-overlay]overlay[filtered]" \
-map "[filtered]" output.png.gif

The video is an animation done with AE exported in Quicktime PNG.
The image is generated with ImageMagick's convert:
convert -size 500x500 xc:white white_500.png

The result is fine. However if I use the same command with a JPEG image
(white, 500x500 downloaded from the Internet) the colors of the results are
different (appear darker):
[image: image.png]
It works fine with JPEG generated with ImageMagick.

All files and script here:

Thank you for your time!

Cvetelin Andreev - Andy


+1 (857) 957-6878 <+18579576878>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 134515 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20201023/9bdb7b16/attachment.png>

More information about the ffmpeg-user mailing list