batch render 300x195 How to batch render and stretch in Sony Vegas 11 Pro

Selecting batch render in Sony Vegas Pro

If you have prepared regions in a video which you wish to output as individual files Sony Vegas Pro has a simple script called “Batch Render” that will do the dirty work for you. However it won’t stretch to fill video for you and if this is a requirement then you need to change the script.

Research reveals Vegas Pro versions before 9 would handle stretching to avoid letterboxing too. However the default installation no longer does. This is how you do it:-

  1. Locate the script directory (usually C:\Program Files\Sony\Vegas Pro 11.0\Script Menu)
  2. Make a copy of “Batch Render.cs” and call it “Batch Render Stretch.cs”
  3. Open the new file in a text editor and find the two lines that begin “args.OutputFile =”. You will find them around line 97 and 106.
  4. Create a new line below them and add “args.StretchToFill = true;” (without the quotes (see below)
  5. Save your changes, refresh the script listing in Vegas and use the new script to render files as before but use this new script instead
  6. After your changes the code should look something like this:-

    if (RenderMode.Regions == renderMode) {
    	int regionIndex = 0;
    	foreach (Sony.Vegas.Region region in myVegas.Project.Regions) {
    		String regionFilename = String.Format("{0}[{1}]{2}",
    				filename,
    				regionIndex.ToString(),
    				renderItem.Extension);
    		RenderArgs args = new RenderArgs();
    		args.OutputFile = regionFilename;
    		args.StretchToFill = true;  // <------------ Add this line
    		args.RenderTemplate = renderItem.Template;
    		args.Start = region.Position;
    		args.Length = region.Length;
    		renders.Add(args);
    		regionIndex++;
    	}
    } else {
    	filename += renderItem.Extension;
    	RenderArgs args = new RenderArgs();
    	args.OutputFile = filename;
    	args.StretchToFill = true;  // <------------ Add this line
    	args.RenderTemplate = renderItem.Template;
    	args.UseSelection = (renderMode == RenderMode.Selection);
    	renders.Add(args);
    }

    If programming’s not your thing you can download a copy of the script ready-made by clicking here.

    If you’re interested in programming Vegas this is a good starter video:

 

Creating webparts in Visual Studio 2008 for SharePoint 2007 can be messy and the effort required is not indicative of the ease you would expect from a product like SharePoint. There are tools to help such as VseWSS and developers at Codeplex have created several solutions such as wspbuilder.  But have you checked out recent Visual Studio 2010 beta releases yet?

If you have then you probably eyed with envy the project templates for SharePoint 2010.  Developing Webparts is now a snap.  Developing, testing and deployment is done at white-knuckle speed and debugging SharePoint in 2010 works like any other Visual Studio application.

With a little hacking you can use Visual Studio 2010 to build SharePoint 2007 webparts.  Here’s what you do.

Simple Hello World

  1. Open up Visual Studio 2010 and create a new “Visual Webpart”
  2. VisualWebPart1UserControl.ascx will open automatically. To which we  add:
<asp:Label ID="Label1" runat="server" Text="Hello World">
</asp:Label>
  1. On Lines 2,3,4,7 change the Assembly version to 12.0.0.0
  2. Build > Package

This will create a wsp file containing a webpart that will run in SharePoint 2007 only.

Most of the time changing the assembly reference within the ascx file is all you need to do.  If you inherit a class within the Microsoft.SharePoint namespace you will need to replace the default reference to Microsoft.SharePoint version 14 with the older SharePoint 2007 version 12 library.

© 2011 Martyn Walker | Software Architect | Hiker And Hacker Suffusion theme by Sayontan Sinha