A Script for Luma Keying and Layers with AVISynth+

Channel:
Subscribers:
1,850
Published on ● Video Link: https://www.youtube.com/watch?v=mVOlWgHmua8



Duration: 0:00
15 views
4


This is a script on how to do Luma Keying and adding (background/foreground) Layers with AVISynth+.

I'll probably provide other basic layer related scripts soon that aren't really covered properly on any site, cause it's fun to screw around with.

------------------------------

The script from the video:

base_video = DirectShowSource("base_video.webm").ConvertTORGB32()\Nluma_key = DirectShowSource("luma_key.webm").ConvertTORGB32()
background = ImageSource("background.png", fps=base_video.framerate, end=base_video.framecount)

foreground = ImageSource("foreground.png", fps=base_video.framerate, send=base_video.framecount, pixel_type="RGB32")
maskclip = ColorKeyMask((luma_key, $000000, 0)\NOverlay(background, base_video, mask=maskclip, mode="blend", opacity=1))

Overlay(last, foreground, mask=foreground.ShowAlpha())

------------------------------

Some additional notes.

In the example the webm format was used, which is why it relied on DirectShowSource.

In the example itself, there's a few more layers that what the script provides just to showcase that a lot more can be done.

If your videos are in the avi format use AVISource for instance.

Video in mp4 or mkv formats?
Use FFVideoSource or FFmpegSource, etc. etc.

Anyways... that's it.
Enjoy if you actually needed this.

------------------------------

Chapter Markers:
0:00 - Opening
0:30 - Script
1:05 - Example (Files are from: Slay the Princess)
1:16 - Closing

Assets from Slay the Princess - https://store.steampowered.com/app/1989270/