You are not logged in.
Pages: 1
Does mplayer (plugin?) or any other video player have the feature of being able to layer videos (with transparency) ontop of each other (just like editing software)? For realtime playback.
This would be very useful for 1 time animated logos and effects that you dont want to "burn" into the source video.
Offline
You're probably going to have to make a new video composite with ffmpeg.
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
Offline
Thanks for that...
I was hoping to do it with live, on the fly, videos... and just found a solution... it works with blender (the excellent 3d animation/video editing software)... I just layer the videos and view it at full quality in its preview window of the video editor.
The good thing about that is with blender you dont need to re-encode the videos, saving a ton of cpu.
Offline
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.
Offline
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.
Offline
@babyturtle: If you are interested in improving ffmpeg for this purpose, I have created a ticket for you on the bug tracker:
https://trac.ffmpeg.org/ticket/4801
Reopen if you wish to provide more details.
"Behind every theorem lies an inequality" - A N Kolmogorov
Offline
EDIT: Doh, without burning into source... scratch this.. sorry.
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.
https://github.com/sri-arjuna/vhs
Last edited by esa (2015-08-25 10:07:53)
Offline
Pages: 1