Use a video as an overlay on another video from command line?

1

MEncoder/FFmpeg can overlay a video with an image from the command line. Is this possible with a video?

I want to overlay a video with another dynamic video. Some parts of the overlayed video must be see-through (the parts where nothing is actually there, an arrow shows up on the screen and then disappears and then I do not want the whole screen to go black because of no background, only the arrow is shown etc).

My guess is that the overlayed video must have alpha levels enabled in the encoding or something? Please shed some light which encoding I must use on the overlayed video. The combined video should be encoded as one of the most universal formats if possible.

Simon Zettervall

Posted 2013-01-28T14:02:37.843

Reputation: 43

Can you supply examples? You're right that your input video needs some kind of alpha channel – do you have that already? Seeing your source material would help. – slhck – 2013-01-28T14:44:02.610

@slhck No sorry I currently have nothing to work with. I am to gather information so my company may request said overlay videos from another company. I thus have full control on what I want. The non-overlay video may be recorded through a webcam, phone or other recording device so it's encoding may differ. The overlayed video however will be what I request.

For example, first video 1 is played, then video 2 in sequence. As video 2 is ending video 3 is going to be played on top of video 2 and display some indicator on the screen, a small thing compared to the non-overlay video. – Simon Zettervall – 2013-01-28T14:51:18.947

I see. I can't give you any authoritative suggestion here, but ProRes supports alpha channels (ProRes 4444). I can't confirm though whether FFmpeg supports this. FFmbc does, but it probably doesn't have the filtering tools you'd need. – slhck – 2013-01-28T15:20:40.703

@slhck Okay, I have no clue about stuff like this but here http://blogs.adobe.com/premierepro/2010/07/exporting_video_with_an_alpha.html the author tells to export as an AVI. Cannot I just load that one and use it as an overlay?

– Simon Zettervall – 2013-01-28T16:10:33.263

AVI is just a container that stores different video codecs. In the case of that link you found, the "video" codec used is a sequence of transparent PNG images, which could of course also work in your case. Ideally you'd request a sample that you could try first—don't want to buy a pig in a poke. – slhck – 2013-01-28T16:26:54.987

@slhck I see, so because PNGs have an alpha volume then I could ask them to convert a video with transparent PNGs? I will ask them to give me something and hope it goes well. Thanks! – Simon Zettervall – 2013-01-28T16:34:46.117

That should work, but I can't test it without a proper source. If you get a sample and you can supply it here, that'd be great. Keep me updated! – slhck – 2013-01-28T18:03:58.613

No answers