FORUMS: list search recent posts

looking for a script - import mediasite export into Vegas.

COW Forums : VEGAS Pro

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
jeff cremeen
looking for a script - import mediasite export into Vegas.
on May 7, 2014 at 5:17:43 pm

Had 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


Return to posts index

Edward Troxel
Re: looking for a script - import mediasite export into Vegas.
on May 8, 2014 at 2:30:18 pm

You might post his script with a description of how it is failing and maybe we could debug it for him.

Edward Troxel


Return to posts index

jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on May 8, 2014 at 7:33:27 pm

Asked 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.


Return to posts index


Taylor Calderone
Re: looking for a script - import mediasite export into Vegas.
on Jun 23, 2014 at 10:33:16 pm
Last Edited By Taylor Calderone on Oct 13, 2014 at 2:23:11 am

I 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


Return to posts index

jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 7, 2014 at 6:45:31 pm

Thanks. 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.


Return to posts index

Taylor Calderone
Re: looking for a script - import mediasite export into Vegas.
on Jul 7, 2014 at 8:25:20 pm

Are 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.


Return to posts index


jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 7, 2014 at 9:27:02 pm

So 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 seconds

var 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 loop

if (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 seconds

for (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); } //
} } //
}


Return to posts index

Taylor Calderone
Re: looking for a script - import mediasite export into Vegas.
on Jul 7, 2014 at 10:00:48 pm
Last Edited By Taylor Calderone on Jul 7, 2014 at 10:29:39 pm

What 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.)


Return to posts index

jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 8, 2014 at 8:06:33 pm

poking 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.


Return to posts index


jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 8, 2014 at 8:18:54 pm

Also, All of my computers are running vegas x64 win7 versions...


Return to posts index

jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 8, 2014 at 9:17:48 pm

This is the main folder view with the xml file.....



-------------------------------------------

Below is the content folder view......



Return to posts index

Taylor Calderone
Re: looking for a script - import mediasite export into Vegas.
on Jul 8, 2014 at 9:34:13 pm
Last Edited By Taylor Calderone on Jul 8, 2014 at 9:45:04 pm

Hmm.. well, I have no idea about how Vegas works differently between versions so I can't use that route to fix this. I think it's also safe to assume that the script is running properly since you are getting it to give you a browser window, and to create a track. We just need to figure out why the important second half of the script is not getting triggered.

Everything in those screenshots looks correct (aka, exactly the same as what my successfully imported mediasite folders look like). Can you post the contents of 'MediasitePresentation_60.xml'? Preferably to Pastebin or something so that it doesn't wreck the layout of this forum :)

Oh also, did you first extract the mediasite presentation from the ZIP file it gives you? That might cause the script not to work as well.


Return to posts index


jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 9, 2014 at 6:03:37 pm

below is the the xml file...

http://pastebin.com/3uT3d1Gg

http://pastebin.com/3uT3d1Gg


Return to posts index

jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 9, 2014 at 6:06:28 pm

I am working with the extracted (unzipped) files derived from the publish to go download.


Return to posts index

Taylor Calderone
Re: looking for a script - import mediasite export into Vegas.
on Jul 9, 2014 at 8:02:11 pm
Last Edited By Taylor Calderone on Jul 9, 2014 at 8:11:32 pm

The xml file looks fine. OK... maybe something got broken in the copy/paste process somehow. Here's a link to my copy of the script, delete the .js file you have now and see if this version works instead.

https://mega.co.nz/#!25xDSLyD!6mmnlYBNxcDdqeVfBh7S3Hf7Mwq-NTeO01S-GArhuzA

Edit - ACTUALLY.. looking over your repaste of the script, there is an essential piece missing in the part where it reads the XML file. So I think this may be what gets it working :O


Return to posts index


jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 9, 2014 at 8:22:31 pm

look at that!

It works!

Thanks!

How tough would it be to have it also import the mp4 file as well on another track? So both are lined up? With the mp4 track lined up in a pic in pic arrangement? (very small lower right)

I am trying to automate as much of the process as possible since the guy that currently makes the downloadable version doesn't know vegas and he could be up and running with minimal training...

I am going to test it with another file where I see the slides in the video framing to compare accuracy.

Jeff


Return to posts index

Taylor Calderone
Re: looking for a script - import mediasite export into Vegas.
on Jul 9, 2014 at 8:38:26 pm

Yay!

It's most likely possible to bring in the .mp4 file as well, and to set them up in a side-by-side arrangement, but I'm not going to add that, sorry :). Reason being: it would double the size of the script and take me another week to code, and it would only automate about 2 minutes real-time work (compared to the hours saved by importing the jpg slideshow). In addition, all the work I do after I run the script is unique editing based on various aspects of each project: cropping randomly sized black bars, sizing the picture-in-picture optimally based on camera angles, etc. And you can't automate something that has to be unique each time.


Return to posts index

jeff cremeen
Re: looking for a script - import mediasite export into Vegas.
on Jul 9, 2014 at 10:25:28 pm

Well, thanks again. This is going to save the mp4 guy a ton of time. We are hoping that Mediasite will come out with an automatic server system that doesn't cost thousand of dollars. But this is a better work around than the screen capture thing that they have been doing.

Jeff


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]