I am trying to create a script that loads a series of videos. When I load a video I user the following line:
var media = new Media(Base_filename + j + ".MPG");
var stream = media.Streams[0];
Should the stream be set with the video I just loaded and should the length be set appropriately?
Below is a copy of part of the script I am putting together. I've broken videos into smaller chunks and am putting them back together here. I need to load a simple mpg video into a vegas project and load the audio and video separately with no effects. I was unable to find a script that did this exactly and the below is take from a little javascript knowledge and looking at the scripts available at sites on the web. Any ideas?
Rich
-------------------------------------------------------
Vegas.Cursor = cursorTimecode;
var media = new Media(Base_filename + j + ".MPG");
MessageBox.Show(Base_filename + j + ".MPG");
var stream = media.Streams[0];
MessageBox.Show("Length" + stream.length);
var newEvent = new VideoEvent(cursorTimecode, stream.length);
MessageBox.Show("After New Event");
Vidtrack.Events.Add(newEvent);
MessageBox.Show("After Add VidTrack");
var take = new Take(stream);
MessageBox.Show("After New take");
newEvent.Takes.Add(take);
MessageBox.Show("After New Event");
newEvent.Length = stream.Length;
MessageBox.Show("After Length");
cursorTimecode = stream.Length + Vegas.Cursor;
var media = new Media(Base_filename + j + ".MPG");
var stream = media.Streams[0];
Should the stream be set with the video I just loaded and should the length be set appropriately?
Below is a copy of part of the script I am putting together. I've broken videos into smaller chunks and am putting them back together here. I need to load a simple mpg video into a vegas project and load the audio and video separately with no effects. I was unable to find a script that did this exactly and the below is take from a little javascript knowledge and looking at the scripts available at sites on the web. Any ideas?
Rich
-------------------------------------------------------
Vegas.Cursor = cursorTimecode;
var media = new Media(Base_filename + j + ".MPG");
MessageBox.Show(Base_filename + j + ".MPG");
var stream = media.Streams[0];
MessageBox.Show("Length" + stream.length);
var newEvent = new VideoEvent(cursorTimecode, stream.length);
MessageBox.Show("After New Event");
Vidtrack.Events.Add(newEvent);
MessageBox.Show("After Add VidTrack");
var take = new Take(stream);
MessageBox.Show("After New take");
newEvent.Takes.Add(take);
MessageBox.Show("After New Event");
newEvent.Length = stream.Length;
MessageBox.Show("After Length");
cursorTimecode = stream.Length + Vegas.Cursor;