Best way to create/export subtitles for YouTube?

Heidi-Hansen wrote on 4/8/2025, 9:28 PM

Hi,

I've spent many hours creating subtitles for my video, assuming I could go to Tools > Scripting and then export the subtitles in a format suitable for YouTube, etc.

However, nothing happens when I try to export, and I now realize that I might need a third-party plugin to do this?

Is there a way to add a different kind of text box and copy each subtitle manually – one by one – or is there a better workaround?

And for future projects, what is the recommended way to create and export subtitles properly?

Thanks in advance!

Comments

RogerS wrote on 4/9/2025, 12:20 AM

Personally I use Vegasaur for this. I assume it is using a script so if you can write your own that would work. Using Vegasaur it can also import subtitles, edit the look of subtitles in batch, etc.

If the subtitles are based on voice using speech to text (VEGAS comes with this these days though there are character limits) or a third-party program can save a lot of time! I use this program and recommend it. It does the processing locally (using a NVIDIA GPU if you have one) so there are no usage limits.

Another option is to do subtitling outside VEGAS using a tool like SubtitleEdit and then import the finished titles into VEGAS.

Heidi-Hansen wrote on 4/10/2025, 9:02 PM

Thanks @RogerS I do have SubtitleEdit - but this time I just went for the subtitles directly in Vegas. Naive of me! 😄

RogerS wrote on 4/10/2025, 11:14 PM

A few of us have made such a feature request so maybe it will be added to VEGAS natively some day.

Fu-Ji wrote on 4/13/2025, 10:32 PM

As far as I can remember, this is a request that has been made for more than five years.

m3lquixd wrote on 4/14/2025, 10:42 AM

@Heidi-Hansen here is a script to export subtitles to SRT file made by @jetdv

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;
        public static FileStream OutStream;
        public static StreamWriter OutWriter;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            int Counter = 1;

            SaveFileDialog ofd = new SaveFileDialog();
            ofd.Filter = "SRT File (*.srt)|*.srt|All Files (*.*)|*.*";
            ofd.Title = "SRT File Location & Name";
            DialogResult dr = ofd.ShowDialog();
            if (dr == System.Windows.Forms.DialogResult.OK)
            {
                string filename = ofd.FileName;

                OutStream = new FileStream(filename, FileMode.OpenOrCreate);
                OutWriter = new StreamWriter(OutStream);

                RulerFormat saveFormat = myVegas.Project.Ruler.Format;
                myVegas.Project.Ruler.Format = RulerFormat.Time;

                foreach (Track myTrack in myVegas.Project.Tracks)
                {
                    if (myTrack.IsVideo())
                    {
                        foreach (TrackEvent evnt in myTrack.Events)
                        {
                            if (evnt.Selected && evnt.ActiveTake.Media.IsGenerated())
                            {
                                VideoEvent vevnt = (VideoEvent)evnt;
                                Effect gEffect = vevnt.ActiveTake.Media.Generator;

                                if (gEffect.PlugIn.UniqueID == "{Svfx:com.vegascreativesoftware:titlesandtext}")
                                {
                                    OFXEffect ofx = gEffect.OFXEffect;
                                    OFXStringParameter tparm = (OFXStringParameter)ofx.FindParameterByName("Text");

                                    RichTextBox rtfText = new RichTextBox();
                                    rtfText.Rtf = tparm.Value;
                                    string SubTitle = rtfText.Text;

                                    string startTime = evnt.Start.ToString().Replace('.', ',');
                                    string endTime = evnt.End.ToString().Replace('.', ',');
                                    string times = startTime.Trim() + " --> " + endTime.Trim();

                                    OutWriter.WriteLine(Counter.ToString().Trim());
                                    OutWriter.WriteLine(times);
                                    OutWriter.WriteLine(SubTitle);
                                    OutWriter.WriteLine(""); //blank line

                                    Counter++;
                                }
                            }
                        }
                    }
                }
                myVegas.Project.Ruler.Format = saveFormat;

                OutWriter.Close();
                OutStream.Close();
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas, string scriptFile, XmlDocument scriptSettings, ScriptArgs args)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

Just select all text events and run the script, then it will save to an srt file.

Last changed by m3lquixd on 4/14/2025, 10:46 AM, changed a total of 1 times.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 7 5700G 3.80 GHz
RAM:
    32,0GB Dual-Channel DDR4 3200MHz
Motherboard:
    ASRock B450M Steel Legend (AM4)
Graphics:
    MSI RTX 4060 Ventus 2X Black OC 8GB
Storage:
    476GB ADATA SU650 (SATA (SSD))
    931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

jetdv wrote on 4/14/2025, 10:45 AM

The tutorial for the script above comes out next week - April 21, 2025.

RogerS wrote on 4/14/2025, 11:12 PM

Great work jetdv!

Heidi-Hansen wrote on 4/17/2025, 7:00 AM

The tutorial for the script above comes out next week - April 21, 2025.

I look forward to that :-) Thanks a lot!

Heidi-Hansen wrote on 8/23/2025, 5:45 AM

I just watched jetdv’s video on YouTube, and I’m really happy to see that it’s now possible to export subtitles as an SRT file. I’m a bit clueless with scripting though. I copied the whole script from the link in this thread, but I’m not sure how or where to save it. Should I just paste it into Notepad and save it as .cs, .js, .vb, or .dll? Those are the only options I see, and I don’t really understand scripting. Any guidance would be much appreciated :)

LdM_Edit wrote on 8/23/2025, 5:54 AM

@Heidi-Hansen Paste the text to Notepad, save as ".cs" file in "C:\Program Files\VEGAS\VEGAS Pro\22\Script Menu"

jetdv wrote on 8/23/2025, 6:54 AM

