-
looking for a script – import mediasite export into Vegas.
Posted by Jeff Cremeen on May 7, 2014 at 5:17 pmHad a conversation with a mediasite tech and he pointed out the xml file that mediasite uses for timing to show the “slides” (jpg) when playing in their player. He mentioned that he had messed around with making a Vegas script and made one in a several hours but it was still buggy. He suggested that I try posting in the forums because he felt that to an experiences script editor, it would be a simple script to make. Unfortunately, I am not familiar with writing scripts. So if someone is interested, please contact me.
jjsoundzz – gmail
Jeff Cremeen replied 12 years, 1 month ago 3 Members · 17 Replies -
17 Replies
-
Edward Troxel
May 8, 2014 at 2:30 pm -
Jeff Cremeen
May 8, 2014 at 7:33 pmAsked him if he would give me the script and he wasn’t interested. That is when he suggested I find someone. He felt that a proficient coder could do it in a couple hours and it might not cost that much.
It could be because he works for Sonic and it might be a conflict of interest since Sonic sells a piece of software for Mediasite that outputs an MP4 with the slides and video on the same screen for like 4k with a 1k year service fee.
If someone offered a script for Vegas, it could make an affordable alternative to using their piece of software.
-
Taylor Calderone
June 23, 2014 at 10:33 pmI made a script for this and came across this thread in my research. It took me a couple of days rather than hours but Vegas scripting is new to me.
Instructions:
– Download the script at the link below, based on which version of Mediasite you have
– Grab a Mediasite presentation by downloading it from the web interface (important)
– Unzip the Mediasite presentation, put the folder wherever you want
– Open a new Vegas project and run the script
– A File Browser will pop up; point it at the root folder of your unzipped Mediasite presentation
– Done!Mediasite XML Importer – 5.5
Mediasite XML Importer – 6.0
Mediasite XML Importer – 7.0 -
Jeff Cremeen
July 7, 2014 at 6:45 pmThanks. I copied the text into notepad and saved as a .js file in the scripts folder in the vegas folder. It appeared on the scripts list but when I select it, nothing happens.
-
Taylor Calderone
July 7, 2014 at 8:25 pmAre you getting to the file browser popup that says ‘Select the Mediasite folder’? If so, are you pointing the file browser at the correct folder? You need to select the root mediasite folder and not the Content folder.
It could also be version differences with Vegas, just as a guess. I’m using Vegas 12 and haven’t tested it with anything else.
-
Jeff Cremeen
July 7, 2014 at 9:27 pmSo after some poking at it, I got it now to give me selection menu and it adds a track but then it stops. I am wondering since the xml file says “the time”
is it getting hung up on the second ?
I have both 11 and 13 on my computer. Will try it on my laptop with 12 tomorrow.
————————
///////////////////////////////////////////////////////////
// //
// Script that automates the Mediasite XML process //
// //
// Taylor Calderone, 2014 //
// //
///////////////////////////////////////////////////////////import System; // Stuff needed for the code to work
import System.Collections //
import System.Text; //
import System.IO; //
import System.Drawing; //
import System.Windows.Forms; //
import Sony.Vegas; //var skipEverything = false; //
var fbd = new FolderBrowserDialog(); // initializes the folder browser
fbd.Description = “Select the Mediasite folder”; // sets the folder browser’s description
fbd.ShowNewFolderButton = false; // hides the ‘New Folder’ button
var result = fbd.ShowDialog(); // activates the browser and saves the button clicked
var wharr = fbd.SelectedPath; // grabs the filepath that the user selects
if (result == “Cancel”) // if the cancel button is pressed
{ //
MessageBox.Show(“Script Cancelled D:”); // show a message box
skipEverything = true; // and skip the rest of the script to prevent a crash exit
} //if (skipEverything == false){ // makes the cancel button not cause a exit crash
var blarg = new VideoTrack (1); // create an empty track
Vegas.Project.Tracks.Add(blarg); // adds the empty track to the project
var yarr : ArrayList = new ArrayList(); // initialize ArrayList
var imageNumber = 1; // initialize some variables
var r = 0; //
Vegas.Project.Ruler.Format = RulerFormat.Seconds; // change ruler format to secondsvar squarg: StreamReader = new StreamReader(wharr + “\\MediasitePresentation_60.xml”); // Reads an external file and executes code
var line : String; // for each non-empty line of it
while ((line = squarg.ReadLine()) != null) {
if (line != String.Empty) {
if (line.substring(0, 16) == “”) { // If a timestamp is detected in the XML file
yarr.Add(line.slice(16, -7)); // Store the timestamp in the array
}
}
}
squarg.Close();
}for (var q in yarr) { // for each entry in the array
if (imageNumber < 10) { imageNumber = “000” + imageNumber; } else // Adds the extra zeroes to ImageNumber
if (imageNumber < 100) { imageNumber = “00” + imageNumber; } else // (terrible hack because
if (imageNumber < 1000) { imageNumber = “0” + imageNumber; } // .toString(“0000”); isn’t working)Vegas.OpenFile(wharr + “\\Content\\slide_” + imageNumber + “_full.jpg”); // add an image to the timeline
imageNumber++; // increment the imageNumber for the next loopif (r+1 < yarr.Count) { // (this prevents the script from exiting with a crash)
var length = yarr[r+1] – yarr[r]; // calculate length of current slide
var time = new Timecode(yarr[r]/1000); // convert timestamps to Vegas friendly timecode
length = new Timecode(length/1000); //
r++; // increment the counter
} else {
var time = new Timecode(yarr[r]/1000); // custom behaviour for final image
length = new Timecode(30000); } // arbitrary length of 30 secondsfor (var cow in Vegas.Project.Tracks) { // Give the image the correct location & length
for (var moo in cow.Events) { //
if (moo.Selected == true) { moo.AdjustStartLength(time, length, false); } //
} } //
} -
Taylor Calderone
July 7, 2014 at 10:00 pmWhat did you do by ‘poking at it’ that made it get to the file browser? Also, the script only works if you download a Mediasite presentation from the web interface, have you done that? It won’t work if you pull it directly off of the Mediasite box.
…oh, I just realized something. It’ll only work with Mediasite 6.0 as it is now. If you have a different version, go to line 56 (see below) and change the ‘MediasitePresentation_60.xml’ text to match whatever it is your Mediasite version outputs as the xml filename.
var squarg: StreamReader = new StreamReader(wharr + “\\MediasitePresentation_60.xml”); // Reads an external file and executes code
(If this is too complex, take a screenshot of what’s in your Mediasite presentation folder and I should be able to figure it out myself.)
-
Jeff Cremeen
July 8, 2014 at 8:06 pmpoking at it meant… when I copied the text from the forum into “notepade”, I lost all the carriage returns. So I went back to the email from the forum where the carriage returns were in place but then the “\\” became “\\” which caused errors in js. So I compared the two files to reinsert the carriage returns into one and changed the backslashes into backlashes in the other. This gave me two versions to compare to make sure I got the copy correct. I figured this out through my limited knowledge of object oriented languages and counting the line number in the error description given. Of course, this had nothing to do with your code just the whole copying off the forum issue.
we are on version 6.1 but the xml file is still named the same as your code does…
I did try it on vegas 12 and it acts the same as in 11 and 13. But in my reading, I found out that vegas 13 implemented Net4.0 and once 13 is installed it defeats the earlier net versions on the earlier installed versions of vegas.. Would that cause any scripting issues? Both of my locations that have vegas 12 also have 13 installed.
So what I am experiencing is that I run the script, get the browse window, select the correct folder, click OK, then the window goes away, a video track appears and the timecode is changed to seconds. No media is imported into the session, nor on the timeline.
I will try installing 12 on another laptop in my office that has never had vegas before to see if other revisions might have something do to.
-
Jeff Cremeen
July 8, 2014 at 9:17 pm
Reply to this Discussion! Login or Sign Up


