Script to trim event front end at DVinfo.net
DV Info Net

Go Back   DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...
Register FAQ Today's Posts Buyer's Guides

What Happens in Vegas...
...stays in Vegas! This PC-based editing app is a safe bet with these tips.

Reply
 
Thread Tools Search this Thread
Old November 28th, 2013, 02:58 PM   #1
New Boot
 
Join Date: Sep 2010
Location: Petaluma, CA
Posts: 14
Script to trim event front end

Looking for a script to trim just the leading edge of events to compensate for the audio lag in AVCHD files coming out of my DSLR (GH-3). These particular clips are all 1080p60 at 24Mbps. Using Vegas Pro 12.0, latest build.

Ed Troxel, if you're listening, the Set Duration script in Excalibur would do the trick, except it trims the end of each event, and there's no apparent way to tell it to trim the leading edge. The old Trim Front and Back.js script doesn't appear to work with Vegas 12.

For those who may want to offer other suggestions,I have already attempted the following, with no success:
- using two different TS merge Utilities (resulting files are the correct size, but Vegas can only see about the first eight seconds of each one, regardless of the overall length.) This technique normally works very well, but this is the first time I've tried it on 60p files at this bit rate.
- Short overlaps when placing the clips on the timeline (this would work if it were not for the fact that a significant number of clips have a 17 frame dead spot at the beginning, which is too long to do a quick dissolve without it being noticeable.)
- Conversion then merge into a large QuickTime file (file is seen by Vegas just fine, but has audio gaps embedded within it beginning of each former clip.)
- importing of clips directly from camera using Sony Vegas Device Manager (clips still have missing audio and take 10 times as long to import.)
- Importing of clips from SD card using Panasonic's import utility (clips still are missing audio and import directory is now choked with additional mysterious files.)

TIA,
Alan

Last edited by Alan Fitch; November 28th, 2013 at 03:02 PM. Reason: additional information
Alan Fitch is offline   Reply With Quote
Old November 28th, 2013, 04:34 PM   #2
Trustee
 
Join Date: Mar 2004
Location: upper hunter, australia
Posts: 1,410
Re: Script to trim event front end

how are you importing the files in to vegas?
__________________
www.lesliewand.com.au
Leslie Wand is offline   Reply With Quote
Old November 28th, 2013, 05:02 PM   #3
New Boot
 
Join Date: Sep 2010
Location: Petaluma, CA
Posts: 14
Re: Script to trim event front end

In addition to the ways mentioned in my posting, there is the standard way as well. The other import methods don't apply as it's not coming in from a camera DVD or in MXF format.

I'm a Vegas user since Version 3, so am very familiar with the program.

Alan
Alan Fitch is offline   Reply With Quote
Old November 28th, 2013, 05:53 PM   #4
Trustee
 
Join Date: Mar 2004
Location: upper hunter, australia
Posts: 1,410
Re: Script to trim event front end

sorry alan, missed your explanation of importing...

you might try posing the same question over at scs forum - i know there's at least three people there shooting with gh3.
__________________
www.lesliewand.com.au
Leslie Wand is offline   Reply With Quote
Old November 29th, 2013, 12:24 AM   #5
Old Boot
 
Join Date: Aug 2002
Location: London UK
Posts: 3,633
Re: Script to trim event front end

Alan, what format is the Hard Drive you are capturing the footage to? FAT32 or NTFS?

Grazie
Graham Bernard is offline   Reply With Quote
Old November 29th, 2013, 05:38 AM   #6
Regular Crew
 
Join Date: Apr 2007
Location: Woking, England
Posts: 116
Re: Script to trim event front end

Alan, if you' want to ask Edward Troxel about Excalibur why not try the jetdv.com forum?

Richard
Richard Jones is offline   Reply With Quote
Old November 29th, 2013, 08:22 AM   #7
Inner Circle
 
Join Date: May 2005
Location: Windsor, ON Canada
Posts: 2,770
Re: Script to trim event front end

Edward posted a script called "ChopOffFront.js" on the Sony scripting forum some time ago that may do what you need.
Delete n frames at event boundaries

edit: I just tried it and got 3 errors. My guess is that it's because the script is very old and Sony has changed a lot of things over time with respect to the scripting.

Last edited by Mike Kujbida; November 29th, 2013 at 09:52 AM.
Mike Kujbida is offline   Reply With Quote
Old December 2nd, 2013, 02:31 PM   #8
Sponsor: JET DV
 
Join Date: Dec 2001
Location: Southern Illinois
Posts: 7,953
Re: Script to trim event front end

Take a look at this old script: TrimFront+Back.js (also posted on your message at jetdv.com)

Code:
/**
 * This script will trim the front and back for all selected events.
 *
 * Written By: Edward Troxel
 * Copyright 2004 - JETDV Scripts
 * Modified: 08-03-2005
 **/

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


var trimAmt = new Timecode("00:00:01:00");


try {

  //Go through the list of Tracks
  var trackEnum = new Enumerator(Vegas.Project.Tracks);
  while (!trackEnum.atEnd()) {
    var track : Track = Track(trackEnum.item());

    //Go through the list of Events
    var eventEnum = new Enumerator(track.Events);
    while (!eventEnum.atEnd()) {
      var evnt : TrackEvent = TrackEvent(eventEnum.item());

      if (evnt.Selected) {
        var dStart = evnt.Start + trimAmt;
        var dLength = evnt.Length;

   //Get current take offset
   var tke = evnt.ActiveTake;
   var tkeoffset = tke.Offset;
   tkeoffset = tkeoffset + trimAmt;
        evnt.Start = dStart;
   tke.Offset = tkeoffset;
   
        dLength = dLength - trimAmt - trimAmt; //Remove the second - trimAmt to trim only the front.
        evnt.Length = new Timecode(dLength);   
      }
      eventEnum.moveNext();
    }
    trackEnum.moveNext();
  }


} catch (e) {
    MessageBox.Show(e);
}
Edward Troxel is offline   Reply
Reply

DV Info Net refers all where-to-buy and where-to-rent questions exclusively to these trusted full line dealers and rental houses...

B&H Photo Video
(866) 521-7381
New York, NY USA

Scan Computers Int. Ltd.
+44 0871-472-4747
Bolton, Lancashire UK


DV Info Net also encourages you to support local businesses and buy from an authorized dealer in your neighborhood.
  You are here: DV Info Net > Windows / PC Post Production Solutions > What Happens in Vegas...


 



All times are GMT -6. The time now is 01:20 AM.


DV Info Net -- Real Names, Real People, Real Info!
1998-2024 The Digital Video Information Network