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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 04-05-2020, 10:17 AM   #1
jak352
Human being with feelings
 
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
Default Code for showing a grid of any number of videos with automatic column and row count

I have made some code for showing a grid of videos while automatically allocating a column and row count (leaving black space where necessary). Here's the code to paste into the Video Processor plugin in an empty track with any number of video tracks below it:

Code:
// grid of videos - automatically draws any number of videos from tracks
x=0;
count_tracks = input_track_count();
cols = ceil(sqrt(count_tracks));
rows = ceil(count_tracks/cols);
loop(cols*rows,
gfx_blit(input_track(x), 1 /* preserve aspect */,
(x%cols)*project_w/cols, ((x - (x%cols))/cols)*project_h/rows, // position
project_w/cols,project_h/rows // output width and height
);
x += 1;
);
There are some more code examples in my feature request post at:
https://forum.cockos.com/showthread.php?t=233798
COVID-19 is currently inspiring lots of people to make videos like this.
jak352 is offline   Reply With Quote
 

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:09 PM.


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