Vegas + Tentacle Timecode Tool (syncing multiple cameras)

kj2184 wrote on 10/7/2022, 4:27 AM

Is anyone else using Vegas with the Tentacle Timecode Tool (from Tentacle Sync)?

I'm trying to sync up two sources using timecode (examples: Canon C300 + Zoom H6, or Canon C300 + Canon 5D). Both sources have Tentacle Syncs attached to them and timecode is successfully jammed via the Tentacle app. Timecode is easily generated on the C300. For the other two sources (H6 & 5D), timecode is recorded onto the left or right channel of an audio track.

From what I understand, Vegas will not recognize the audio timecode created by the Tentacle Syncs...so the solution is to use the Tentacle Timecode Tool for Windows, which converts audio timecode to file timecode. I think I've been using the program successfully...I import the audio tracks, confirm they have audio timecode, and then export them. After exporting, I import the newly generated files back into the Tentacle Timecode Tool to confirm that they now have file timecode. Everything looks good.

However, Vegas does not appear to be reading this (file) timecode successfully. The timecode in/out numbers shown in the project media window are the same as the original media files from the 5D/H6 (see photo). The C300 timecode looks good...but I can't sync it with the other source. Am I missing something? (or is there an easier way to go about all of this?).

Using Vegas Pro 18 (build 527) with Windows 10 Pro.

Comments

Musicvid wrote on 10/7/2022, 7:36 AM

which converts audio timecode to file timecode.

What kind of "file timecode?" There are at least a dozen protocols in use.

Joelson wrote on 10/8/2022, 12:27 PM

In VEGAS, the option that recognizes Timecode in audio files is located in Menu Files / Import / Broadcast Wave Format.

In the window that appears you can see the Timecode of each audio file individually in Timestamp parameter and you will have three options to configure the import to the VEGAS timeline: Arrange, Order Tracks and Positioning.

kj2184 wrote on 10/8/2022, 5:32 PM

@Musicvid LTC timecode according to SMPTE-12M Standard

Unfortunately, the "Import Broadcast Wave Format" technique does not help me out. The "Timecode In/Out" information associated with the H6 files (shown in the project media window) remains incorrect...and that's what needs to be changed in order for Vegas (or Vegasaur) to sync up multiple jammed sources.

Joelson wrote on 10/8/2022, 5:41 PM

@kj2184

Can you send some original audio files for us to check? Just upload to Google Drive or other server.

Musicvid wrote on 10/9/2022, 8:07 AM

@Musicvid LTC timecode according to SMPTE-12M Standard

Unfortunately, the "Import Broadcast Wave Format" technique does not help me out. The "Timecode In/Out" information associated with the H6 files (shown in the project media window) remains incorrect...and that's what needs to be changed in order for Vegas (or Vegasaur) to sync up multiple jammed sources.

Fortunately, I was able to find a discussion I recalled from a few years back. Maybe some of my aging memory has returned! In any event, see if this thread provides any helpful information:

https://www.vegascreativesoftware.info/us/forum/not-recognizing-smpte-ebu-timecode--111764/

NoKi wrote on 10/14/2022, 10:16 AM

You may try this little tool https://www.videotoolshed.com/product/ltc-convert-auxtc/ for converting the audio LTC to BWF file TC. A bit more complicated to use than the Tentacle Windows tool, but it has much more options for BWF handling.

I also had a lot of trouble with converting LTC to a Vegas compatible file TC and ended up with some FFMPEG (et.al.) scripts that fit my needs.

I'm really wondering why Vegas is not supporting LTC natively. Such a basic thing for a pro app :-)

Nils

Belldan wrote on 2/5/2023, 5:05 PM

Hello, I'm wondering if anyone has had success getting Vegas to work with Tentacle Sync. I'd like to buy one or two Sync units to use with my MixPre 3ii and Lumix S5 and Gh5, editing with Vegas Pro 20 (326). However, it seems from reading posts like this (and others) that using the Tentacle Timecode Tool to convert an audio TC to a file TC then importing the BWF into Vegas, is problematic. That is, people have trouble getting Vegas to recognize/open the file.

I haven't actually tried Tentacle Sync with Vegas, I'm just looking for assurances from folks who are using them that they do indeed play well together (before I plop down money on the Sync units). Thanks, Dan

p.s. I don't have the skills to create my own work-around FFMPEG scripts mentioned above (wish I did), and the ltc-convert software is a bit pricey for my use.

