Old 05-02-2022, 12:05 PM   #1
jzucker
Human being with feelings
 
Join Date: Dec 2008
Posts: 231
Default Multiple/split screen help

I want to:

- Split screen with 2 videos (2 columns)
- I used the 2x2 matrix preset but modified it like so:

x=0;
loop(2,
gfx_blit(input_track(x), 1 /* preserve aspect */,
(x&1)?project_w*0.5:0, (x&2)?project_h, // position
project_w*0.5,project_h // output width and height
);
x += 1;
);

It works but it leaves black space above and below the videos (see attachment)

Instead, I'd like the videos to fill the page horizontally and vertically. Obviously this will involve some horizontal cropping due to the aspect ratios. Ideally I'd like to be able to add an offset value to the cropped position. (Positive to move it left, negative to move it right ) and then expand the height but when I try that with the existing code, I get unexpected results.

Any help would be appreciated.
Attached Images
File Type: jpg splitscreen2.jpg (135.5 KB, 106 views)
jzucker is offline   Reply With Quote
Old 05-02-2022, 05:39 PM   #2
papagirafe
Human being with feelings
 
papagirafe's Avatar
 
Join Date: Aug 2020
Location: Brasil
Posts: 679
Default

Quote:
Originally Posted by jzucker View Post
I want to:

- Split screen with 2 videos (2 columns)
<snip>...</snip>
Instead, I'd like the videos to fill the page horizontally and vertically. Obviously this will involve some horizontal cropping due to the aspect ratios. Ideally I'd like to be able to add an offset value to the cropped position. (Positive to move it left, negative to move it right ) and then expand the height but when I try that with the existing code, I get unexpected results.

Any help would be appreciated.
In my experience, for a small number of sources (like the 2 in this case), it's better to use the "overlay: image" preset for each source and adjust the size, position and zooming manually. If cropping is needed there exists versions of this preset that allows cropping but I recently posted a cropping only preset to put at the beginning of your fx chains; here the thread: https://forum.cockos.com/showthread.php?t=263967

I would also experiment with the preset "grid of videos" that has controls over the types of cropping.

Another possibility is to pre-process the sources in a separate project that has a video dimensions of exactly 1/2 screen and zoom/align sources with a the basic helper presets. I do this on a regular basis with virtual choir projects with lots of choristers videos.
papagirafe is offline   Reply With Quote
Old 05-02-2022, 06:26 PM   #3
jzucker
Human being with feelings
 
Join Date: Dec 2008
Posts: 231
Default

Quote:
Originally Posted by papagirafe View Post
In my experience, for a small number of sources (like the 2 in this case), it's better to use the "overlay: image" preset for each source and adjust the size, position and zooming manually. If cropping is needed there exists versions of this preset that allows cropping but I recently posted a cropping only preset to put at the beginning of your fx chains; here the thread: https://forum.cockos.com/showthread.php?t=263967

I would also experiment with the preset "grid of videos" that has controls over the types of cropping.

Another possibility is to pre-process the sources in a separate project that has a video dimensions of exactly 1/2 screen and zoom/align sources with a the basic helper presets. I do this on a regular basis with virtual choir projects with lots of choristers videos.

Thanks. Makes sense. Have you considered using davinci resolve for the video? That is what I'm considering. I have experimented a little and it's very powerful. I'd like to avoid yet another software package but obviously it's stretching the capabilities of an audio processors to start doing things like this...
jzucker is offline   Reply With Quote
Old 05-02-2022, 06:45 PM   #4
papagirafe
Human being with feelings
 
papagirafe's Avatar
 
Join Date: Aug 2020
Location: Brasil
Posts: 679
Default

Quote:
Originally Posted by jzucker View Post
Thanks. Makes sense. Have you considered using davinci resolve for the video? That is what I'm considering. I have experimented a little and it's very powerful. I'd like to avoid yet another software package but obviously it's stretching the capabilities of an audio processors to start doing things like this...
Well actually, I have done marvels with Reaper's video processor but it's not friendly and it feels incomplete. Having been a proficient programmer in my youth, I personally invested time (instead of money) to understand the inner workings of this video processor and I always found a way to tailor it to the needs of my projects. What you are looking to do should be simple enough. Good luck.
papagirafe is offline   Reply With Quote
Old 05-04-2022, 06:11 AM   #5
jak352
Human being with feelings
 
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
Default Combine: Grid of videos preset

Hi, I wrote the "Combine: Grid of Videos" preset within Repaer's Video Processor effect. Put that effect on track one, put the two videos on track 2 and track 3 and then set the "Landscape/Sq/Portrait" to the middle position (where it aims to get the video grid tiles to be as square as possible while filling the screen). At the time of writing (early May 2022) there is a bug that means that the two portrait videos come one above the other and I've just written version 2 which fixes this problem and it will be included in the next release of Reaper I believe.
If you want to hack the existing code in the mean time go to lines 77 and 78 and change it from
rows = ceil(sqrt(count_tracks/aspect));
cols = ceil(count_tracks/rows);
to instead be
cols = ceil(sqrt(count_tracks/aspect));
rows = ceil(count_tracks/cols);
and save the updated code (cmd S on Mac or ctrl S on PC). This should put those two videos side by side. I'll be making a video about how to use the "Combine: Grid of videos" preset soon (once the updated verison is released). If you want to pan the videos left and right etc. then put another instance of "Video Processor" effect on "Item>Take>Show FX chain for active take" (shortcut is shift E) and select the "Basic helpers: Track opacity/zoom/pan" preset and use the x offset knob etc.

Last edited by jak352; 05-05-2022 at 02:29 AM.
jak352 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 06:20 AM.


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