help modifying script?

k7107 wrote on 12/23/2004, 9:57 AM
Hi.

I'm hoping someone out there with more expertise than I can help me modify
a script I've pieced together. I'm working on a project requiring that I end up
with a media file that has 5 seconds of silence and no video placed every 10 seconds (imagine a roll of postage stamps split apart at the perforations). The script I have here puts markers every 10 seconds, but does not insert a split, nor does it insert 5 seconds of blank space at these splits. I'm sure someone out there with scripting experience would find this to be an easy task. Here's the script and thanks in advance for your help:

/**
* This script will add markers at the specified interval
*
* Written By: Edward Troxel
* www.jetdv.com/tts
* Modified: 09-19-2003
**/

import System;
import System.IO;
import System.Windows.Forms;
import
SonicFoundry.Vegas;

//Modify the timecode on the next line to change the interval.
var Interval = "00:00:10:00";

var zd7f2e30bc7=
Interval;


try{
var z75282fe324:
Marker;
var za684dd0854:Timecode=new Timecode(zd7f2e30bc7);
var z88cf708b9e:
Timecode=za684dd0854;
var z0174fc9e78:Timecode=Vegas.Project.Length;

while(
z88cf708b9e<z0174fc9e78){

z75282fe324=new Marker(z88cf708b9e);
Vegas.Project.
Markers.Add(z75282fe324);
z88cf708b9e=z88cf708b9e+za684dd0854;
}



}catch(z744b6e974a){
MessageBox.Show(z744b6e974a);
}


var fiveSecondGap : Timecode = new Timecode("00:00:05.00");

try
{
// step through all selected video events:
for (var track in Vegas.Project.Tracks)
{
if( !track.Selected) continue;
var tracktime = fiveSecondGap;
for (var evnt in track.Events)
{
evnt.AdjustStartLength(tracktime, evnt.Length, true);
tracktime = tracktime + evnt.Length + fiveSecondGap;
}
}
}
catch (errorMsg)
{
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}




Thanks.

Kurt E. Freeman
Center for Human Services Research
University at Albany, SUNY

Comments

jetdv wrote on 12/23/2004, 1:35 PM
Kurt, is this one great big clip? Or several 10 second clips? If it's several 10 second clips already, the Gap Wizard will perform that function for you with no modifications.

If it's one great big clip then, instead of placing markers, you should simply split the clip at those points. Then you can run through a second routine (like Gap Wizard) which will add the needed gaps.
k7107 wrote on 12/28/2004, 7:49 AM
Hi. Thanks for responding. It's one big clip that needs to be chopped into 10 second segments with 5 seconds blank space between. A little background: My work group and I are analyzing mother-child interaction using a program called the Observer (by Noldus). This program allows us to code aspects of subjects' behavior based on what we see them doing on the video. Trouble is that the Observer doesn't allow the video to automatically pause so that our coders have time to assign the codes they wish to use. So, the solution I've developed is to "fool" the program by editing the video clips to include the visual effect of a pause, i.e., a blank screen lasting for 5 seconds.

The script included in my original message includes code for inserting markers and I've been using it because I don't know how to alter it to insert splits. Any help in this direction will be greatly appreciated. Also, if you could let me know where I can get Gap Wizard, that'd be great too.

Thanks again.

Kurt
jetdv wrote on 12/28/2004, 11:29 AM
Gap Wizard is a part of Excalibur (click on the Excalibur link here) It will definitely separate the pieces for you creating the gap.

Excalibur also has the Marker Wizard which will place markers on the timeline per your specification (i.e. one every 10 seconds).

Does the audio need to be split too? Because with just a little trick the Multi-Cam Wizard in Excalbur can also be used to split the video track at each marker location but the audio track will be untouched.

If you don't need the audio to follow, you could use the following procedure:

1) Add the video to the timeline
2) Name the video track (I used "1")
3) Run the Marker Wizard to place markers every 10 seconds
4) Run the Multi-Cam Wizard which will split the video track at each marker location (normally it would place the selected cam on the "Master" track but we did not name the markers)
5) Delete the "Master" track (since it's not really needed)
6) Run Gap Wizard to place a 5 second gap between each of the split pieces.

If you need audio too, the process is a little more complicated simply because Multi-Cam does not touch the audio. At this point, without writing some more code, there would be a couple of options:
1) Manually split the audio at each video split
2) Run the Orphan Wizard (another tool in Excalibur) for each split event.

Edward
k7107 wrote on 1/5/2005, 1:07 PM
Thanks for the help. I just need to see if I can get the budget opened for the software.

Kurt