NoKi wrote on 2/6/2023, 9:00 AM

I use the Timecode from my Mixpre 10II recorded by some Panasonic cameras (e.g. GH5II). I wrote a c# script that uses ffmpeg and "ltcreader.exe" from the Tentacle installation folder to read the LTC timecode from within vegas. I can give you the script if you like, you only have to change the paths to ffmpeg and "ltcreader.exe".

The video files are not altered in any way. Works for me. I also made a script for reading the BWF timecode in vegas.

Nils

NoKi wrote on 2/6/2023, 11:00 AM

This is the script I wrote to read the LTC for selected media in the media pool. There is no error handling and the paths are hard coded, so you might have to change them. It uses both, "ffmpeg.exe" and "ltcreader.exe" from the Tentacle Timecode Tool folder.

It also converts the LTC framerate to the media framerate, so e.g. a 50 fps video with a 25 fps LTC will be handled correctly. Though, I don't know if dropframe framerates will work.
You will also need to have write access for the video file's path for a temporary WAV file.

Nils

using System;
using System.IO;
using ScriptPortal.Vegas;
using System.Diagnostics;
using System.Windows.Forms;
using System.Text.RegularExpressions;


public class EntryPoint
{
    public static Vegas myVegas;
    
    public void FromVegas(Vegas vegas)
    {
        myVegas = vegas;
        Media[] selectedMedia = myVegas.Project.MediaPool.GetSelectedMedia();
    
        foreach (Media media in selectedMedia)
        {
            if (media.HasVideo())
            {        
                FileInfo file = new FileInfo(media.FilePath);                                        
                string mediaFilePath = Convert.ToString(file);
                string tempAudioFile = WriteTempAudiofile(mediaFilePath);
                // MessageBox.Show(tempAudioFile);
                string ltcreaderOutput = ReadLtcFromWav(tempAudioFile);    
                
                string[] ltcDataArray = ltcreaderOutput.Split('\n');
                                
                if (ltcDataArray[3].Contains("true"))
                {    
                    string strFrameCount = Regex.Replace(ltcDataArray[5], "[^0-9.]", "");
                    string strFrameRate = Regex.Replace(ltcDataArray[8], "[^0-9.]", "");
                                    
                    double frameCount = Convert.ToDouble(strFrameCount);
                    double frameRate = Convert.ToDouble(strFrameRate);
                    
                    Timecode newTimeIn = Timecode.FromSeconds(frameCount / frameRate);
                    
                    media.UseCustomTimecode = true;
                    media.RulerFormat = RulerFormat.TimeAndFrames;
                    media.TimecodeIn = newTimeIn;
                }    
                File.Delete(tempAudioFile);
                
            }    
        }    
        myVegas.Project.MediaPool.OpenAllMedia();
    }    
    
    static string WriteTempAudiofile(string mediaFilePathTmp)
        {
            string ffmpegParameter = " -i " + "\"" + @mediaFilePathTmp + "\"" + @" -c:a pcm_s16le -af atrim=0:10 -y " + "\"" + @mediaFilePathTmp + ".wav" + "\"";
            
            Process processFfmpeg = new Process();
            //######################################################################
            //   Set path to "ffmpeg.exe" here:
            processFfmpeg.StartInfo.FileName = @"C:\Program Files\Tentacle Sync\Tentacle Timecode Tool\ffmpeg.exe";
            processFfmpeg.StartInfo.Arguments = @ffmpegParameter;
            processFfmpeg.StartInfo.CreateNoWindow = true;
            processFfmpeg.StartInfo.UseShellExecute = false;
            processFfmpeg.StartInfo.RedirectStandardOutput = false;
            processFfmpeg.Start();
            processFfmpeg.WaitForExit();
            
            return @mediaFilePathTmp + ".wav";
        }
        
    static string ReadLtcFromWav(string mediaFilePathTmp)
        {
            string LtcreaderParameter = " " + "\"" + @mediaFilePathTmp + "\"";
        
            Process processLtcreader = new Process();
            //######################################################################
            //   Set path to "ltcreader.exe" here:
            processLtcreader.StartInfo.FileName = @"C:\Program Files\Tentacle Sync\Tentacle Timecode Tool\LTCReader.exe";
            processLtcreader.StartInfo.Arguments = @LtcreaderParameter;
            processLtcreader.StartInfo.CreateNoWindow = true;
            processLtcreader.StartInfo.UseShellExecute = false;
            processLtcreader.StartInfo.RedirectStandardOutput = true;
            processLtcreader.Start();
            processLtcreader.WaitForExit();

            string ltcreaderOutputTmp = @processLtcreader.StandardOutput.ReadToEnd();
                        
            return @ltcreaderOutputTmp;
        }

}

