[FFmpeg-user] Can FFmpeg create a separate transparent PNG track?

Werner Robitza werner.robitza at gmail.com
Tue May 29 14:50:39 CEST 2012


I know it's possible to embed a transparent watermark using video filters,
e.g. like this:

ffmpeg -i input.mp4 -vf "movie='logo.png' [logo]; [in][logo]
overlay=main_w-overlay_w-10:10 [out]" out.mp4

This creates a file with one video track, where the transparent logo is
correctly shown in the upper right corner.

However, is there a way to add a separate transparent track to the
container, which then could be toggled on / off individually?
The following creates two video streams, one for the overlay:

ffmpeg -loop_input -i input.mp4 -i logo.png -map 0 -map 1 output.mp4

But since the overlay is converted from PNG to an actual video bitstream,
it's not transparent anymore (plus, it has to have a width/height divisible
by 2, etc.).
Is it even theoretically possible to create a transparent stream like that?
If so, how would I go about doing so?

Best regards,
Werner Robitza


More information about the ffmpeg-user mailing list