video - how ffmpeg preserves alpha channel -


we know ffmpeg can overlaying image on video.my target wrap video image background transparent.

ffmpeg -i device/nexus5_portrait.png -i device/input.mp4\ -filter_complex "overlay=(w-w)/2:(h-h)/2:enable='between(t,0,5)'"\ -b:v 16m -bufsize 16m device/output.mp4; 

output.mp4 has black background there way preserve alpha channel?

thanks in advance!

you need use video codec supports transparency. default, mp4 uses h.264 (using x264) doesn't support alpha. @ vp8 or vp9, do support alpha. (if compression less critical) use image codec supports alpha (e.g. png) instead of video codec (-c:v png) output.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -