A ffmpeg handler (vide handler script & more):
vhs -a bottom-left.mkv -p bl320 background.mp4
Note: The 320 is optional and indicates the width of the added PiP video.
vhs -a bottom-left.mkv -p bl -y background.mp4
To save some encoding time, and just copy the streams.
]]>Another method is with ffplay:
ffplay -f lavfi "movie=background.mkv[bg];movie=foreground.mkv,scale=180:-1[fg];[bg][fg]overlay=W-w-10:H-h-10"
See the overlay video filter documentation for more options and examples.
Thanks for that tip... works.. but I think Im going to stick with the blender option (and if you do this type of work I recommend you do to...) because:
-its drag and drop simplicity (dont have to memorize 5 cli options and dont have to set height etc manually.)
-powerful control (eg setting complex/multiple times the overlaying is on/off, with fades and other effects)
-blender has many powerful blend/layering options (additive, multiply, alpha over, replace, alpha levels etc)... which ffmpeg doesnt seem to have.
ffplay -f lavfi "movie=background.mkv[bg];movie=foreground.mkv,scale=180:-1[fg];[bg][fg]overlay=W-w-10:H-h-10"
See the overlay video filter documentation for more options and examples.
]]>http://stackoverflow.com/questions/1043 … ing-ffmpeg
http://superuser.com/questions/868204/o … ith-ffmpeg
I'll give you some examples:
This will put images on top of your video
Top left corner
ffmpeg -i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=10:10 [out]" outputvideo.flv
Top right corner
ffmpeg -i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]" outputvideo.flv
Bottom left corner
ffmpeg -i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=10:main_h-overlay_h-10 [out]" outputvideo.flv
Bottom right corner
ffmpeg -i inputvideo.avi -vf "movie=watermarklogo.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" outputvideo.flv
Here are 3 examples for when I am overlaying subs onto a video
Overlay dvd_subs onto video (1st vid, 2nd audio, 2nd sub streams)
ffmpeg -i movie.vob -filter_complex "[0:0][0:4]overlay[0]" -map [0] -map 0:2 -c:a copy -c:v libx264 -b:v 2500k movie.avi
ffmpeg -i movie.vob -filter_complex "[0:v][0:s:1]overlay[v]" -map [v] -map 0:a:1 -c:a copy -c:v libx264 -b:v 2500k movie.avi
Overlay dvd_subs with cropping, video cropped=a, subs scaled=b, overlay (b over a)=c
ffmpeg -i video.vob -filter_complex "[0:0]crop=706:362:8:56[a];[0:4]scale=706:362[b];[a][b]overlay[c]" -map [c] -map 0:2 -c:a copy -c:v libx264 -b:v 2500k out.avi
This would be very useful for 1 time animated logos and effects that you dont want to "burn" into the source video.
]]>