8.1 Enumerating Templates BUG

dbritta1 wrote on 1/13/2009, 3:41 PM
The following code runs under Vegas 8.0 but fails under 8.1 if the timeline is empty.

It runs properly under 8.1 if you add a video to the timeline.

MessageBox.Show("Diagnostics Find Renderers\r\nDies if no media in timeline!");
foreach (Renderer renderer in vegas.Renderers)
{
strRenderer = renderer.FileTypeName;
foreach (RenderTemplate renderTemplate in renderer.Templates)
{
if (renderTemplate.Name.CompareTo("6 Mbps HD 720-30p Video") == 0)
{
stringBuilder.AppendLine("FOUND " + strRenderer + " - " + renderTemplate.Name);
// MessageBox.Show("FOUND " + strRenderer + " - " + renderTemplate.Name);
}
if (renderTemplate.Name.CompareTo("44,100 Hz, 16 Bit, Mono, PCM") == 0)
{
stringBuilder.AppendLine("FOUND " + strRenderer + " - " + renderTemplate.Name);
// MessageBox.Show("FOUND " + strRenderer + " - " + renderTemplate.Name);
}
}
}
.
.
.

What is going on?

Dennis

Comments

jetdv wrote on 1/29/2009, 7:14 AM
Dennis, if you want to post/e-mail a full test script (including the "using" lines that can can simply be pasted into notepad or a link to an actual script file) then I'll test it in my copy of 8.1 and see if I get the same results. I know that I'm going through the renderers in Excalibur and it's working fine with no track/events on the timeline.
dbritta1 wrote on 1/29/2009, 3:26 PM
Dear jetdv

I was able to use try-catch blocks to avoid complete vegas hangs.
However, enumerating the renderers and templates in Vegas 8.1 with a new project throws exceptions.

The csproj and script are in: FindTemplateBug.ziq
located at: http://medtron.org/zTest.aspx

Dennis

P.S. the CompositingNestingLevel bug is more important as it is delaying product release.
dbritta1 wrote on 1/30/2009, 7:20 AM
/////////////////////////////////////////////////////////////////////////////
// FindTemplateBug.cs Dr. Dennis A. Brittain
// This script works with Vegas 8.0
// but Throws exceptions under Vegas 8.1 if timeline is empty (new project)
/////////////////////////////////////////////////////////////////////////////
using System;
using System.Text;
using System.Windows.Forms;
using Sony.Vegas;

public class EntryPoint
{
public void FromVegas(Vegas vegasParent)
{
string strRendererName = "";
string strRenderTemplateName = "";
MessageBox.Show("FindTemplateBug \r\nThrows exceptions if no media in 8.1 timeline!");
foreach (Renderer renderer in vegasParent.Renderers)
{
strRendererName = "";
try
{
strRendererName = renderer.FileTypeName;
foreach (RenderTemplate renderTemplate in renderer.Templates)
{
strRenderTemplateName = renderTemplate.Name;
if (strRenderTemplateName.CompareTo("6 Mbps HD 720-30p Video") == 0)
{
MessageBox.Show("FOUND " + strRendererName + " - " + strRenderTemplateName);
}
if (renderTemplate.Name.CompareTo("44,100 Hz, 16 Bit, Mono, PCM") == 0)
{
MessageBox.Show("FOUND " + strRendererName + " - " + strRenderTemplateName);
}
}
}
catch (Exception e)
{
MessageBox.Show(strRendererName + " : " + strRenderTemplateName + "\r\nException: " + e);
}
}
MessageBox.Show("Exit FindTemplateBug");
}
}
/////////////////////////////////////////////////////////////////////////////
// END FindTemplateBug.cs Dr. Dennis A. Brittain
/////////////////////////////////////////////////////////////////////////////
jetdv wrote on 1/30/2009, 11:00 AM
I've had some issues in the past with some third party programs that add what appears to be "renderers" that really aren't. They may be codecs but they don't have any presets in them. However, for the issues I found it didn't matter whether or not the project was empty.

After this project finishes rendering I'll try to do some testing.