No internet connection
  1. Home
  2. How to

How to create a toggle to enable and disable the video engine?

By Raul Garcia @Raul_Garcia
    2022-03-15 19:58:31.353Z

    Just started using SoundFlow and I love how much potential it has opened up for our studio. We have been having weird issues with video codecs and Pro Tools crashing after exporting videos.

    The only solution we've found to prevent PT from crashing is to immediately disable the video engine from the Playback Engine menu, close the menu, re-open it and re-enable the Video Engine. It then locks up for a few seconds but then successfully re-launches the video engine and everything continues smoothly.

    As you can imagine, exporting multiple videos with this glitch is a huge headache so it would be amazing to be able to press one button that essentially does it for you. The furthest I got was using the "Open Playback Engine" macro, which is nice, but only gets me 25% of the way there.

    Essentially I need to figure out to "re-launch" the video engine (not to be confused with taking the video track Online/Offline".

    I'm not really sure I understand how scripting works but I feel like this would be a great way to take a first step.

    Thanks!

    Solved in post #2, click to view
    • 2 replies
    1. Kitch Membery @Kitch2022-03-18 19:51:25.968Z

      Hi @Raul_Garcia,

      Try this :-)

      // Activate Pro Tools main window
      sf.ui.proTools.appActivateMainWindow();
      
      //Open Playback Engine
      sf.ui.proTools.menuClick({ menuPath: ["Setup", "Playback Engine..."] });
      
      const win = sf.ui.proTools.windows.whoseTitle.is("Playback Engine").first;
      
      //Wait for Playback Engine window to Appear
      win.elementWaitFor();
      
      //Disable Video Engine checkbox
      win.checkBoxes.whoseTitle.is("Enable").first.checkboxSet({ targetValue: "Disable" });
      
      //Click "OK"
      win.buttons.whoseTitle.is("OK").first.elementClick();
      
      //Wait for Playback Engine window to Disappear
      win.elementWaitFor({ waitType: "Disappear" });
      
      //Open Playback Engine
      sf.ui.proTools.menuClick({ menuPath: ["Setup", "Playback Engine..."] });
      
      //Wait for Playback Engine window to Appear
      win.elementWaitFor();
      
      //Enable Video Engine Checkbox
      win.checkBoxes.whoseTitle.is("Enable").first.checkboxSet({ targetValue: "Enable" });
      
      //Click "OK"
      win.buttons.whoseTitle.is("OK").first.elementClick();
      
      //Wait for Playback Engine window to Disappear
      win.elementWaitFor({ waitType: "Disappear" });
      
      //Wait for the video engine to restart.
      sf.ui.proTools.waitForNoModals();
      
      log("Done");
      
      Reply3 LikesSolution
      1. RRaul Garcia @Raul_Garcia
          2022-03-21 14:05:40.664Z

          Works great! Thank you.