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: