Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Video Editing/Mangling

Reply
 
Thread Tools Display Modes
Old 11-05-2018, 07:00 AM   #1
sonicowl
Human being with feelings
 
sonicowl's Avatar
 
Join Date: Oct 2015
Posts: 739
Default video processor: multiply with alpha, compositing

I'm looking for a way to crop video on one track with black/white image (or video) on a second track. Like this: https://en.wikipedia.org/wiki/Alpha_compositing

Two tracks get combined into one. Result would be partly seethrough video - transparent on black parts and fully visible on white parts. Video editors have this, but I cannot figure out how to do it in Reaper (apart from basic croping to rectangle).

Has anybody already written preset for video processor that can do this, and can share it?

Otherwise, which function in video processor would be appropriate for this task?

Thank you for help.

Last edited by sonicowl; 11-05-2018 at 07:21 AM.
sonicowl is offline   Reply With Quote
Old 11-05-2018, 08:43 AM   #2
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
Default

This would be a great addition.

I guess it could be kind of a combination off "chroma key" and "image overlay". Also PS layer modes like multiply, darken, lighten etc. would be a great addition. This stuff is standard in every video software. And i guess its not hard to do.

Video processor and video in Reaper has such a huge potential. More people should code presets. I tried to write and change some presets but as a noob its pretty hard to put something together. Even the Reaper internals couldn't help me.
Eliseat is offline   Reply With Quote
Old 11-05-2018, 07:05 PM   #3
wwwmaze
Human being with feelings
 
Join Date: Oct 2009
Posts: 99
Default

Quote:
Originally Posted by sonicowl View Post
Otherwise, which function in video processor would be appropriate for this task?
I think what you are looking for is "gfx_mode"

This blends the next (or previous, depending what you have set in project settings) 2 video tracks after the track which has this video processor active:
Code:
*snip* see below
From the docs:
Quote:
gfx_mode:
0 = normal
1 = additive
3 = multiply (very different in YUV vs RGBA)
17 = (dest + src*gfx_a)*.5 + .5 (only valid when using YUV colorspaces)
18 = dest + (src-0.5)*gfx_a*2.0 (only valid when using YUV colorspaces)
19 = absolute difference: abs(dest-src)*gfx_a (only valid when using YUV colorspaces)
...

Last edited by wwwmaze; 11-06-2018 at 03:36 AM.
wwwmaze is offline   Reply With Quote
Old 11-06-2018, 12:43 AM   #4
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
Default

Many thanks.

But where are the docs? Didn't even know there are docs for that.
Eliseat is offline   Reply With Quote
Old 11-06-2018, 02:57 AM   #5
wwwmaze
Human being with feelings
 
Join Date: Oct 2009
Posts: 99
Default

Either press F1 when the mouse cursor is within the editor or use this online documentation: https://mespotin.uber.space/Mespotin...API_Video.html


On another glimpse I'm not even convinced if blending works the way I think (or the linux implementation of video processor maybe has a bug).

2 observations:
1. After I blend-in completely white pixels while adding both images/videos I still can see some non-white pixels. Same problem with subtraction, the picture should be black but I also see non-black pixels.
2. Multiplying makes the resulting image/video lose its color.
wwwmaze is offline   Reply With Quote
Old 11-06-2018, 03:10 AM   #6
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
Default

Quote:
Originally Posted by wwwmaze View Post
Either press F1 when the mouse cursor is within the editor or use this online documentation: https://mespotin.uber.space/Mespotin...API_Video.html


On another glimpse I'm not even convinced if blending works the way I think (or the linux implementation of video processor maybe has a bug).

2 observations:
1. After I blend-in completely white pixels while adding both images/videos I still can see some non-white pixels. Same problem with subtraction, the picture should be black but I also see non-black pixels.
2. Multiplying makes the resulting image/video lose its color.
Many thanks. Unfortunately my F1 key is broken.

And yes, I also discovered a very strange blend mode behavior. It could be because of the different color spaces. Have no idea actually. I only know those Photoshop blend modes and they react much different from that.

It also does not blend drawn colors from other tracks. (Tried to blend in "solid color" from reaper blog.) Only video signals work.
Eliseat is offline   Reply With Quote
Old 05-13-2020, 08:49 PM   #7
KeithHandy
Human being with feelings
 
Join Date: Mar 2018
Posts: 14
Default

Quote:
Originally Posted by wwwmaze View Post
Either press F1 when the mouse cursor is within the editor or use this online documentation: https://mespotin.uber.space/Mespotin...API_Video.html
Heads up, that link seems to be broken by now, but Googling for the quoted part brings me to a similar but shorter URL: https://mespotin.uber.space/Ultrasch...mentation.html
KeithHandy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.