I have a 60 minute timeline that needs to be broken up into about 16 different parts and rendered out. I have it all broken up with markers. Is there any way to have Vegas render out these segments as different files without having to go in and set up a render after each segment is done?
I know it can be done with scripting as I had a script for such a purpose. However, I can't lay my hands on it at this moment. You can do it manually using loop regions but that is not entirely automated.
For the script, I took the batch render script included in V7 and added detection of markers for start and end points and used a manually defined name for the render template. I'm afraid the script may have gotten lost in space after a HDD migration. If I find it I'll post it.
I found it. When I wrote this I was learning the Sony object model so it is likely kludged up but it did work for what I needed. It worked at the time but I haven't used it since so YMMV.
var type=1;
var fileroot="c:\\temp\\";
var selstrt:Timecode=new Timecode("00:00:15:00");
var selend:Timecode=new Timecode("00:00:45:00");
var seldif:Timecode=new Timecode();
var timetot:Timecode=new Timecode("00:00:00:00");
var markerList : ArrayList = new ArrayList(Vegas.Project.Markers);
var renderersList : ArrayList = new ArrayList(Vegas.Renderers);
//var templatesList : ArrayList = new ArrayList(renderersList[1].Templates);
//MessageBox.Show(rndrtemplates.Count);
var marktime=new Array(30);
var c1=0;
var loopname="";
var markcnt=Vegas.Project.Markers.Count;
var rendererscnt=Vegas.Renderers.Count;
var rtplt : RenderTemplate
function DoRender(fileName, rndr, rndrTemplate, start, length) {
// make sure the file does not already exist and delete it if it does.
if (File.Exists(fileName)) {
try {
File.Delete(fileName);
} catch (q) {
}
}
//If the file still exists, try removing it from the media pool
//and deleting it again
if (File.Exists(fileName)) {
try {
Vegas.Project.MediaPool.Remove(fileName);
Vegas.UpdateUI();
File.Delete(fileName);
} catch (x) {
}
}
if (File.Exists(fileName)) {
MessageBox.Show("Could not delete: " + fileName);
return false;
}
// perform the render. The Render method returns
// a member of the RenderStatus enumeration. If
// it is anything other than OK, exit the loops.
var status = Vegas.Render(fileName, rndrTemplate, start, length);
// if the render completed successfully, just return
if (status == RenderStatus.Complete)
return;
// if the user canceled, write out a special message
if (status == RenderStatus.Canceled) {
MessageBox.Show("User Cancelled");
return false;
}
// if the render failed, display a detailed error message.
var msg : StringBuilder = new StringBuilder("Render failed:\n");
msg.Append("\n file name: ");
msg.Append(fileName);
msg.Append("\n Renderer: ");
msg.Append(rndr.FileTypeName);
msg.Append("\n Template: ");
msg.Append(rndrTemplate.Name);
msg.Append("\n Start Time: ");
msg.Append(start.ToString());
msg.Append("\n Length: ");
msg.Append(length.ToString());
MessageBox.Show(msg);
return false;
}
Name the first marker of each clip the name of the output file. If you do not want to render a section name the marker 'del' and there must be an end marker named 'end' (without quotes).
ie:
Marker 1) ant1
Marker 2) del
Marker 3) ant2
Marker 4) ant3
Marker 5) del
Marker 6) ant4
Marker 7) end
If you want to render to a different template, change ' rendname="DVD NTSC" ' to whatever template you want. If not mpg then you will have to change the corresponding entry of
var renderer : Renderer = Vegas.Renderers.FindByName("MainConcept MPEG-2");
To whichever is appropriate. That may also cause you to change the .mpg extension reference also.
Ed may already have one of these or he or someone with more experienced with scripts can probably clean this up.
If you have Ultimate S or Excalibur you can also do this by making a Region of each segment and rendering Regions. You can choose to make the name you give to the Region come through into the name of the Rendered clip.
There may also be a free script that renders from Regions - try VASST.
> If you have Ultimate S or Excalibur you can also do this by making a Region of each segment and rendering Regions.
Actually, in Ultimate S Pro 4.0 it will render Markers too so you don't need to do anything like create regions. You can download a fully functional 14-day trial of Ultimate S Pro and use it for this purpose. Use the Render tab, check Project and press the Markers button. It will render the timeline between the markers in any number of formats you choose using the marker names as the filenames.
Here's my revision of the batch script supplied with Vegas. You first create regions around each segment of the timeline you want to render. Then, you run this script and select which render templates you want to use. Each region will then be rendered with each template. Thus, you can choose one of the MPEG-2 templates and also one of the AC-3 templates and render both the video and the audio for each of your regions.
Thanks all. I found a solution and I don't know if this was in Vegas before this version or not. I've never really needed it, so I guess I just didn't look.
In the scripts area of the menu there already is a Batch Render script included. The functionality to render to regions that you create is already there as well the the ability to render to any of the codecs you have all in the same interface. Nice.