Scripting MPEG-2 compression settings

DarrenStarr wrote on 9/28/2007, 8:35 AM
Veggie Toolkit provides the ability to select more detailed render settings than are provided by the typical Renderer and RenderTemplate classes. It somehow provides the user with the ability to change all the settings that you can change within Vegas from the render menu.

Can someone please tell me how I can get access to these settings as well? I need this ability to setup rendering settings for multiple different stages of the vegas UI plugin I've written.

For example, I allow the user to render 5 seperate tracks of audio as 5 seperate files (multiple languages) and thus far, I must force them to produce a predefined template for these settings by following directions in a help file.

I also want to provide the ability to render both a SD and an HD output from the same project, also not entirely depending on templates.

How can I script the rendering template with more detail?

Comments

jetdv wrote on 9/28/2007, 9:06 AM
Here's a short example:


RenderArgs args = new RenderArgs();
args.OutputFile = fileName;
args.RenderTemplate = rndrTemplate;
args.Start = start;
args.Length = length;
args.IncludeMarkers = true;
args.StretchToFill = false;

RenderStatus status = Vegas.Render(args);
DarrenStarr wrote on 9/28/2007, 9:40 AM
Yeh, that's the easy part, how about something like

RenderTemplate t = new RenderTemplate();
t.Renderer = mpeg2Renderer;
t.Settings["MPEG_VBR_2PASS"] = "true";
t.Settings["MPEG_USE_CLOSED_GOPS"] = "true";
t.Settings["MPEG_USE_ASPECT_RATIO"] = "16:9";

RenderArgs args = new RenderArgs();
args.Template = t;

Or at least provide me a way to present the user with a dialog where they can produce a template themselves.
ForumAdmin wrote on 10/1/2007, 7:59 AM
Individual template parameters are a "black box" to Vegas and its scripting API.

There is an undocumented method on the renderer class:


public DialogResult ShowTemplateEditDialog(IWin32Window ownerWindow, ref UInt32 templateID)


Warning: Undocumented API is subject to change in future releases without regard for maintaining backward compatibility with third party scripts and extensions.

DarrenStarr wrote on 10/4/2007, 8:36 AM
Exactly what I was looking for. I can live with that as a response. I don't mind moving targets, been programming for Windows for 15 years, somewhat used to it :)

Thanks a lot,
- Darren