@Heidi-Hansen Paste the text to Notepad, save as ".cs" file in "C:\Program Files\VEGAS\VEGAS Pro\22\Script Menu"

I like "My Documents"\Vegas Script Menu instead. Then it will show up in all versions of VEGAS. Plus, you really shouldn't modify the "Program Files" folder.

Heidi-Hansen wrote on 8/23/2025, 6:54 AM

@Heidi-Hansen Paste the text to Notepad, save as ".cs" file in "C:\Program Files\VEGAS\VEGAS Pro\22\Script Menu"

Oh my, it’s working! I can now export SRT-files! Thank you so much. At first I had to go through the hassle of even saving in that folder. Apparently I didn’t have permissions. Things used to be so much easier back in the day :D

Heidi-Hansen wrote on 8/23/2025, 6:56 AM

@Heidi-Hansen Paste the text to Notepad, save as ".cs" file in "C:\Program Files\VEGAS\VEGAS Pro\22\Script Menu"

I like "My Documents"\Vegas Script Menu instead. Then it will show up in all versions of VEGAS. Plus, you really shouldn't modify the "Program Files" folder.

Oh, I am not even sure if I also have Vegas files there. Could it cause any issues that I have now given myself permission to save in that folder?

LdM_Edit wrote on 8/23/2025, 7:50 AM

@Heidi-Hansen Paste the text to Notepad, save as ".cs" file in "C:\Program Files\VEGAS\VEGAS Pro\22\Script Menu"

I like "My Documents"\Vegas Script Menu instead. Then it will show up in all versions of VEGAS. Plus, you really shouldn't modify the "Program Files" folder.

@jetdv The location "C:\Program Files\VEGAS\VEGAS Pro\22\Script Menu " is the one that is mentioned in the VEGAS Pro 22 manual as the place to add scripts. I didn't know about other possible locations.

EDITED: I've found the other possible locations mentioned in the "Scripting FAQs" section of the manual.

@Heidi-Hansen

Could it cause any issues that I have now given myself permission to save in that folder?

I don't think so. But maybe someone else here has more information to provide.

jetdv wrote on 8/24/2025, 7:59 AM

@LdM_Edit That's where VEGAS stores the built-in scripts. But it's advised not to change the "Program Files" folder. There's about a half dozen other places. I find the "My Documents" location to be the easiest. But, yes, you have to create the "Vegas Script Menu" folder there in order to place scripts there. "Vegas Application Extensions" is another folder you can create there to save custom commands. Various locations that do not touch "Program Files" are:

[My Documents]\Vegas Script Menu\ 
C:\Users\<username>\AppData\Local\Vegas Pro\22.0\Script Menu\     <--- (Version Specific!)
C:\Users\<username>\AppData\Roaming\Vegas Pro\22.0\Script Menu\     <--- (Version Specific!)
C:\ProgramData\Vegas Pro\22.0\Script Menu\     <--- (Version Specific!)
C:\Users\<username>\AppData\Local\Vegas Pro\Script Menu\ 
C:\Users\<username>\AppData\Roaming\Vegas Pro\Script Menu\ 
C:\ProgramData\Vegas Pro\Script Menu\

On the "Version Specific" lines, you would need to change the version number for the version you want the script to show up. Unless it truly is version specific, I'd put it in any of the other locations which will let them show up in any version. To me, the "My Documents" location is the easiest to find/use.

jetdv wrote on 8/24/2025, 8:10 AM

I talk about the various locations for Custom Commands in part 5 of the "Custom Command" series:

They're basically the same as the above - the ending folder name changes to "Application Extensions" but the location of the folder is the same.

LdM_Edit wrote on 8/27/2025, 3:41 AM

@jetdv 

That's where VEGAS stores the built-in scripts. But it's advised not to change the "Program Files" folder.

I'm trying to understand this situation. You obviously know more than me about VEGAS and scripting, but what you are saying seems to imply that the VEGAS Pro 22 manual is giving the user bad advice. Here's a quote from the manual:

 

Adding scripts to the Scripting menu

When you start the program, VEGAS Pro looks at the Script Menu folder in the VEGAS Pro program folder to determine which scripts appear in the Scripting submenu. This folder is C:\Program Files\VEGAS\VEGAS Pro\22\Script Menu by default.

1. Add or delete scripts in the Script Menu folder to change the contents of the submenu.
2. From the Tools menu, choose Scripting, and then choose Rescan Script Menu Folder to update the menu.

https://help.magix-hub.com/video/vegas/22/en/content/topics/11-autoscript/scripting_in_vegas.htm

 

Then, either: 

 1. There's actually no harm in modifiying this specific folder "C:\Program Files\VEGAS\VEGAS Pro\22\Script Menu" as per the manual's instructions, although it is true that in general altering the content of "C:\Program Files" is not advised. Or

 2. The VEGAS Pro 22 manual is giving the user bad advise and it would be better to modify it.

jetdv wrote on 8/27/2025, 7:25 AM

@LdM_Edit - I'm going with #1.

It is generally advised not to modify the "Program Files" folder. Adding a new script there will not "hurt" unless you uninstall and then the things you've modified may not be removed. However, say you have three versions of VEGAS installed. Do you want to save this new script in three different folders? Or would you prefer to put it ONE folder that all three can see?

Then, if you make changes to the script, you would only need to change the ONE folder instead of remembering to change it multiple times in multiple places.

It just makes a lot more sense to NOT touch the "Program Files" folder (as recommended by Microsoft) and place them in one of the common repositories. I find the "My Documents" location the easiest to find/remember.

LdM_Edit wrote on 8/27/2025, 8:30 AM

@jetdv Thanks for the clarification.