I’d like to layer video files. The first layer would have an alpha channel, it would play over another video in the background.
If that’s not possible, could I layer an alpha channel video over a static background image?
Please let me know if there’s a package that will allow me to do this. Thanks!
Both of these things are technically possible, but right now no package exposes this feature. What’s the use case of laying two videos on top of each other? Could you not get the same result by mixing those videos into a single one before you upload?
I’d like to layer the videos for a projection art piece. I rather layer them in Beamer because it would save me a step from layering them in my video editing software then rendering.
Glad to hear it’s technically possible. How could I layer them? Is there code I could use?
The problem with layering within info-beamer is that the decoding power of the Pi might not be sufficient depending on the type of video you’re trying to use. For example using two FullHD videos is close to being outside of the hardware specs, even on a Pi4. I highly recommend you do the layering by rendering out a combined video.
If you chose to ignore that, you might try to abuse the dual-player package. These modifications might do it:
Change these lines to use the complete screen and and an alpha parameter:
local runner_1 = Runner(playlist_1, {
x1 = 0,
y1 = 0,
x2 = WIDTH,
y2 = HEIGHT,
alpha = 1,
})
local runner_2 = Runner(playlist_2, {
x1 = 0,
y1 = 0,
x2 = WIDTH,
y2 = HEIGHT,
alpha = 0.5,
})
Then when drawing the video, add the alpha
method to apply the alpha:
vid:place(pos.x1+x1, pos.y1+y1, pos.x1+x2, pos.y1+y2):layer(1):alpha(pos.alpha):start()
Then import your custom package and give it a try.