What I want is to find the renderer that I want... and use it...
And I thought that an FPS of 30 with a resolution of 1280x720 would be a very commonly used option, so I assumed it would be found in the code above (compared to an encoding format like FPS = 12 with 720x300). However, Vegas is displaying the following error message. "MP4 renderer or template with FPS=30 and resolution 1280x720 not found."
Why is this happening?
// Finding MP4 Renderer with FPS=30 and Resolution 1280x720 Template
foreach (Renderer renderer in myVegas.Renderers)
{
if (renderer.FileTypeName.Contains("MP4") || renderer.FileTypeName.Contains("AVC"))
{
foreach (RenderTemplate template in renderer.Templates)
{
// Check if the template is valid
if (!template.IsValid())
{
continue;
}// Finding a template with FPS of 30 and resolution of 1280x720
if (template.VideoFrameRate == 30 && template.VideoWidth == 1280 && template.VideoHeight == 720)
{
mp4Renderer = renderer;
mp4Template = template;
break;
}
}
}
if (mp4Renderer != null && mp4Template != null)
{
break;
}
}// "Add to SelectedTemplates after setting the renderer and template
if (mp4Renderer != null && mp4Template != null)
{
SelectedTemplates.Add(new RenderItem(mp4Renderer, mp4Template, mp4Template.FileExtensions[0]));
DoMySpRender(SelectedTemplates, outputFilePath, renderMode);
}
else
{
// Handle cases where the desired renderer and template are not found
MessageBox.Show("MP4 renderer or template with FPS=30 and resolution 1280x720 not found.");
}