I am a researcher, trying to string together a bunch of png files of a protein to a short video. I have all the png images with transparent backgrounds, but I can't seem to get this in the video.

I use this (on macOS terminal) to convert:

ffmpeg -framerate 20 -pattern_type glob -i '*.png' -c:v libx264 -preset slow  -profile:v high -level:v 4.0 -pix_fmt yuv420p -vf pad="width=ceil(iw/2)*2:height=ceil(ih/2)*2" -crf 22 -codec:a aac -pix_fmt yuva420p SST4.mp4

I added the -pix_fmt yuva420p that I found as an accepted answer here, but it doesn't work for me. I also tried other options (rgb24, bgra, etc.), but none I have tried works. I get a nice video, just with black background instead of transparent.

New contributor
Aephir is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • How do you intend to play the video?
    – Gyan
    Sep 14 at 12:14
  • This is just for a PowerPoint presentation (where it will partly overlap something else; that's why I want the transparent background).
    – Aephir
    Sep 15 at 6:42
  • How about apng (Animated PNG). Size will be large but it is simply PNG with animation . yesterday

Your Answer

Aephir is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.