DV Info Net

DV Info Net (https://www.dvinfo.net/forum/)
-   What Happens in Vegas... (https://www.dvinfo.net/forum/what-happens-vegas/)
-   -   Script to trim event front end (https://www.dvinfo.net/forum/what-happens-vegas/520332-script-trim-event-front-end.html)

Alan Fitch November 28th, 2013 02:58 PM

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

Leslie Wand November 28th, 2013 04:34 PM

Re: Script to trim event front end
 
how are you importing the files in to vegas?

Alan Fitch November 28th, 2013 05:02 PM

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

Leslie Wand November 28th, 2013 05:53 PM

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.

Graham Bernard November 29th, 2013 12:24 AM

Re: Script to trim event front end
 
Alan, what format is the Hard Drive you are capturing the footage to? FAT32 or NTFS?

Grazie

Richard Jones November 29th, 2013 05:38 AM

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

Mike Kujbida November 29th, 2013 08:22 AM

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.

Edward Troxel December 2nd, 2013 02:31 PM

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);
}



All times are GMT -6. The time now is 03:15 AM.

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