[FFmpeg-user] PNGs with transparent pixels to GIF

pdr0 pdr0 at shaw.ca
Sun Dec 20 17:25:34 EET 2020


FFmpeg-users mailing list wrote
> Hello,
> 
> I'm trying to create a GIF from an image sequence of PNGs with transparent
> pixels, but these transparent pixels convert to black in the resulting
> GIF. I'm using the following command :
> 
> $ ffmpeg -i toile4-4-%d.png -framerate 12 toile4.webm

Did you mean gif or webm ? The extension is webm in the commandline

For gif use -vf palettegen and paletteuse to reserve 1 color for
transparency

https://ffmpeg.org/ffmpeg-filters.html#palettegen-1
https://ffmpeg.org/ffmpeg-filters.html#paletteuse

You can combine the two by using -filter_complex, instead of creating a
palette png intermediate

eg.
ffmpeg -r 12 -i toile4-4-%d.png -filter_complex
"palettegen[PG],[0:v][PG]paletteuse" toile4.gif





--
Sent from: http://www.ffmpeg-archive.org/


More information about the ffmpeg-user mailing list