Scripting help to scene detect and split on many old avi files

ChuckMan wrote on 2/7/2026, 2:46 PM

I have hundreds of old hi8 avi files and would like to split them using scene detection. Then, I can import these clips into Lightroom for face detection searches. 

I know how to write Vegas scripts but get stuck on how to execute the Split button in the detect scene fx. The google AI's answer is: not allowed due to security reasons.

There are the Detect Scenes and add to timeline and Detect Scense and add to subclips functions from the context menu when right click on a video file; however, I don't know the syntax to call these functions (I am using Vegas Prod v19).

I have also tried PySceneDetect tool. Althought it works; however, the output does not support the Video for Windows codec which I use to preserve the original video quality.

Any help is appreciated.

Thanks in advance.
 

Comments

jetdv wrote on 2/7/2026, 4:36 PM

This seemed to work for me. I manually added the "Scene Detection" effect (but the script could add it as well) to a clip I forced to have separate scenes and it was the only effect I added to I was sure it was the "first" effect.

            foreach (Effect eff in vEvent.Effects)
            {
                if (eff.IsOFX)
                {
                    OFXEffect ofx = eff.OFXEffect;

                    foreach(OFXParameter parm in ofx.Parameters)
                    {
                        if (parm.ParameterType.ToString() == "PushButton" && parm.Name == "Analysis")
                        {
                            parm.ParameterChanged();
                        }
                    }

                    myVegas.UpdateUI();

                    foreach (OFXParameter parm in ofx.Parameters)
                    {
                        if (parm.ParameterType.ToString() == "PushButton" && parm.Name == "SplitAction")
                        {
                            parm.ParameterChanged();
                        }
                    }
                }
            }

See this tutorial:

ChuckMan wrote on 2/7/2026, 11:21 PM

It works great. Thank you so much. If anyone is interested, I will share the code here.

snibchi1 wrote on 2/8/2026, 4:47 AM

Share it here:

VEGAS Pro Scripts Collections | SHARE YOUR SCRIPT HERE !!

Audiovisuelle Geräte

  • Canon EOS 6D
  • Canon EOS 450D
  • Nicon Coolpix S7000
  • AC800 Actioncam
  • Sony HDR-SR5

Hardware-Ausstattung

  • Monitor: LG Ultrawide 34UC79G
  • Tastatur: MSI GK50 Elite
  • Maus: MSI GM20 Elite
  • Gehäuse: CooMas HAF X 942-KKN1 ATX
  • PSU: be quiet! Staight P11 850W
  • Board: MSI MEG X570 ACE (Bios 7C35 v 1.Q0, 04.07.2025)
  • CPU: AMD Ryzen 9 3900x
  • Cooler: Noctua NH-D14 SE2011 (AMD Adapter)
  • RAM: 2x 16GB D432GB 3600-17 Predator K2 KHX
  • M_2.1: 1x 2TB Gigabyte GP-ASM2NE6200
  • M_2.2: 1x 1TB Gigabyte GP-ASM2NE6100
  • M_2.3: 1x 1TB Samsung SSD Pro 980
  • SSD: 1x 4TB SanDisk Ultra 3D
  • SSD: 1x 512GB Samsung 850 Pro
  • GPU: 1x 12GB MSI Radeon RX 6750 XT
  • NAS: Synology DS 218+ 2x 6TB

Software

  • Windows 11 64 Pro (25H2 Build 26200.8037)
  • MAGIX Vegas Suite 365 (Build 23.356)
  • MAGIX Photostory deluxe 2026 (V 25.0.1.313 (UDP3))
  • Sound Forge Pro 18
  • ACID Pro 11.0 (x64)
  • Music Maker 2025
  • ADOBE Master Suite CS6, CC
Alex-Pitel wrote on 2/8/2026, 8:06 AM

The best and fastest for me worked "HandySaw DS" - it made an edl file (you can open it in Vegas).

My portfolio:

My PC:

Windows 10

CPU AMD 3900x

RAM 64gb

GPU1 RTX 3900 (24gb)

GPU2 Intel ARC 380

MB: Gigabyte x570 Aourus pro

Processor: AMD 3900x, RAM 64GB (2x 16gb+ 32gb)

BIOS: reBAR, Above 4G disabled! ((.

Camera Canon r6, R10, Sony A7iii, A77ii, A99, A6300

Preferred footage: h265 (hevc) 422 10 bit, c-Log3

 

ChuckMan wrote on 2/8/2026, 10:41 AM

Share it here:

VEGAS Pro Scripts Collections | SHARE YOUR SCRIPT HERE !!

Will do, after adding some comments to the code

ChuckMan wrote on 2/8/2026, 10:43 AM

The best and fastest for me worked "HandySaw DS" - it made an edl file (you can open it in Vegas).

Thanks for the suggestion. It is a commercial product that costs $65. Since I already purchased Vegas, I will stick with it although the scene detection is quite slow. I will just let it run overnight.

ChuckMan wrote on 2/8/2026, 11:38 AM

Another help - The custom preset for Scene Detection is not used. It is using the default preset instead. What did I do wrong? Please see code below:

                vEvent.Effects.Add(sceneDetect);
                // Setting presets via script requires the exact Preset Name string
                vEvent.Effects[0].Preset = "High Sensitivity";     //Not using this preset. It uses the Default preset instead
                //sceneDetect.Preset = "High Sensitivity"; //Not using this preset. It uses the Default preset instead
 

jetdv wrote on 2/8/2026, 3:50 PM

What if you just set the various parameters manually? What are the settings of the preset? There are no built-in presets so I'm not sure.

                    OFXEffect ofx = eff.OFXEffect;

                    OFXDoubleParameter p1 = (OFXDoubleParameter)ofx["SensitivityHardCuts"];
                    p1.Value = 1.0;

                    OFXDoubleParameter p2 = (OFXDoubleParameter)ofx["SensitivityFades"];
                    p2.Value = 1.0;

                    OFXDoubleParameter p3 = (OFXDoubleParameter)ofx["SensitivityDissolves"];
                    p3.Value = 1.0;


                    foreach (OFXParameter parm in ofx.Parameters)
                    {
                        if (parm.ParameterType.ToString() == "PushButton" && parm.Name == "Analysis")
                        {
                            parm.ParameterChanged();
                        }
                    }

                    myVegas.UpdateUI();

                    foreach (OFXParameter parm in ofx.Parameters)
                    {
                        if (parm.ParameterType.ToString() == "PushButton" && parm.Name == "SplitAction")
                        {
                            parm.ParameterChanged();
                        }
                    }

 

ChuckMan wrote on 2/8/2026, 6:49 PM

Thank you for the quick reply. After more testing, the preset actually works but behave differently. If working from the FX UI, 0.71 Hardcut sensitivity level will yield what I need; however, in the Script, I have to set it to 0.75 to get the same results.

Note this difference is only on SplitAction. The Analysis yields the same results in both UI/Script. Strange behavior.

jetdv wrote on 2/9/2026, 8:52 AM

That does seem odd as the "SplitAction" should use the results of "Analysis".

ChuckMan wrote on 2/9/2026, 8:40 PM

I was experimenting with the Scene Detection FX. What I found is that the Analyze function produces more cutting points than what are shown. For example, When I analyze with sensitivity set to 0.5, the cutting points are generated from sensitivity around 0.3 to 0.7. I know this because when I change the sensitivity to 0.7 or 0.3, the analyze function immediately shows the cutting points. When I change the sensitivity to 0.8, the analyze function will have to go through the long process of generating cutting points. So, there could be a bug in the SplitAction where it cutting points were not selected correctly.