I have over 100+ videos and i need to paste one 5 sec avi video on top layer of every video (something like watermark or animated logo). It can be performed with Adobe Premiere, but its too long and stupid. Where i can find good framework to work with video to perform this (any language)? Or any other method to do it? Maybe ‘ffmpeg’ can help? Any help, links, documentations would be great.
Share
Not very clear on what you mean by 5 sec avi video on top layer.
I am guessing your watermark is 5 seconds long and 100+ videos are arbitary length and you want to put the first in some location on the second
ffmpeg has an overlay filter.: Here is the documentation
Overlay one video on top of another.
It takes two inputs and one output, the first input is the “main” video on which the second input is overlayed.
It accepts the parameters: x:y[:options].
x is the x coordinate of the overlayed video on the main video, y is the y coordinate. x and y are expressions containing the following parameters:
‘main_w, main_h’
‘W, H’
‘overlay_w, overlay_h’
‘w, h’
options is an optional list of key=value pairs, separated by “:”.
The description of the accepted options follows.
‘rgb’
Be aware that frames are taken from each input video in timestamp order, hence, if their initial timestamps differ, it is a a good idea to pass the two inputs through a setpts=PTS-STARTPTS filter to have them begin in the same zero timestamp, as it does the example for the movie filter.
Follow some examples:
This one worked for me fine:
ffmpeg -i ./external/bb_high.mp4 -i external/small.mp4 -strict -2 -filter_complex ‘overlay=10:10’ output.mp4
But end of 5 seconds I think the last frame remains in the overlay.
This is where gstreamer option is a better one. There is a videomixer element available to do exactly this kind of thing.