I need to finish this scripting... but...

YOUNHEE-LEE wrote on 11/29/2024, 7:08 AM

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.");
}

Comments

Jack S wrote on 11/29/2024, 7:35 AM

@YOUNHEE-LEE Please don’t double post.

My system
Genshin Infinity Gaming PC
Motherboard Gigabyte H610M H: m-ATX w/, USB 3.2, 1 x M.2
Power Supply Corsair RM750X
Intel Core i7-13700K - 16-Core [8P @ 3.4GHz-5.4GHz / 8E @ 2.50GHz-4.20GHz]
30MB Cache + UHD Graphics, Ultimate OC Compatible
Case Fan 4 x CyberPowerPC Hyperloop 120mm ARGB & PWM Fan Kit
CPU Fan CyberPowerPC Master Liquid LITE 360 ARGB AIO Liquid Cooler, Ultimate OC Compatible
Memory 32GB (2 x 16GB) DDR5/5200MHz Corsair Vengeance RGB
MSI GeForce RTX 4060 Ti 8GB - Ray Tracing Technology, DX12, VR Ready, HDMI, DP
System drive 1TB WD Black SN770 M.2 NVMe PCIe SSD - 5150MB/s Read & 4900MB/s Write
Storage 2 x 2TB Seagate BarraCuda SATA-III 6.0Gb/s 7200RPM
Windows 11 Home (x64)
Monitors
Generic Monitor (PHL 222V8) connected to GeForce RTX 4060 Ti
Generic Monitor (SAMSUNG) connected to iGPU

Camcorder
SONY Handycam HDR-XR550VE