Script to export regions as .srt and .sbv captions

NickHope wrote on 6/30/2012, 10:21 AM
I still find it easier to make my captions by creating and naming regions in Vegas, then exporting them, rather than using the captioning tools.

The original script "Export Regions as Subtitles.cs" bundled with Vegas Pro works fine for exporting to DVDA.

A while back, Pixelsplasher added .srt support so that captions could be created for YouTube and other programs such as TMPGEnc DVD Author.

YouTube now accepts another, simpler format called .sbv, which is easier to edit because the captions are not numbered. This is especially useful if, for example, you are translating to German and want to split a caption because it is much longer than the English version. No re-numbering required!

So I have added .sbv support to the script, and also modified the script to prevent a 2nd empty line at the end of the file, which YouTube complains about.

You can get it here. If it goes offline at any time in the future, send me a PM through the forum.

Comments

Guy S. wrote on 7/2/2012, 1:08 PM
Very helpful, thanks!
Red Prince wrote on 7/2/2012, 1:15 PM
No re-numbering required!Renumbering of SRT files is very easy with srtpal (which I wrote several years ago).

Adam

He who knows does not speak; he who speaks does not know.
                    — Lao Tze in Tao Te Ching

Can you imagine the silence if everyone only said what he knows?
                    — Karel Čapek (The guy who gave us the word “robot” in R.U.R.)

NickHope wrote on 9/30/2012, 8:38 AM
I have updated this script at the same link.

I found that unicode encoding of an English language .sbv file always caused an unrecognised character at the end of the YouTube captions, no matter whether there are blank lines at the end of the uploaded .sbv file or not. So I have set the default encoding to be ASCII which works fine for English. For non-Western languages (e.g. Thai) you must set the encoding back to Unicode at line 230.

I would like to be able to offer a choice of Unicode or ASCII in the file-type dropdown but the conditionality of which writing sub-routine is used is based on the file extension, which would be .sbv in both cases. I guess a scripting guru might be able to work out how to do that.

I also changed it to completely remove blank lines at the end of the script, since they also caused an unrecognised character in the captions when I tested with Thai/Unicode.
Sirio wrote on 12/29/2015, 11:26 AM
Hello
Good idea this script.
How can I make an "Carriage Return Line Feed". Which special character did I have to put in my region name to split my line in two lines?
Thanks.
NickHope wrote on 12/30/2015, 10:16 AM
I don't think you can do that. I did a quick test to see if \n or \r or \x0D might work but they didn't.

I think it's easier to add the line breaks by editing the subtitle file in a text editor like Notepad or SciTe or Notepad++ or jEdit or in Subtitle Edit. By scrolling down the file it's easy to see which lines need splitting, or you could probably set one of those last 3 programs to automate the line breaks.
Sirio wrote on 12/30/2015, 1:22 PM
I found the solution:
I have just write to the programmer of Subtitle Edit to allow in the "replace" function to replace a special character of your choice by a "\n" (new line). This guy did it in the new beta release, in the "Edit -> Multiple replace" function, soon in the "replace" function too. Wonderful
https://github.com/SubtitleEdit/subtitleedit/releases/download/3.4.10/SubtitleEditBetaTest.zip
So, soon it will possible to see this in the stable release.