Add image.png to top of image.jpg with ffmpeg became more dark

Viewed 73

I try to create frame for picture use FFMPEG so its logic same as watermark. so i used this code

ffmpeg -i output_1920x1280.jpg -vf "movie=cpf-border.png [watermark]; [in][watermark] overlay=0:0 [out]" -q:v 1 withBorder.jpg

and try with diff command like this

ffmpeg -i output_1920x1280.jpg -i cpf-border.png -pix_fmt rgba -filter_complex "overlay=0:0" withBorder.jpg

but still same. there no error but the result of image its more dark. cause the frame base on white color so i saw that when do side by side can you help me maybe there another syntax to handle this or use another tools

This the border in .png format This the base image This the result its more dark than the original

1 Answers

It looks like there is some kind of bug related to YCbCr color space conversion.

We may select rgba format for each input before the overlay, and select rgb24 format after the overlay:

ffmpeg -y -i output_1920x1280.jpg -i cpf-border.png -filter_complex "[0]format=rgba[v1];[1]format=rgba[v2];[v1][v2]overlay=0:0,format=rgb24" -q:v 1 -src_range 0 -dst_range 1 withBorder.jpg

Result:
enter image description here

Related