VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. Member lgh529's Avatar
    Join Date
    Apr 2003
    Location
    Syracuse, Utah, USA
    Search Comp PM
    I have searched these forums, Sony's and Mediachance's but to no avail.

    I have a homemade video that I wanted to add subtitles to. So I created all the text in Vegas v5 regions, and then ran the export regions as subtitles script. The problem is that DVD-Lab Pro will not accept that file.

    So I tried to open the file in Subtitle Workshop, but it also won't open the file. I did a little experimenting and found that if I modified the vegas script a little, I could get Subtitle Workshop to import the file. Everything looked fine, but it had a bunch of overlapping subtitles. I found that Subtitle Workshop was screwing up the import in coverting from MM:SSD to frame numbers; by a lot, like 3 seconds of overlap.

    Has anyone ever succesfully exported subtitle text out of Vegas and imported the file into DVD-Lab Pro?
    Quote Quote  
  2. Member lgh529's Avatar
    Join Date
    Apr 2003
    Location
    Syracuse, Utah, USA
    Search Comp PM
    Since none of you have ever tried to do this, or at least haven't succeeded, I got an idea to modifiy the "Export Regions as subtitles" script in Vegas to allow for a third output option: srt files. Since srt format files are compatible with DVD-Lab Pro, this seemed like the best solution. So if any of you ever need this, the script follows.

    When you run it, you just pick the srt file option, then import the file into DVD-Lab Pro.

    Also, if anyone wants to test it, let me know if it doesn't work, but it worked for me perfectly.

    /**
    * You can use this script to export Vegas regions in the .sub format
    * for use in DVDA as subtitles. This script can aslo export regions
    * as tab separated text.
    *
    * To use this script:
    *
    * 1) Create named Vegas regions.
    * 2) Confirm no overlapped regions.
    * 3) Vegas>tools>scripting>run script>ExportRegionsAsSubtitles.js; save
    * 4) Import into DVDA using the Import Subtitles button in the DVDA timeline.
    *
    * Revision Date: Feb. 25, 2004.
    *
    * Edited on June 23, 2005 by Lonn G Hunter to include an srt file option.
    * File output is a compliant srt format file
    *
    **/
    import System.IO;
    import System.Text;
    import System.Collections;
    import System.Windows.Forms;
    import System.Globalization;
    import Sony.Vegas;

    function TimeToString(time) : String
    {
    var decimalSeparator = CultureInfo.CurrentCulture.NumberFormat.NumberDeci malSeparator;

    var rgTime = time.ToString( RulerFormat.Time ).split(decimalSeparator); // {"hh:mms", "ddd"}
    var sbRes : StringBuilder = new StringBuilder();

    sbRes.Append( rgTime[0]);
    sbRes.Append( ':' );

    var iCentiseconds = Math.round( rgTime[1]/ 10);

    sbRes.Append((( iCentiseconds / 10 ) >> 0 )% 10 );
    sbRes.Append((( iCentiseconds / 1 ) >> 0 )% 10 );

    return sbRes;
    }

    function ExportRegionsToSUB(exportFile : String) {
    var streamWriter : StreamWriter = null;
    try {
    streamWriter = File.CreateText(exportFile);
    //streamWriter.WriteLine("Start\tEnd\tLength\tName") ;
    var enumRegions : IEnumerator = Vegas.Project.Regions.GetEnumerator();
    var iSubtitle = 0;
    while (enumRegions.MoveNext())
    {
    var region : Region = enumRegions.Current;
    var tsv : StringBuilder = new StringBuilder();

    tsv.Append((( iSubtitle / 1000 )>> 0) % 10 );
    tsv.Append((( iSubtitle / 100 )>> 0) % 10 );
    tsv.Append((( iSubtitle / 10 )>> 0) % 10 );
    tsv.Append((( iSubtitle / 1 )>> 0) % 10 );
    tsv.Append('\t');

    tsv.Append( TimeToString( region.Position ));
    tsv.Append('\t');
    tsv.Append( TimeToString( region.End ));
    tsv.Append('\t');
    tsv.Append(region.Label);

    streamWriter.WriteLine(tsv.ToString());
    streamWriter.WriteLine();

    iSubtitle++;
    }
    } finally {
    if (null != streamWriter)
    streamWriter.Close();
    }
    }

    function ExportRegionsToTXT(exportFile : String) {
    var streamWriter : StreamWriter = null;
    try {
    streamWriter = File.CreateText(exportFile);
    streamWriter.WriteLine("Start\tEnd\tLength\tName") ;
    var enumRegions : IEnumerator = Vegas.Project.Regions.GetEnumerator();
    while (enumRegions.MoveNext())
    {
    var region : Region = enumRegions.Current;
    var tsv : StringBuilder = new StringBuilder();

    tsv.Append( region.Position.ToString( RulerFormat.Time ));
    tsv.Append('\t');
    tsv.Append( region.End.ToString( RulerFormat.Time ));
    tsv.Append('\t');
    tsv.Append( region.Length.ToString( RulerFormat.Time ));
    tsv.Append('\t');
    tsv.Append(region.Label);

    streamWriter.WriteLine(tsv.ToString());
    }
    } finally {
    if (null != streamWriter)
    streamWriter.Close();
    }
    }

    function ExportRegionsToSRT(exportFile : String) {
    var streamWriter : StreamWriter = null;
    var counter = 1;
    try {
    streamWriter = File.CreateText(exportFile);
    var enumRegions : IEnumerator = Vegas.Project.Regions.GetEnumerator();
    while (enumRegions.MoveNext())
    {
    streamWriter.WriteLine( counter );

    var region : Region = enumRegions.Current;
    var tsv : StringBuilder = new StringBuilder();

    tsv.Append( region.Position.ToString( RulerFormat.Time ));
    tsv.Append( ' --> ' );
    tsv.Append( region.End.ToString( RulerFormat.Time ));

    streamWriter.WriteLine(tsv.ToString());

    streamWriter.WriteLine(region.Label);
    streamWriter.WriteLine();
    counter = ( counter + 1);
    }
    } finally {
    if (null != streamWriter)
    streamWriter.Close();
    }
    }

    // an example filter: "PNG File (*.png)|*.png|JPEG File (*.jpg)|*.jpg"
    function ShowSaveFileDialog(filter, title, defaultFilename) : String {
    var saveFileDialog = new SaveFileDialog();
    if (null == filter) {
    filter = "All Files (*.*)|*.*";
    }
    saveFileDialog.Filter = filter;
    if (null != title)
    saveFileDialog.Title = title;
    saveFileDialog.CheckPathExists = true;
    saveFileDialog.AddExtension = true;
    if (null != defaultFilename) {
    var initialDir = Path.GetDirectoryName(defaultFilename);
    if (Directory.Exists(initialDir)) {
    saveFileDialog.InitialDirectory = initialDir;
    }
    saveFileDialog.DefaultExt = Path.GetExtension(defaultFilename);
    saveFileDialog.FileName = Path.GetFileName(defaultFilename);
    }
    if (System.Windows.Forms.DialogResult.OK == saveFileDialog.ShowDialog()) {
    return Path.GetFullPath(saveFileDialog.FileName);
    } else {
    return null;
    }
    }

    var projName;

    var projFile = Vegas.Project.FilePath;
    if ((null == projFile) || (0 == projFile.length))
    {
    projName = "Untitled";
    }
    else
    {
    projName = Path.GetFileNameWithoutExtension(projFile);
    }

    var strExportFile : String = ShowSaveFileDialog
    ( "DVD Architect Subtitle Script (*.sub)|*.sub|" +
    "Vegas Region List (*.txt)|*.txt|" +
    "Subtitle srt (*.srt)|*.srt" ,
    "Save Regions as Subtitles", projName + "-Regions"
    );

    if (null != strExportFile)
    {
    var iExt = strExportFile.lastIndexOf('.');
    if( strExportFile.substr( iExt+1,3+1 ).toUpperCase() == "SUB" ) // Works even if prev lastIndexOf

    fails or if the ext contains but not equal to "sub"
    ExportRegionsToSUB(strExportFile);
    else if(strExportFile.substr( iExt+1,3+1 ).toUpperCase() == "TXT" )
    ExportRegionsToTXT(strExportFile);
    else
    ExportRegionsToSRT(strExportFile);
    }
    Quote Quote  
  3. Member Cunhambebe's Avatar
    Join Date
    Mar 2004
    Location
    São Paulo - Brazil
    Search Comp PM
    Instead of working with regions, please accept my suggestion and buy Sony Vegas + DVD Architect 3.0a. It's much easier to create subtitles with this application. Sony DVD Architect 3.0a has many improvements such as
    -Jacket Picture;
    -menus that keep the last highlighted button even after looping;
    -support for multiple subtitles ans audio files;
    -reduce interlace flicker is available for menus and clips;
    -dolby digital pro encoder (Surround EX);
    -macrovison protection for your productions;
    -regions;
    -Smart Prepare: this is a really important feature. If you want to modify one of your projects (for instance, changing one of the clips on the menu), you don't need to prepare your all assets/files once again. Smart prepare will just prepare what has been modified.
    Quote Quote  
  4. Member lgh529's Avatar
    Join Date
    Apr 2003
    Location
    Syracuse, Utah, USA
    Search Comp PM
    I appreciate your response. I already have upgraded to Vegas+DVD Architect. However, I find myself using DVD-Lab Pro about 90% of the time because it offers all of those features, plus a couple that DVDA doesn't, like delayed action menu buttons and an easy way to program VM Commands to make them work the way I want.

    In fact, the only reason I have DVD Architect is that it comes with a licensed AC3 encoder that works in Vegas.

    Call me foolish if you want, but my workflow is much smoother this way.
    Quote Quote  
  5. Always Watching guns1inger's Avatar
    Join Date
    Apr 2004
    Location
    Miskatonic U
    Search Comp PM
    not foolish - familiar. that is pretty much how I work.
    Read my blog here.
    Quote Quote  
  6. Member Cunhambebe's Avatar
    Join Date
    Mar 2004
    Location
    São Paulo - Brazil
    Search Comp PM
    I appreciate your response. I already have upgraded to Vegas+DVD Architect. However, I find myself using DVD-Lab Pro about 90% of the time because it offers all of those features, plus a couple that DVDA doesn't, like delayed action menu buttons and an easy way to program VM Commands to make them work the way I want.

    In fact, the only reason I have DVD Architect is that it comes with a licensed AC3 encoder that works in Vegas.
    -What do delayed action menu buttons do? - I've already found out..
    http://www.mediachance.com/dvdlab/Helppro/motioncell.htm

    and... What are VM commands? Hmmmm...difficult things these ones
    - What application do you use to create your subs? DVD-LabPro? I see it has so many different ways to create subtitles such as shadows, etc...Very nice, indeed. Should I try DVD-LabPro? Will I ever leave DVDA's ship? lol
    Thanks in advance.
    Quote Quote  
  7. Member lgh529's Avatar
    Join Date
    Apr 2003
    Location
    Syracuse, Utah, USA
    Search Comp PM
    Delayed action is what Hollywood does all the time. The motion menu begins and shows some preview or transition before you can press "play". Like in Lord of the Rings, it shows the ring being found in the water, then you can press play to see the movie (sorry for the bad example, it was the first thing I thought of). In the old days, unless you were using Scenearist or another high priced professional tool, you had to have seperate motion menus that linked to each other instead of looping. This worked sometimes, but there was always a pause between them, so they always ended up looking kindof goofy.

    VM commands are really cool, but they are a bit advanced, and most people will never use them.
    Quote Quote  
  8. Member Cunhambebe's Avatar
    Join Date
    Mar 2004
    Location
    São Paulo - Brazil
    Search Comp PM
    Delayed action is what Hollywood does all the time. The motion menu begins and shows some preview or transition before you can press "play".
    - DVDA can do this, not the same way I guess, but I already did it a couple of times: >Menu>button>intro for each button is linked to main movies.

    Like in Lord of the Rings, it shows the ring being found in the water, then you can press play to see the movie (sorry for the bad example, it was the first thing I thought of).

    -LOL - LOL - not at all.....no one has nothing to do with your ring in the water...

    VM commands are really cool, but they are a bit advanced, and most people will never use them.

    - So why do u use them????
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!