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

Reply
 
Thread Tools Display Modes
Old 03-27-2021, 12:41 PM   #1
SawdustAndDiamonds
Human being with feelings
 
SawdustAndDiamonds's Avatar
 
Join Date: Feb 2017
Location: London
Posts: 21
Default Tweaked overlay preset to add l/r/t/b controls

Here's a tweaked version of the 'image overlay' preset. This allows you to overlay a chosen rectangle from within a video, instead of always overlaying the entire video.

Code:
//Image overlay with l/r/t/b controls
//@param1:opacity 'opacity' 1
//@param2:zoom 'zoom' 0 -15 15 0
//@param3:xoffs 'X offset' 0 -1 1 0
//@param4:yoffs 'Y offset' 0 -1 1 0
//@param6:filter 'filter' 0 0 1 0.5 1
//@param7:use_srca 'alpha channel' 1 0 1 0.5 1
//@param8:LeftEdge 'Left edge' 0 0 1920 200 1
//@param9:RightEdge 'Right edge' 1920 0 1920 200 1
//@param10:TopEdge 'Top edge' 0 0 1080 200 1
//@param11:BottomEdge 'Bottom edge' 1080 0 1080 200 1

img1=input_track(0);
img2=0;
use_srca && img2 != img1 ? colorspace='RGBA';
input_info(img1,img1w,img1h) && project_wh_valid===0 ?  ( project_w = img1w; project_h = img1h; );

a = opacity < 0.01 ? 0 : opacity > 0.99 ? 1 : opacity;

img2 != img1 && input_info(img2,sw,sh) ? (
  gfx_blit(img1,0);
  a>0?(
    gfx_a=a;
    gfx_mode = (filter>0.5 ? 256 : 0)|(use_srca?0x10000:0);
    gfx_blit(frame_0,1,LeftEdge+xoffs*project_w,TopEdge+yoffs*project_h,min(project_w, RightEdge-LeftEdge), min(project_h, BottomEdge-TopEdge), LeftEdge,TopEdge,min(project_w, RightEdge-LeftEdge),  min(project_h, BottomEdge-TopEdge));
  );
);

Notes:
- As usual, you can Ctrl+Click for tiny adjustments, to set the edges to the exact pixel you want.
- Controls for LeftEdge etc are in pixels. If you want to use a resolution larger than 1920x1080, you'll need to edit the code.
- Once you've used the edge controls to select your rectangle, you can use X/Y offset to move the overlay around. This will move the overlaying video, while keeping the same rectangle of your video to overlay.
- The zoom control doesn't work. But you can just put another instance of video processor before it in the FX chain, and use the zoom preset on there.

You can see the code in action at 0:43 in this video:


Edit: Adding GIF
__________________
Reaper v6.25 x64, Windows 10, Intel i5-7200U, 16GB RAM + SSD

Many-layered dreampop as Callum Martin-Moore on Spotify, Facebook and Bandcamp.

Last edited by SawdustAndDiamonds; 03-27-2021 at 01:52 PM.
SawdustAndDiamonds is offline   Reply With Quote
Old 03-27-2021, 01:08 PM   #2
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 7,736
Default

Noice! You can add it here: https://forum.cockos.com/showthread.php?t=213832
vitalker is offline   Reply With Quote
Old 03-30-2021, 09:51 AM   #3
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 5,959
Default

Sounds a whole lot like what I did here, but I guess I’m not invited to the big thread.

https://forum.cockos.com/showthread.php?t=245490
ashcat_lt is online now   Reply With Quote
Old 03-30-2021, 10:00 AM   #4
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 7,736
Default

Quote:
Originally Posted by ashcat_lt View Post
Sounds a whole lot like what I did here, but I guess I’m not invited to the big thread.

https://forum.cockos.com/showthread.php?t=245490
Sorry, I didn't see you post before and without video it is not easy do understand what is going on.
vitalker is offline   Reply With Quote
Old 03-30-2021, 10:04 AM   #5
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 5,959
Default

I was kinda just playing, but honestly that “without video” thing is kind of annoying. It’s come up a couple of times now, and on things that I feel are pretty straightforward and easy to understand from my text descriptions. I made these things so that I can make other videos, and I share them with y’all thinking that might help or at least inspire, but then they get ignored because I didn’t bother to make a video out of me making a video out of...
ashcat_lt is online now   Reply With Quote
Old 03-30-2021, 10:18 AM   #6
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 7,736
Default

Quote:
Originally Posted by ashcat_lt View Post
I was kinda just playing, but honestly that “without video” thing is kind of annoying. It’s come up a couple of times now, and on things that I feel are pretty straightforward and easy to understand from my text descriptions. I made these things so that I can make other videos, and I share them with y’all thinking that might help or at least inspire, but then they get ignored because I didn’t bother to make a video out of me making a video out of...
Well you're right. The text is understandable. I've just haven't seen your post. That's it.
vitalker is offline   Reply With Quote
Old 03-30-2021, 10:25 AM   #7
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 5,959
Default

Seriously no hard feelings! I really could have just asked or posted in the big thread anyway...
ashcat_lt is online now   Reply With Quote
Old 03-30-2021, 11:17 AM   #8
DrRick
Human being with feelings
 
Join Date: Aug 2019
Posts: 6
Default

They say it's like buses... you wait and wait, then three come along at once. I was desperate for one of these a month or so back and hacked up my own from half-understanding various other bits of code, which I've been meaning to post for a while. I don't think mine trims quite as elegantly as these, but the scaling does work. I have it set so that the opacity is controlled by track zoom, because that's what I usually want. I'm using it to make split-screen solo cover videos with parts fading in and out as they occur.

I will post it when I get it tidied up.
DrRick is offline   Reply With Quote
Old 03-30-2021, 11:36 AM   #9
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 7,736
Default

Quote:
Originally Posted by ashcat_lt View Post
Seriously no hard feelings! I really could have just asked or posted in the big thread anyway...
Sure. More presets, more fun!
vitalker is offline   Reply With Quote
Old 06-01-2021, 03:11 PM   #10
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 394
Default

Quote:
Originally Posted by SawdustAndDiamonds View Post
Here's a tweaked version of the 'image overlay' preset. This allows you to overlay a chosen rectangle from within a video, instead of always overlaying the entire video.
Thanks for this! Super useful

The only thing I'm noticing is that the 'zoom' doesn't seem to do anything? I'm hoping there's a way to have the 'zoom' only affect the video that this effect is on. With the default 'image overlay' preset, the 'zoom' will zoom any/all visible video.

FWIW, I'm on OSX Mojave, Reaper v6.29

EDIT: Nevermind. I got it working

Last edited by benmrx; 06-04-2021 at 08:55 AM.
benmrx 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 11:44 PM.


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