Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify background colour when generating movie from images

I generate a video from png images using

ffmpeg -i visualization/%d.png -c:v libx264 -vf "scale=500:trunc(ow/a/2)*2"  -pix_fmt yuv420p z.mov

and if images have transparencies, they become black. Can I somehow make them white?

like image 730
Uko Avatar asked Mar 20 '23 15:03

Uko


1 Answers

Before running ffmpeg, use ImageMagick to "flatten" each PNG against white.

mogrify -background white -flatten visualization/*.png
like image 151
Glenn Randers-Pehrson Avatar answered Apr 28 '23 00:04

Glenn Randers-Pehrson