2 Replies Latest reply on May 18, 2016 7:26 PM by Rick Gerard

# Splitting up footage into four even quadrants

Hello world,

I am working on a project where I am getting a single 4k .mov file. This file is four video sources from a single camera feed. It looks something like this http://imgur.com/ds1xueE

My goal is to create a script that takes this single .mov file and splits it up into four different compositions in after effects using a script. Can someone give me advice on where to start or what the best method of accomplishing this task will be? Note, I will be doing this a lot, so If I can automate part of the process that would be amazing.

• Adobe After Effects CS 6
• Windows 10 64 bit
• Relevant hardware (16gb RAM, Intel i7 @ 3.50GHz, NVIDIA GTX 780)
• ###### 1. Re: Splitting up footage into four even quadrants

Since posting this approximately 15 minutes ago I have found an amazing solution over at SplitImage - aescripts + aeplugins - aescripts.com

I hope this helps anyone else with this problem!

• ###### 2. Re: Splitting up footage into four even quadrants

I just do it mathematically. You can divide values in the timeline. For example if the scale was at 75% for X and Y and the scale value was locked so it stayed proportional you could type 75/2 in either the X or y field and scale the layer to 1/4 its original size.

You could also use multiplication or division and create a solid to use as a guide. If you were working with a standard 1920 X 1080 comp when you create a new solid just click constrain proportions and then select one of the values, use the right arrow key to move to the end and type  /2 and bingo... a new solid that is 1/4 the size of the comp.

If you wanted to do the same for position you have to think a little harder but it still works just fine. For example if your layer's position was originally 960, 540 you could divide the 960 by 2 and the 540 by 2 and end up with your new layer positioned in the upper right corner.

That would give you 480 and 280 for the new position. You could then add those values to copies of your solid layer and get things to work out easily.

A more automatic solution is to use an expression for position that looks at the layer's original size, the scale value for the layer, the height and width of the comp, the index of the layer and then you could apply that expression to any layer, scale the layer to any scale you want and then duplicate it as many times as you want and it would arrange the layers in a perfect mosaic. Add a couple of sliders to the mix and you could adjust the offset, number of rows, number of columns and even animate the layers into position. I have an animation preset that does exactly that. It just uses the math that I explained and allows you to set as many layers as you want into a uniform distribution in the comp panel. EZ PZ.

If you add a couple of sliders to the first layer and name it DL Controller then add this expression to all the duplicates you can do a bunch o fun stuff. If's all based on simple math. Name your sliders numCol and sp and have fun. All the layers will evenly distribute themselves behind and below the DL controller layer.

// Find Layer Size and calculate new size if scaled

sf = scale - [100, 100];

xSize = thisLayer.sourceRectAtTime().width + (thisLayer.sourceRectAtTime().width * sf[0]/100);

ySize = thisLayer.sourceRectAtTime().height + (thisLayer.sourceRectAtTime().height * sf[1]/100);

realSize = [xSize, ySize];

// Set number of columns

cn = Math.floor(thisComp.layer("DL controller").effect("numCol")("Slider"));

if (cn <= 0){

numCol = 1}

else numCol = (cn);

// Set positions

cp = thisComp.layer("DL controller").position;

sp = thisComp.layer("DL controller").effect("sp")("Slider");

if (sp == 0) {

sp = 0}

else sp = sp;

col = (thisLayer.index-1) % numCol;

row = Math.floor((thisLayer.index-1)/numCol);

pos = [cp[0] + (sp + realSize[0]) * col,  cp[1] + (row * sp) + realSize[1] * row];