Comments

malowz wrote on 7/15/2012, 6:20 PM
thumbnail script (tnx to Edward Troxel):

/**
* This script will create a thumbnail of all events on the selected track
* They will be placed in the "StoragePath" subdirectory and stored in JPEG format.
* The base name of the thumbnail is the name of the original file.
*
* Written By: Edward Troxel
* www.jetdv.com/tts
* Modified: 05-01-2003
**/


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



try {
// The first thing this script does is save off the preview & project
// settings that will be set later. This is so they can be restored
// after the script is complete.
var origPreviewRenderQuality = Vegas.Project.Preview.RenderQuality;
var origPreviewFillSize = Vegas.Project.Preview.FullSize;
var origFieldOrder = Vegas.Project.Video.FieldOrder;
var origProjectDeinterlaceMethod = Vegas.Project.Video.DeinterlaceMethod;
var currentTime = Vegas.Cursor;


//Enter the path here - below represents D:\VMedia. NOTE: \\ = \ when entering path names!
var StoragePath = "D:\\VMedia"
var OffSet = new Timecode("00:00:00:10");

var track = FindSelectedTrack();
if (null == track)
throw "no selected track";

// Set the preview quality and size.
Vegas.Project.Preview.RenderQuality = VideoRenderQuality.Best;
Vegas.Project.Preview.FullSize = true;

// Set the field order and deinterlace method
Vegas.Project.Video.FieldOrder = VideoFieldOrder.ProgressiveScan;
Vegas.Project.Video.DeinterlaceMethod = VideoDeinterlaceMethod.InterpolateFields;

//do all events on the selected track
var eventEnum = new Enumerator(track.Events);
while (!eventEnum.atEnd()) {
var evnt : TrackEvent = TrackEvent(eventEnum.item());

var MyFilePath = evnt.ActiveTake.MediaPath;
var extFileName = Path.GetFileName(MyFilePath);
var baseFileName = Path.GetFileNameWithoutExtension(extFileName);
var FullFileName = Path.Combine(StoragePath, baseFileName + ".jpg")

// save a snapshot. The SaveSnapshot method returns a
// member of the RenderStatus enumeration. If the user
// hits the escape key or quits the app, exit the loop.
if (Vegas.SaveSnapshot(FullFileName, ImageFileFormat.JPEG, evnt.Start + OffSet) == RenderStatus.Complete) {
Vegas.UpdateUI();
}

eventEnum.moveNext();
}


// restore the project and preview settings
Vegas.Project.Preview.RenderQuality = origPreviewRenderQuality;
Vegas.Project.Preview.FullSize = origPreviewFillSize;
Vegas.Project.Video.FieldOrder = origFieldOrder;
Vegas.Project.Video.DeinterlaceMethod = origProjectDeinterlaceMethod;
Vegas.Cursor = currentTime;

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




function FindSelectedTrack() : Track {
var trackEnum = new Enumerator(Vegas.Project.Tracks);
while (!trackEnum.atEnd()) {
var track : Track = Track(trackEnum.item());
if (track.Selected) {
return track;
}
trackEnum.moveNext();
}
return null;
}


JHendrix2 wrote on 7/15/2012, 7:20 PM
can it be set to take thumb from e.g. 2 seconds in to each clip in track? or is it jsut a thumb at every split point of clips
malowz wrote on 7/15/2012, 8:26 PM
i believe the "var OffSet = new Timecode("00:00:00:10")" set the "move" amount to take the image. just put the value you want.

i believe it take a image from every beginning of a event on track
JHendrix2 wrote on 7/15/2012, 9:39 PM
how do i use that code?


(what kind of file to make and where to place?)
jetdv wrote on 7/16/2012, 10:49 AM
Take the text and put in it Notepad. Then save it as something like "Save Thumbnails.js" into the "Script Menu" folder in Vegas' folder. Next time you start Vegas and go to Tools - Scripting, it will be listed there.
JHendrix2 wrote on 7/16/2012, 8:19 PM
absolutely brilliant! many thanks

anyone know why importing my rendered DNxHD files give black video preview in vegas??

UPDATE: the avid.mov thing was just some odd qt issue. had to reboot a couple times but got it to work