Create stereo subclips for left & right eye videos

donde wrote on 6/28/2014, 10:52 PM
/**
** Joins all project files ending in -l.ext with -r.ext files as stereo subclips.
** Import all your Left and Right media files into the project before running.
** The file .ext can be .avi, .mp4 or anything 3 character extent.
** NOTE: Only works when your Project preferences says the project is
** a Stereoscopic one. Don deCourcelle 6/28/2014
**/

using System;
using Sony.Vegas;

class EntryPoint
{

public void FromVegas(Vegas vegas)
{

foreach (Media media in vegas.Project.MediaPool)
{
// only try if the media object has video
if (!media.HasVideo())
continue;
// 012345678901234
int len; // filename-l.mp4 (example has 14 chars)
len = (media.FilePath).Length;

// Get the 3 chars before the .ext ("-l.")
String tag = (media.FilePath).Substring(len-6,3);
if( tag.Equals("-l.") )
{
// we found the left file of stereo pair
// build the right side file name...
String right =
(media.FilePath).Substring(0,len-6);
right += "-r." + // last 3... the ext
(media.FilePath).Substring(len-3);
Media rightFile = new Media( right );

// Now combine them into a subclip
if( vegas.Project.MediaPool.CanCreateStereo3DSubclip(
media, rightFile) )
{
vegas.Project.MediaPool.CreateStereo3DSubclip(
media, rightFile);
}
}

}

}

}

Comments

3d87c4 wrote on 11/14/2014, 5:37 PM
1) Vegas does this already for GoPro 3D clips named 3D_L####.mp4 and 3D_R####.mp4. Where #### are identical numbers

2) My new GoPro 3+ black 3D system doesn't name the files consistently so #### isn't the same. Can the script be modified to accommodate different numbers for the left and right clips?

3) GoPro support says their Studio program identifies matching left and right clips using metadata in the clips themselves, any chance a script can be written to do this?

Del XPS 17 laptop

Processor    13th Gen Intel(R) Core(TM) i9-13900H   2.60 GHz
Installed RAM    32.0 GB (31.7 GB usable)
System type    64-bit operating system, x64-based processor
Pen and touch    Touch support with 10 touch points

Edition    Windows 11 Pro
Version    22H2
Installed on    ‎6/‎8/‎2023
OS build    22621.1848
Experience    Windows Feature Experience Pack 1000.22642.1000.0

NVIDIA GeForce RTX 4070 Laptop GPU
Driver Version: 31.0.15.2857
8GB memory