And here is the script for reading the BWF timecode of selected audio media. It uses exiftool.exe (https://exiftool.org/), so you have to change the path again.

using System;
using System.IO;
using System.Drawing;
using System.Collections.Generic;
using ScriptPortal.Vegas;
using System.Diagnostics;
using System.Windows.Forms;



public class EntryPoint
{
    public static Vegas myVegas;
    
    public void FromVegas(Vegas vegas)
    {
        myVegas = vegas;
        Media[] selectedMedia = myVegas.Project.MediaPool.GetSelectedMedia();
    
        foreach (Media media in selectedMedia)
        {
            if (media.HasAudio())
            {
            FileInfo file = new FileInfo(media.FilePath);
                                                
            string mediaFilePath = Convert.ToString(file);
            string timeRefSampleRate = GetTimeReference(mediaFilePath);
            string[] array = timeRefSampleRate.Split('\n');
            
            double samples = Convert.ToDouble(array[0]);
            double sampleRate = Convert.ToDouble(array[1]);
            
            Timecode newTimeIn = Timecode.FromSeconds(samples / sampleRate);
                                
            media.UseCustomTimecode = true;
            media.RulerFormat = RulerFormat.Time;
            media.TimecodeIn = newTimeIn;                                                
            }        
        }
        myVegas.Project.MediaPool.OpenAllMedia();
    }    
    
    static string GetTimeReference(string mediaFilePathTmp)
        {
            string exifToolParameter = "\"" + @mediaFilePathTmp + "\"" + @" -s3 -timereference -samplerate";

            Process processExifTool = new Process();
            processExifTool.StartInfo.FileName = @"C:\Program Files\exiftool\exiftool.exe";
            processExifTool.StartInfo.Arguments = exifToolParameter;
            processExifTool.StartInfo.CreateNoWindow = true;
            processExifTool.StartInfo.UseShellExecute = false;
            processExifTool.StartInfo.RedirectStandardOutput = true;
            processExifTool.Start();

            string timeRefSampleRateTmp = processExifTool.StandardOutput.ReadToEnd();          

            return timeRefSampleRateTmp;
        }

}

 

Belldan wrote on 2/6/2023, 7:00 PM

Wow, thank you Nils, very generous of you to offer all of this. I have no idea <how> to use it, lol, but I do have a friend that can step me through the process.

It's curious to me that Vegas can't do this on its own (yet), but at least I know it can be done.

Thanks again! Dan

NoKi wrote on 2/7/2023, 2:11 AM

It's very easy to use the scripts. If you use the right folders, they should even run out of the box:

1. Install Tentacle Timecode Tool to the default directory
("C:\Program Files\Tentacle Sync\Tentacle Timecode Tool\")

2. Install Exiftool to "C:\Program Files\exiftool\exiftool.exe" (just copy exiftool.exe to this folder)

3. Install the scripts (put them in a text file with ".cs" extension and copy them to the vegas "script menu" folder)

VEGAS Pro Scripting FAQs & Resources (vegascreativesoftware.info)

How can I run a block of code as a script?

If you find a script posted on the forum or elsewhere as simple text, this is how you run it in VEGAS Pro:...

Copy and paste the text to a text editor (e.g. Notepad)....
Save the script in the VEGAS Pro scripts folder for your version. 

For example:
C:\Program Files\VEGAS\VEGAS Pro 18.0\Script Menu
C:\Program Files\VEGAS\VEGAS Pro 14.0\Script Menu
C:\Program Files\Sony\Vegas Pro 13.0\Script Menu

Restart VEGAS Pro, or choose Tools > Scripting > Rescan Script Menu Folder.

Run the script from the Tools > Scripting menu.

Nils

jetdv wrote on 2/7/2023, 9:00 AM

@NoKi, @Belldan just put it into [My Documents]\Vegas Script Menu

You'll have to create that folder but then all versions of VEGAS you have installed can see it and you don't have to worry about placing it in multiple places. Also, it's not advised to change a programs "Program Files" folder.

You can name it whatever you want but it needs a .cs extension.

Also, it won't work with Vegas Pro 13 without changing "ScriptPortal" to "Sony".