|
![]() |
|
Thread Tools | Display Modes |
![]() |
#41 |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]()
It's great to see this stuff being used! This new YouTube uses my new version of the code from post number 40:
|
![]() |
![]() |
![]() |
#42 | |
Human being with feelings
Join Date: Apr 2011
Posts: 3,434
|
![]() Quote:
__________________
Most of my scripts can be found in ReaPack. If you find them useful, a donation would be greatly appreciated! Thank you! :) |
|
![]() |
![]() |
![]() |
#43 | |
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
![]() Quote:
this is really great. Didn't know you already had so many features added to your script. Many thanks for the video and the script. This is a new level in Reaper video editing. Greetings Eli
__________________
☆.。.:*・°☆.。.:*・°☆.。.:*・°☆REAPER//✿◔‿◔)°☆.。.:*・°☆.。.:*・°☆
|
|
![]() |
![]() |
![]() |
#44 |
Human being with feelings
Join Date: Apr 2011
Posts: 3,434
|
![]()
Thank you jak352 for the great script!!
![]()
__________________
Most of my scripts can be found in ReaPack. If you find them useful, a donation would be greatly appreciated! Thank you! :) |
![]() |
![]() |
![]() |
#45 | |
Human being with feelings
Join Date: Dec 2012
Posts: 13,321
|
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#46 |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]()
Awesome! Thanks for the feedback. Here's a little script for converting landscape videos to portrait. This would be useful when making a virtual choir of portrait mode videos using my code and one choir member sends a landscape. Go to the offending track and instead using opacity/zoom/pan in the Video Processor for that track use the code below. This is relevant to 37 minutes into my video when I got stuck:
Code:
//Convert landscape to portrait input_info(0,prewidth,preheight); preaspect = prewidth/preheight; preserveaspect = 0; destx = 0;//destination x desty = 0;//destination y destw = project_w;//destination width desth = project_h;//destination height srcx = (prewidth-(preheight/preaspect))/2;//source x srcy = 0;//source y srcw = preheight/preaspect;//source width srch = preheight;//source height gfx_blit(0, preserveaspect, destx, desty, destw, desth, srcx, srcy, srcw, srch); |
![]() |
![]() |
![]() |
#47 |
Human being with feelings
Join Date: Mar 2018
Posts: 7
|
![]()
Hey folks, has anyone had any issues with videos that were not pixelated/blurry, becoming pixelated/blurry when used with this code? I don't think the code is the underlying problem, I feel it might be a settings or playback issue for me. But I'm curious if anyone else has had this happen and what they might have done to overcome it!
|
![]() |
![]() |
![]() |
#48 | |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]() Quote:
File>Project Settings>Video and then enter the preferred video size (say 1920 x 1080) and tick all the boxes. Does that help? If the only problem is the quality of the output file on rendering you can also specify various settings including kbps in the render dialogue. |
|
![]() |
![]() |
![]() |
#49 | |
Human being with feelings
Join Date: Feb 2013
Location: Germany
Posts: 231
|
![]()
Thanks a lot, jak! Great script!
![]() Quote:
|
|
![]() |
![]() |
![]() |
#50 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
![]()
Well thanks for nice comments on my video. Again, Jonathan, big thanks for helping us out with this code. One final video will use all of your recent tweaks of course!
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. |
![]() |
![]() |
![]() |
#51 |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]() Code:
// Grid of videos - automatically draws any number of videos from tracks with grid //@param 1:boss "Lead Track Number" 2 2 10 6 1 //@param 2:Nbig "Lead Grid Size" 1 1 9 5 1 //@param 3:bossexpand "Expand Lead Track" 0 0 1 0.5 0.01 //@param 4:bossfront "Lead to Front" 0 0 1 0.5 1 //@param 5:yposratio "Y Offset" 0 0 1 0.5 0.01 //@param 6:border "Grid Borders" 5 0 720 360 1 //@param 7:presasp "Stretch/Crop/Full" 0.5 0 1 0.5 0.5 //@param 8:portrait "Landscape/Sq/Portrait" 0 0 1 0.5 0.5 //@param 9:background "Backdrop Color/Video" 0 0 1 0.5 1 //@param 10:R "Backdrop Red" 0.1 0 1 0.5 0.01 //@param 11:G "Backdrop Green" 0.1 0 1 0.5 0.01 //@param 12:B "Backdrop Blue" 0.5 0 1 0.5 0.01 presasp == 0.5 ? (crop = 1; presasp = 0) : crop = 0; //presasp = 0.5 means crop videos aspect = project_w/project_h; // aspect ratio of project boss = boss - 1; // boss is now relative to video processor track ypos = yposratio*project_h; Ntracks = input_track_count(); // Number of video files boss>Ntracks ? boss = Ntracks; // If the lead video track set is greater than Ntracks use last ((boss>0)&(bossexpand==1)&(bossfront==1)) ? // if there is a lead track fully expanded on front then plot it ( crop == 1 ? //crop code ( input_info(input_track(boss-1),prewidth,preheight); project_w/project_h<prewidth/preheight ? //crop from width (wsrc_expand = (preheight*(project_w/project_h));//source width hsrc_expand = preheight;//source height xsrc_expand = (prewidth - wsrc_expand)/2;//source x ysrc_expand = 0;)//source y : //else crop from height (wsrc_expand = prewidth; hsrc_expand = (prewidth*(project_h/project_w)); xsrc_expand = 0; ysrc_expand = (preheight - hsrc_expand)/2;); ) : (xsrc_expand = 0;ysrc_expand = 0;wsrc_expand = prewidth; hsrc_expand = preheight); gfx_blit( input_track(boss-1), presasp,// preserve aspect ratio 0, 0, project_w, project_h, // output x, y, width and height xsrc_expand,ysrc_expand,wsrc_expand,hsrc_expand // source x, y, width and height ); ) : // if there isn't a lead track on front then do the rest of the code ( gfx_set(0); gfx_fillrect(0,0,project_w,project_h); x=0; // Counter for looping Ntracks > 0 // If there are video tracks ? count_tracks = Ntracks + Nbig^2 - 1 // Number of grid locations : //else count_tracks = 0 ; portrait == 0 ?// if landscape source videos ( xoffset = 0; border_h = border; border_w = border*aspect; height = project_h - border_h; width = project_w - border_w; cols = ceil(sqrt(count_tracks)); rows = ceil(count_tracks/cols); vHeight = height / cols - border_h; // Video height vWidth = width / cols - border_w; // Video Width ) : portrait == 0.5 ? //else if sqaure grid ( xoffset = 0; rows = ceil(sqrt(count_tracks/aspect)); cols = ceil(count_tracks/rows); border_h = border; border_w = border*aspect*rows/cols; height = project_h - border_h; width = project_w - border_w; vHeight = height / rows - border_h; vWidth = width / cols - border_w; ) : // else we assume portrait source videos ( border_h = border*aspect; border_w = border; height = project_h - border_h; width = project_w - border_w; rows = ceil((sqrt(count_tracks))/aspect); cols = ceil(count_tracks/rows); rows_alt = rows - 1; cols_alt = ceil(count_tracks/rows_alt); rows*(aspect^2)>cols_alt ? (cols = cols_alt;rows = rows_alt;); // if reducing rows by one is better rows<Nbig ? (rows = Nbig; cols = ceil(count_tracks/rows);); // if number of rows is less than Nbig vWidth = width / cols - border_w; vHeight = height / rows - border_h; aspect < (vHeight/vWidth) // if fitting to width ? (xoffset = 0; vHeight = vWidth*aspect;) : // else fitting to height (vWidth = vHeight / aspect; xoffset = (project_w - (cols*vWidth + (cols+1)*border_w))/2; ); ); Nbig>1 ? // if one of the videos is chosen to be big then put lead track in centre ( left_cols = floor((cols - Nbig)/2); // Number of columns before big central video top_rows = floor((rows - Nbig)/2); // Number of rows before big central video ) : // else all videos same size then lead tracks stays where it is ( top_rows = floor((boss-1)/cols); left_cols = (boss-1) % cols; ); background == 1 ? gfx_blit(0) // If background is 1 then show current track image or video as background : ( gfx_set(R,G,B,1); //Set color for background gfx_fillrect(0,0,project_w,project_h); // show color as background ); bossfront==0 // if the lead track is behind plot it first ? ( (boss-1 >= (cols*rows - cols)) // Is it the last line? ? ( lastLineCount = (count_tracks-1) % cols + 1; // Number of videos in last row lastLineOffset = (project_w - (lastLineCount*vWidth + (lastLineCount+1)*border_w))/2; xpos = left_cols*vWidth + lastLineOffset + border_w*left_cols; // x position last line ) : xpos = left_cols*vWidth + border_w*left_cols + xoffset; // x position non-last line input_info(input_track(boss-1),prewidth,preheight); xpos_expand = (1-bossexpand)*(border_w + xpos); ypos_expand = (1-bossexpand)*(border_h + vHeight*(top_rows) + border_h*(top_rows) + ypos); vWidth_expand = (1-bossexpand)*(Nbig*vWidth+(Nbig-1)*border_w) + bossexpand*project_w; vHeight_expand = (1-bossexpand)*(Nbig*vHeight+(Nbig-1)*border_h) + bossexpand*project_h; crop == 1 ? //crop code ( vWidth_expand/vHeight_expand<prewidth/preheight ? //crop from width (wsrc_expand = (preheight*(vWidth_expand/vHeight_expand));//source width hsrc_expand = preheight;//source height xsrc_expand = (prewidth - wsrc_expand)/2;//source x ysrc_expand = 0;)//source y : //else (wsrc_expand = prewidth; hsrc_expand = (prewidth*(vHeight_expand/vWidth_expand)); xsrc_expand = 0; ysrc_expand = (preheight - hsrc_expand)/2;); ) : ( xsrc_expand = 0;ysrc_expand = 0;wsrc_expand = prewidth; hsrc_expand = preheight; ); //plot code gfx_blit( input_track(boss-1), presasp, xpos_expand, ypos_expand, vWidth_expand, vHeight_expand, xsrc_expand,ysrc_expand,wsrc_expand,hsrc_expand ); ); bosscount = 0; // Counter for taking into account boss video loop(count_tracks, //main loop row = floor(x/cols); // Column position (starts at 0) col = x % cols; // Row position (starts at 0) lastLineCount = (count_tracks-1) % cols + 1; // Number of videos in last row lastLineOffset = (project_w - (lastLineCount*vWidth + (lastLineCount+1)*border_w))/2; ((x >= (cols*rows - cols))&(bosscount > Nbig^2 - 2)) // Is it the last line and after any big video? ? xpos = col*vWidth + lastLineOffset + border_w*col // last line : xpos = col*vWidth + border_w*col + xoffset // non-last line ; ((row>top_rows-1)&(col>left_cols-1)&(row<top_rows+Nbig)&(col<left_cols+Nbig)) ? // if the grid number is part of big video bosscount = bosscount + 1 // increment counter : // else x-bosscount+1 < Ntracks // if video exists ? (vidnum = x-bosscount+1; vidnum < boss ? vidnum = vidnum-1; //crop code input_info(input_track(vidnum),prewidth,preheight); vxpos = border_w + xpos; //x position vypos = border_h + vHeight*(row) + border_h*(row) + ypos; //y position crop == 1 ? //crop code ( vWidth/vHeight<prewidth/preheight ? //crop from width (wsrc = preheight*(vWidth/vHeight);//source width hsrc = preheight;//source height xsrc = (prewidth - wsrc)/2;//source x ysrc = 0;)//source y : //else (wsrc = prewidth; hsrc = prewidth*(vHeight/vWidth); xsrc = 0; ysrc = (preheight - hsrc)/2;); ) : (xsrc = 0; ysrc = 0; wsrc = prewidth; hsrc = preheight); //plot code gfx_blit( input_track(vidnum), presasp, vxpos, vypos, vWidth, vHeight, xsrc,ysrc,wsrc,hsrc ); ); x += 1; ); bossfront==1 //If the boss is in front of everything else plot it now ? ( (boss-1 >= (cols*rows - cols)) // Is it the last line? ? ( lastLineCount = (count_tracks-1) % cols + 1; // Number of videos in last row lastLineOffset = (project_w - (lastLineCount*vWidth + (lastLineCount+1)*border_w))/2; xpos = left_cols*vWidth + lastLineOffset + border_w*left_cols; // last line ) : //else not the last line xpos = left_cols*vWidth + border_w*left_cols + xoffset; // non-last line //crop code input_info(input_track(boss-1),prewidth,preheight); xpos_expand = (1-bossexpand)*(border_w + xpos); ypos_expand = (1-bossexpand)*(border_h + vHeight*(top_rows) + border_h*(top_rows) + ypos); vWidth_expand = (1-bossexpand)*(Nbig*vWidth+(Nbig-1)*border_w) + bossexpand*project_w; vHeight_expand = (1-bossexpand)*(Nbig*vHeight+(Nbig-1)*border_h) + bossexpand*project_h; crop == 1 ? //crop code ( vWidth_expand/vHeight_expand<prewidth/preheight ? //crop from width (wsrc_expand = (preheight*(vWidth_expand/vHeight_expand));//source width hsrc_expand = preheight;//source height xsrc_expand = (prewidth - wsrc_expand)/2;//source x ysrc_expand = 0;)//source y : //else (wsrc_expand = prewidth; hsrc_expand = (prewidth*(vHeight_expand/vWidth_expand)); xsrc_expand = 0; ysrc_expand = (preheight - hsrc_expand)/2;); ) : ( xsrc_expand = 0; ysrc_expand = 0; wsrc_expand = prewidth; hsrc_expand = preheight; ); gfx_blit( input_track(boss-1), presasp, xpos_expand, ypos_expand, vWidth_expand, vHeight_expand, xsrc_expand,ysrc_expand,wsrc_expand,hsrc_expand ); ); ); Last edited by jak352; 05-23-2020 at 05:27 PM. Reason: Get rid of tiny lines around square videos |
![]() |
![]() |
![]() |
#52 |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]()
The code in post 51 now has about all the features I was hoping for (I think). It now allows for automatically cropping the videos by using Fill/Crop/Full at 12 o'clock position (value 0.5) meaning you don't have to resize videos by ticking boxes in Project Settings or use opacity/zoom/pan unless you want to. Leaving it on value 0 means you don't preserve aspect ratio (stretching to fill) and value 1 means the entire video is fitted preserving aspect ratio (as before). There is a new option for having an approximately square grid (setting Landscape/Sq/Portrait at 12 o'clock position so value 0.5) and this is especially useful for projects where you crop both landscapes and portrait source videos. Values 0 and 1 are optimised for landscape and portrait source videos respectively (or vice versa if the project width and height are set to portrait mode for IGTV or whatever).
Just place this code in the Video Processor in track 1. Put the videos you want in the grid in tracks 2 onwards. If you want a background image or background video (visible for non-zero Grid Borders values when Expand Lead Track is less than 1) while still preserving the video on the lead track within the grid then put an image or video in track 1 and set Background Color/Video to 1. Leave Background Color/Video on 0 if you want to specify a backround color using the RGB knobs instead. Images count as if they are videos and image items can be resized to fill space (to ensure tracks don't hop around if you don't want them to for instance). The default size/shape of the export video is set by the video or image in track 1 or track 2 if there's no background image/video in track 1. If you get low quality or output of the wrong size I recommend going to File>Project Settings>Video and setting the preserved video size to what you want (such as 1920 x 1080) and you might find it helps to tick "Always resize video output...". It is possible to use automation on any of the parameters if you want to get fancy. Thanks for positive feedback and enjoy! |
![]() |
![]() |
![]() |
#53 | |
Human being with feelings
Join Date: Mar 2018
Posts: 7
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#54 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
![]()
Jak, hello. Just need some help please!
I would like lead video(s) to be displayed in the grid as well in order to keep things in place when switching them. How could I do that?
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. |
![]() |
![]() |
![]() |
#55 |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]()
It is possible to rewrite the code to have the boss video doubled so it appears twice (once small in the grid and once big). A workaround with the current code is to just keep a single track as the lead track (ie. keeping "Lead Track Number" constant) and copying and pasting bits of video items to fill that track (using the S button to split items for copying for instance). You can make sure the copies don't cause double sound by clicking Route and unticking master send in the lead track (unless you already separated audio and video).
|
![]() |
![]() |
![]() |
#56 |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]() Code:
// Grid of videos - automatically draws any number of videos from tracks with grid //@param 1:boss "Lead Track Number" 2 2 10 6 1 //@param 2:Nbig "Lead Grid Size" 1 1 9 5 1 //@param 3:bossexpand "Expand Lead Track" 0 0 1 0.5 0.01 //@param 4:bossfront "Lead to Front" 0 0 1 0.5 1 //@param 5:yposratio "Y Offset" 0 0 1 0.5 0.01 //@param 6:border "Grid Borders" 5 0 720 360 1 //@param 7:presasp "Stretch/Crop/Full" 0.5 0 1 0.5 0.5 //@param 8:portrait "Landscape/Sq/Portrait" 0 0 1 0.5 0.5 //@param 9:background "Backdrop Color/Video" 0 0 1 0.5 1 //@param 10:R "Backdrop Red" 0.1 0 1 0.5 0.01 //@param 11:G "Backdrop Green" 0.1 0 1 0.5 0.01 //@param 12:B "Backdrop Blue" 0.5 0 1 0.5 0.01 //@param 13:LeadDoubled "Lead Track Doubled" 0 0 1 0.5 1 presasp == 0.5 ? (crop = 1; presasp = 0) : crop = 0; //presasp = 0.5 means crop videos aspect = project_w/project_h; // aspect ratio of project boss = boss - 1; // boss is now relative to video processor track ypos = yposratio*project_h; Ntracks = input_track_count(); // Number of video files boss>Ntracks ? boss = Ntracks; // If the lead video track set is greater than Ntracks use last ((boss>0)&(bossexpand==1)&(bossfront==1)) ? // if there is a lead track fully expanded on front then plot it ( crop == 1 ? //crop code ( input_info(input_track(boss-1),prewidth,preheight); project_w/project_h<prewidth/preheight ? //crop from width (wsrc_expand = (preheight*(project_w/project_h));//source width hsrc_expand = preheight;//source height xsrc_expand = (prewidth - wsrc_expand)/2;//source x ysrc_expand = 0;)//source y : //else crop from height (wsrc_expand = prewidth; hsrc_expand = (prewidth*(project_h/project_w)); xsrc_expand = 0; ysrc_expand = (preheight - hsrc_expand)/2;); ) : (xsrc_expand = 0;ysrc_expand = 0;wsrc_expand = prewidth; hsrc_expand = preheight); gfx_blit( input_track(boss-1), presasp,// preserve aspect ratio 0, 0, project_w, project_h, // output x, y, width and height xsrc_expand,ysrc_expand,wsrc_expand,hsrc_expand // source x, y, width and height ); ) : // if there isn't a lead track on front then do the rest of the code ( gfx_set(0); gfx_fillrect(0,0,project_w,project_h); x=0; // Counter for looping Ntracks > 0 // If there are video tracks ? count_tracks = Ntracks + Nbig^2 - 1 + LeadDoubled// Number of grid locations : //else count_tracks = 0 ; portrait == 0 ?// if landscape source videos ( xoffset = 0; border_h = border; border_w = border*aspect; height = project_h - border_h; width = project_w - border_w; cols = ceil(sqrt(count_tracks)); rows = ceil(count_tracks/cols); vHeight = height / cols - border_h; // Video height vWidth = width / cols - border_w; // Video Width ) : portrait == 0.5 ? //else if sqaure grid ( xoffset = 0; rows = ceil(sqrt(count_tracks/aspect)); cols = ceil(count_tracks/rows); border_h = border; border_w = border*aspect*rows/cols; height = project_h - border_h; width = project_w - border_w; vHeight = height / rows - border_h; vWidth = width / cols - border_w; ) : // else we assume portrait source videos ( border_h = border*aspect; border_w = border; height = project_h - border_h; width = project_w - border_w; rows = ceil((sqrt(count_tracks))/aspect); cols = ceil(count_tracks/rows); rows_alt = rows - 1; cols_alt = ceil(count_tracks/rows_alt); rows*(aspect^2)>cols_alt ? (cols = cols_alt;rows = rows_alt;); // if reducing rows by one is better rows<Nbig ? (rows = Nbig; cols = ceil(count_tracks/rows);); // if number of rows is less than Nbig vWidth = width / cols - border_w; vHeight = height / rows - border_h; aspect < (vHeight/vWidth) // if fitting to width ? (xoffset = 0; vHeight = vWidth*aspect;) : // else fitting to height (vWidth = vHeight / aspect; xoffset = (project_w - (cols*vWidth + (cols+1)*border_w))/2; ); ); Nbig>1 ? // if one of the videos is chosen to be big then put lead track in centre ( left_cols = floor((cols - Nbig)/2); // Number of columns before big central video top_rows = floor((rows - Nbig)/2); // Number of rows before big central video ) : // else all videos same size then lead tracks stays where it is ( top_rows = floor((boss-1)/cols); left_cols = (boss-1) % cols; ); background == 1 ? gfx_blit(0) // If background is 1 then show current track image or video as background : ( gfx_set(R,G,B,1); //Set color for background gfx_fillrect(0,0,project_w,project_h); // show color as background ); bossfront==0 // if the lead track is behind plot it first ? ( (boss-1 >= (cols*rows - cols)) // Is it the last line? ? ( lastLineCount = (count_tracks-1) % cols + 1; // Number of videos in last row lastLineOffset = (project_w - (lastLineCount*vWidth + (lastLineCount+1)*border_w))/2; xpos = left_cols*vWidth + lastLineOffset + border_w*left_cols; // x position last line ) : xpos = left_cols*vWidth + border_w*left_cols + xoffset; // x position non-last line input_info(input_track(boss-1),prewidth,preheight); xpos_expand = (1-bossexpand)*(border_w + xpos); ypos_expand = (1-bossexpand)*(border_h + vHeight*(top_rows) + border_h*(top_rows) + ypos); vWidth_expand = (1-bossexpand)*(Nbig*vWidth+(Nbig-1)*border_w) + bossexpand*project_w; vHeight_expand = (1-bossexpand)*(Nbig*vHeight+(Nbig-1)*border_h) + bossexpand*project_h; crop == 1 ? //crop code ( vWidth_expand/vHeight_expand<prewidth/preheight ? //crop from width (wsrc_expand = (preheight*(vWidth_expand/vHeight_expand)); hsrc_expand = preheight; xsrc_expand = (prewidth - wsrc_expand)/2; ysrc_expand = 0;) : //else (wsrc_expand = prewidth; hsrc_expand = (prewidth*(vHeight_expand/vWidth_expand)); xsrc_expand = 0; ysrc_expand = (preheight - hsrc_expand)/2;); ) : ( xsrc_expand = 0;ysrc_expand = 0;wsrc_expand = prewidth; hsrc_expand = preheight; ); //plot code gfx_blit( input_track(boss-1), presasp, xpos_expand, ypos_expand, vWidth_expand, vHeight_expand, xsrc_expand,ysrc_expand,wsrc_expand,hsrc_expand ); ); bosscount = 0; // Counter for taking into account boss video loop(count_tracks + LeadDoubled, //main loop row = floor(x/cols); // Column position (starts at 0) col = x % cols; // Row position (starts at 0) lastLineCount = (count_tracks-1) % cols + 1; // Number of videos in last row lastLineOffset = (project_w - (lastLineCount*vWidth + (lastLineCount+1)*border_w))/2; ((x >= (cols*rows - cols))&(bosscount > Nbig^2 - 2)) // Is it the last line and after any big video? ? xpos = col*vWidth + lastLineOffset + border_w*col // last line : xpos = col*vWidth + border_w*col + xoffset // non-last line ; ((row>top_rows-1)&(col>left_cols-1)&(row<top_rows+Nbig)&(col<left_cols+Nbig)) ? // if the grid number is part of big video bosscount = bosscount + 1 // increment counter : // else x-bosscount+1-LeadDoubled < Ntracks // if video exists ? (vidnum = x-bosscount+1; ((vidnum < boss) | (LeadDoubled)) ? vidnum = vidnum - 1; //crop code input_info(input_track(vidnum),prewidth,preheight);//get dimensions vxpos = border_w + xpos; //x position vypos = border_h + vHeight*(row) + border_h*(row) + ypos; //y position crop == 1 ? //crop code ( vWidth/vHeight<prewidth/preheight ? //crop from width (wsrc = preheight*(vWidth/vHeight);//source width hsrc = preheight;//source height xsrc = (prewidth - wsrc)/2;//source x ysrc = 0;)//source y : //else (wsrc = prewidth; hsrc = prewidth*(vHeight/vWidth); xsrc = 0; ysrc = (preheight - hsrc)/2;); ) : (xsrc = 0; ysrc = 0; wsrc = prewidth; hsrc = preheight); //plot code gfx_blit( input_track(vidnum), presasp, vxpos, vypos, vWidth, vHeight, xsrc,ysrc,wsrc,hsrc ); ); x += 1; ); bossfront==1 //If the boss is in front plot ? ( (boss-1 >= (cols*rows - cols)) // Is it the last line? ? ( lastLineCount = (count_tracks-1) % cols + 1; // Number of videos in last row lastLineOffset = (project_w - (lastLineCount*vWidth + (lastLineCount+1)*border_w))/2; xpos = left_cols*vWidth + lastLineOffset + border_w*left_cols; // last line ) : //else not the last line xpos = left_cols*vWidth + border_w*left_cols + xoffset; // non-last line //crop code input_info(input_track(boss-1),prewidth,preheight); xpos_expand = (1-bossexpand)*(border_w + xpos); ypos_expand = (1-bossexpand)*(border_h + vHeight*(top_rows) + border_h*(top_rows) + ypos); vWidth_expand = (1-bossexpand)*(Nbig*vWidth+(Nbig-1)*border_w) + bossexpand*project_w; vHeight_expand = (1-bossexpand)*(Nbig*vHeight+(Nbig-1)*border_h) + bossexpand*project_h; crop == 1 ? //crop code ( vWidth_expand/vHeight_expand<prewidth/preheight ? //crop from width (wsrc_expand = (preheight*(vWidth_expand/vHeight_expand)); hsrc_expand = preheight; xsrc_expand = (prewidth - wsrc_expand)/2; ysrc_expand = 0;) : //else (wsrc_expand = prewidth; hsrc_expand = (prewidth*(vHeight_expand/vWidth_expand)); xsrc_expand = 0; ysrc_expand = (preheight - hsrc_expand)/2;); ) : ( xsrc_expand = 0; ysrc_expand = 0; wsrc_expand = prewidth; hsrc_expand = preheight; ); gfx_blit( input_track(boss-1), presasp, xpos_expand, ypos_expand, vWidth_expand, vHeight_expand, xsrc_expand,ysrc_expand,wsrc_expand,hsrc_expand ); ); ); |
![]() |
![]() |
![]() |
#57 |
Human being with feelings
Join Date: Apr 2010
Posts: 1,247
|
![]()
Thanks Jonathan!
I saved both presets. It might be the problem was my processor, but above 24 fps the video was flicking when grid with 20+ videos was showed. Here is the outcome - hope you like it. https://youtu.be/N0mWe3aBcss
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music. Last edited by urednik; 06-03-2020 at 01:15 PM. |
![]() |
![]() |
![]() |
#58 |
Human being with feelings
Join Date: May 2014
Posts: 15
|
![]()
Thank you for sharing this code Jonathan. It is very helpful and very appreciated.
@urednik wow, that horn video was awesome! -Dan |
![]() |
![]() |
![]() |
#59 | |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#60 |
Human being with feelings
Join Date: Jun 2020
Posts: 2
|
![]()
This script will save me HOURS of video editing. I've been doing 2 choir "performances" weekly since lockdown began in the UK, audio in Reaper, video in LumaFusion... I had no idea Reaper could do video, let alone this wonderful automatic grid. I reckon it's already saved me 5-6 hours since I discovered it on Monday. Wonderful!
|
![]() |
![]() |
![]() |
#61 |
Human being with feelings
Join Date: May 2020
Location: Spain
Posts: 22
|
![]()
Thank you so much for this jak352. This is just AMAZING! It saves lot of time! And its some kind of feature that every dedicate video editing software would LOVE to have. IMHO this FX makes the Reaper video x2349845 times better!
Thanks again! |
![]() |
![]() |
![]() |
#62 |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]()
Thanks people! I'm delighted to say that my code is now built into Reaper under Public Domain license from today with the release of the "REAPER 6.12c: Black Lives Matter" update. It is to be found in the Video Processor as the "Combine: Grid of videos" preset! You won't need to copy and paste the code from here any more!
|
![]() |
![]() |
![]() |
#63 |
Human being with feelings
Join Date: Apr 2011
Posts: 3,434
|
![]()
Well done! It deserves to be there!
![]()
__________________
Most of my scripts can be found in ReaPack. If you find them useful, a donation would be greatly appreciated! Thank you! :) |
![]() |
![]() |
![]() |
#64 |
Human being with feelings
Join Date: Nov 2018
Posts: 61
|
![]()
Congrats! Awesome work, and great contribution to the community and the DAW.
|
![]() |
![]() |
![]() |
#65 |
Human being with feelings
Join Date: Jun 2020
Location: Bahía Blanca, Argentina
Posts: 12
|
![]()
I love this preset but I have a problem I don't know how to fix.
One of the things I like is the ability of the preset to subdivide the grid according to the number of simultaneous items playing at a certain moment. However, if on a track I have video effects (even something like "Item fades affect video") that track is included in the subdivision even if it doesn't have items. (I also tried "Apply track FX only where track has video items" but it didn't work.) Is there a way to avoid a certain track being included in the grid, besides automating the bypassing of its video effects or muting the track? |
![]() |
![]() |
![]() |
#66 | |
Human being with feelings
Join Date: Apr 2017
Location: Scotland, UK
Posts: 56
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#67 | |
Human being with feelings
Join Date: Jun 2020
Location: Bahía Blanca, Argentina
Posts: 12
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#68 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 578
|
![]()
For reason of convenience in several projects, I often whished the scope of tracks considered by the fx/preset be limited to subtracks of the track where it is applied. That would simplify making sub grids for different sections of my choir. I currently have to render as separate projects. I tried to crack the code but my knowledge of APIs and my experience with this environment are too limited to succeed in the short term. Any better suggestions? Thx.
|
![]() |
![]() |
![]() |
#69 |
Human being with feelings
Join Date: Sep 2020
Location: Portugal
Posts: 110
|
![]()
Inspired by this thread I came up with a workflow for multicam video editing in REAPER that is very similar to what you’d find in video editors like Premiere and Final Cut. It’s actually pretty simple and in the video below I show not only how to use it, but also how it works, with a code review of the Video processors and ReaScripts involved. It works well in conjunction with the Automixer for video (https://forum.cockos.com/showthread.php?t=244718), though it may be used without it, of course. Let me know what you think:
Last edited by leafac; 12-09-2020 at 05:35 PM. |
![]() |
![]() |
![]() |
#70 | |
Human being with feelings
Join Date: Dec 2014
Posts: 516
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#71 |
Human being with feelings
Join Date: Sep 2020
Location: Portugal
Posts: 110
|
![]()
Oops, thanks for mentioning it. I fixed the link above.
|
![]() |
![]() |
![]() |
#72 | |
Human being with feelings
Join Date: Dec 2012
Posts: 7,122
|
![]() Quote:
But then you want to take those sub-grid tracks and combine them into the final “grid of grids” and for that, you can’t just let it loop through doing each track and then the next. Instead you need to tell it which tracks to look at explicitly. Now, if the distance from one sub grid track to the next is constant - there’s the sub-grid track, then the 4 tracks that are that grid, the next sub-grid followed by 4 tracks, and so on - you can probably still use the loop, but make it’s loop counter variable increment by more than 1 (in this case, we’d want 5) each time. Otherwise, you kind of have to do it more explicitly. Don’t use the loop, but actually just do the thing inside the loop over and over again. IDK if I’m explaining very clearly, but basically what you’re asking for can be done, you just need to override at least some of the automagical parts of this code. It would be quick and easy to add a parameter that sets the maximum depth. Like count the tracks up to whatever number we set for that parameter. One could also pretty easily add a parameter that tells it how many tracks to skip in each loop for the case where your sub-grids are all the same distance apart. With a little more work, you could probably even nest the loop inside itself and have this one preset just do the whole thing - make a sub-grid of every X tracks, then make a grid of those sub-grids. It becomes much more difficult to have a “general use” preset where the sub-grids are themselves made of an arbitrary number of videos and/or at arbitrary spacing one to the next. Edit - much of this depends on knowing which input tracks we want to work with. That is, at some point we’re going to do something involving input_track(x), and we need to know what value to set for x. I have run into issues, and I don’t know for sure why (maybe something stupid I’m doing in my own presets?) where it’s not quite as simple as just manually counting tracks below this one starting at 0. Input in that number, but end up with the wrong image, and end up basically just poking around in the dark until I actually find the one I want. THAT is my main use for this preset, and frankly I am so grateful that it exists just for that reason. I put this on the track I’m working on, it shows me the actual input tracks in order, and I can count the images on the grid to find x for whichever one I want. I’d kind of love if it put the number either over or next to each image so I don’t even have to count, and maybe one day I’ll get around to making that version, but for now it makes a lot of things a whole lot easier for me.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika Last edited by ashcat_lt; 12-12-2020 at 12:24 PM. |
|
![]() |
![]() |
![]() |
#73 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,122
|
![]()
Edit - Added a way to skip N number of tracks between the ones that actually show on the display in order to hopefully help with the "grid of grids" thing. If you stack your tracks up like:
subgrid parent -child -child -child AND all of those subgrid parents have the same number of children, this will work. You can always pad with dummy tracks as long as they have even a static image on them. Basically put one of these on each parent, and set it's maximum depth to only cover its children, then put another one of these above all of the parents and tell it to skip however many children under each parent. Couple quick tweaks to the version I had in my install. I added Max Track Depth so that you can tell it where to stop. Set this to 0 if you want it to be automatic like before. Also, I didn't understand why the Lead Track Number started at 2 but then subtracted that out from just about every reference in the code, so now it starts at 0 (the first track after this one) instead. It was too many characters to post here, so I uploaded it to the stash: https://stash.reaper.fm/v/40795/ash%...0of%20vids.txt Edit again - Here's a quick screen cap of a grid of grids using one of these on each parent and one above all to put them all together. Note that while each subgrid parent does need to have the same number of children, you don't have to display all of them. Each of these folders has 4 children, but the second one only shows its first 2.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika Last edited by ashcat_lt; 12-15-2020 at 01:43 PM. |
![]() |
![]() |
![]() |
#74 | |
Human being with feelings
Join Date: Nov 2014
Location: Can Tho - Viet Nam
Posts: 281
|
![]() Quote:
__________________
NK Recording Studio Email: lachinhan@gmail.com or admin@thuamninhkieu.com Website:nkpro.top and ntmusicpro.com |
|
![]() |
![]() |
![]() |
#75 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,122
|
![]()
Pretty much as described in the whole big long post that you didn’t really have to quote in its entirety.
![]() I understand there may be a language barrier, but I don’t really know how to help you without repeating myself. If you have specific questions on how to use it, I’d be happy to address them, but you’ve got to give me something to work with.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika |
![]() |
![]() |
![]() |
#76 | |
Human being with feelings
Join Date: Nov 2014
Location: Can Tho - Viet Nam
Posts: 281
|
![]() Quote:
subgrid parent -child -child -child everything is fine now. Thank you ![]()
__________________
NK Recording Studio Email: lachinhan@gmail.com or admin@thuamninhkieu.com Website:nkpro.top and ntmusicpro.com |
|
![]() |
![]() |
![]() |
#77 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,122
|
![]()
@lachinhan - Great! I hope you find it useful. I personally may not ever use it, but somebody above here was asking for it, and it was a couple of easy hacks, and I wanted to help.
![]()
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika |
![]() |
![]() |
![]() |
#78 |
Human being with feelings
Join Date: Feb 2017
Location: London
Posts: 26
|
![]()
So useful, thank you!
I used it to make something fun: . Here are a few ideas I used to get out of the strict orderly grid structure: 1) Make one video in the grid twice as wide as the others, without making it the lead track. This can be useful for long things such as bass guitars (see the bottom right of my video thumbnail). Do this by turning off grid borders, copying your video onto 2 consecutive tracks, then using zoom and X offset (equal offsets in opposite directions) to line them up. I guess you could do a similar thing wherever you want a video to fit in neatly while having a different aspect ratio to the other videos. 2) Render multiple videos together (into a grid, or whatever), then use that rendered video as 'one' video in the grid. This can be useful when you want some videos to take up less space (e.g. the egg shakers in my video).
__________________
Experimental dreampop with hundreds of layers, as Callum Martin-Moore on Spotify, Bandcamp, Facebook, Linktree! Last edited by SawdustAndDiamonds; 03-27-2021 at 01:23 PM. Reason: formatting |
![]() |
![]() |
![]() |
#79 | |
Human being with feelings
Join Date: Dec 2012
Posts: 13,321
|
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#80 |
Human being with feelings
Join Date: Feb 2017
Location: Brussels
Posts: 132
|
![]()
It's such a fantastic script!
Really thankful for this ![]() Used it already 2 times for a video. This is one I made yesterday: https://www.instagram.com/p/CazJZRZgCHk/ However, I'm wondering how to tweak or use the script for placing multiple videos above each other, like a Reel on Instagram (or a TikTok video), which would be something like 1080 x 1920 pixels. How to put 2-3 or more landscape videos aligned above each other so it results in a portrait size video? Last edited by bulevardi; 03-12-2022 at 09:51 AM. |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|