Automate population of timeline

Lyris wrote on 3/25/2012, 12:52 PM
Right now I'm working through approximately 130 clips which will be used to analyse people's speech.

The edit instructions basically read like this:

Insert 00:42 until 00:52
5 second pause
Repeat 00:42 until 00:52
5 second pause
Insert 01:25 until 01:40
5 second pause
Repeat 01:25 until 01:40

And so on...

The format of the videos is identical each time: clip, 5 secs of black, same clip again, 5 secs of black, then the whole cycle begins again with a new clip.

The only thing that changes is the timecodes we want included.

It's pretty inefficient to go through all 130 clips manually. Can anyone tell me if it's possible to feed Vegas a list of the bits we want, and have it lay things out automatically?

Comments

JohnnyB wrote on 3/25/2012, 1:19 PM
Yes, this sounds straightforward.

And it will help you to understand the object model and terminology some more: I think you're using clips as in events? or source media?; and you want one or more source media files to be places on a track on the timeline in 5 second chunks (events) with a 5 second gap until that's done, yes?
Lyris wrote on 3/25/2012, 3:13 PM
That's right, yeah - although the length of the clips is variable, the 5 seconds only refers to the moments of black inbetween. We have one source media file from the camcorder - I guess I could bring that into the timeline to create an event, then run a script which would cut it up into several events then duplicate them?
Gary James wrote on 3/25/2012, 6:42 PM
"The edit instructions basically read like this:

Insert 00:42 until 00:52
5 second pause
Repeat 00:42 until 00:52
5 second pause
Insert 01:25 until 01:40
5 second pause
Repeat 01:25 until 01:40

And so on..."

I'm failing to understand your question. Are you saying that you insert a clip at time 00:00:42.00 for a duration of 10 seconds, and then have a 5 second gap? If so, it sounds like you're overwriting that clip with a new one at the same time when you repeat the process!
Lyris wrote on 3/26/2012, 12:37 PM
Sorry, no - I mean to include 00:00:42.00 --> 00:00:52.00 from the source media.
altarvic wrote on 3/27/2012, 3:15 AM
> "Can anyone tell me if it's possible"

It's possible. But I doubt that you will find a ready-to-use solution.
You have to write the script yourself or hire a professional.
JohnnyB wrote on 3/27/2012, 6:43 AM
Still don't know what you're trying to do, to summarise so far:

A single piece of media.

Variable length events (don't know how the length of the "clip" is determined? Is it manually?).

Pop in 5 second gaps between the events.

So, for example, you could manually put the whole source onto the timeline, split it into events, then run a script to put in the 5s gaps.

In order to create this script, you will need to know c#, the vegas object model or hire someone who does.
Lyris wrote on 3/27/2012, 6:17 PM
JohnnyB, that's it. A single piece of media, with manually determined In and Out timecodes.

Looks like it's time to learn scripting if there's nothing like this already. Thanks!
johnmeyer wrote on 3/27/2012, 8:02 PM
I'm sure I am being my usual dense self, but why don't you just create an EDL in a spreadsheet? If you aren't familiar with this, take an existing Vegas project and then use the File --> Save As command and then change "Save as Type" to EDL. Then, open this text file in Excel, using the delimited text option (with the delimiter set to semi-colon).

To make life much easier for yourself, change the ruler timecode in Vegas to Absolute Frames before you do this (dealing with date/time information in Vegas is brutally hard, and when you then add the "peculiar" timecode used in video editing, where the information to the right of the decimal is base 29.97), dealing with it in Excel is pretty much impossible. Even if you use decimal time, it is tough. So, my advice is to use frames.

Once you've examined this spreadsheet, you should be able to quickly figure out how to insert your media names and timecodes.

Like I said, I may be missing something, but this approach ought to be much, much easier than trying to do the same thing with scripts. Probably more flexible as well.


altarvic wrote on 3/28/2012, 5:28 AM
> "A single piece of media, with manually determined In and Out timecodes"

Do you know these timecodes BEFORE opening your media files in Vegas?
Or you set In/Out points manually on the timeline?
Gary James wrote on 3/28/2012, 8:42 AM
"JohnnyB, that's it. A single piece of media, with manually determined In and Out timecodes."

Let me ask you this. Would the following solution work for you?

A. You drag your single piece of media to the timeline.
B. You manually split the media into individual events at specific places.
C. You run a script that adds a 5 second gap between the individual events.

Does this do what you want?
JohnnyB wrote on 3/28/2012, 11:26 AM
As Gary says, if you're ok to run with manually splitting the media on the timeline, the script to then put 5s gaps between them should be straightforward. Have a quick look at some of the samples in the SDK, if they're not too horrific to you, and you're ok with list processing in c#, you're good to go. Otherwise, get help.

I don't see that using an EDL plus a spreadsheet is a particularly productive idea because you'll likely still need script (unless you reformat and paste into the event details window). Vegas doesn't import modified EDLs, and in any case, it's much easier manipulating the object model in c#.

Also, have you ever tried messing around with time formats in Excel? I'm quite good at Excel, and it stinks.
johnmeyer wrote on 3/28/2012, 7:34 PM
I don't see that using an EDL plus a spreadsheet is a particularly productive idea because you'll likely still need script (unless you reformat and paste into the event details window). Vegas doesn't import modified EDLs, and in any case, it's much easier manipulating the object model in c#.I don't think you quite understand. It is true that Vegas doesn't import EDLs from other programs, but it most definitely DOES export AND import its own EDL format. This format is trivial to import and export from Excel, or from pretty much any other application.

If all the OP wants to do is to add five seconds between existing events on a timeline, then that is a trivial script that can be written in jscript in ten minutes. However, I thought the person wanted to drive the entire timeline from an external process so that the timeline could be re-populated with new events each time a new project came along (his initial request was: "Can anyone tell me if it's possible to feed Vegas a list of the bits we want, and have it lay things out automatically?"). If so, doing that from a script would take several hours of programming. By contrast, the Excel approach will take virtually no time at all.

Also, have you ever tried messing around with time formats in Excel? I'm quite good at Excel, and it stinks.I think you may not have read my post above. I said exactly that same thing, and I offered the solution to the problem: use absolute frames rather than time. If you need to use time as input, then you can create a user-defined formula in Excel that will take a timecode input and convert it to frames.

I agree that under no circumstances (as I said quite clearly in my previous post) do you want to deal with time, much less video drop or non-drop timecodes, in Excel.

Lyris wrote on 3/29/2012, 5:58 PM
@Altarvic:
"Do you know these timecodes BEFORE opening your media files in Vegas?
Or you set In/Out points manually on the timeline?"

Yes, the in and out points are delivered on paper by a non-editor.

@Gary James:
"Let me ask you this. Would the following solution work for you?"

That example would certainly make things easier, but I was hoping for a solution that chopped the clip up according to the in/out points, too.

johnmeyer: that's an excellent solution - I totally forgot about Vegas' EDL support! I'll give that a shot, thanks a lot.
JohnnyB wrote on 3/30/2012, 7:11 AM
Yep, I've done the import/export thing, both manually and programmatically producing the "EDL" in the right format for Vegas import.

Thanks for the tip on frames, that eases things quite a lot.

I don't like that solution over scripting it "properly" in the first place, but maybe that's down to your comfort zone & current knowledge. Also, maybe what repeats & variants will be needed for this in future. Whatever works for you.
Gary James wrote on 3/30/2012, 8:17 AM
"To make life much easier for yourself, change the ruler timecode in Vegas to Absolute Frames before you do this ..."

John, this is a very clever solution that I hadn't considered. But it may not be possible to do what you suggest. I tried saving my Vegas Project to an EDL file after changing the Ruler to Absolute frames. But the EDL file still appears to be showing time in milliseconds in all related columns.

I thought this may be a SVP v11 issue so I tried it on a SVP v9 project with the same results.

Am I doing something wrong? I always end up with time in milliseconds regardless of the ruler timecode format. Also, if this is possible, how would Vegas know which ruler format was used saving the file without any ruler format info included in the EDL file?

Gary
johnmeyer wrote on 3/30/2012, 11:46 AM
But it may not be possible to do what you suggest. I tried saving my Vegas Project to an EDL file after changing the Ruler to Absolute frames. But the EDL file still appears to be showing time in milliseconds in all related columns.OK, you are right, but it is actually good for you the way it works.

The ruler format DOES affect the Edit Details display. You can cut from that and get the information out, and for markers, you can paste back into it. I do this all the time, and that's where I came up with the "trick" of using frames. Unfortunately, while Vegas does allow limited pasting back into the Events section of the Edit Details section, even if you preselect rows or columns (which is required when pasting Marker information), I have never gotten the paste operation to work reliably for Events (although you CAN actually paste some information from individual columns).

So, that explains why I recommended changing to Frames on the ruler format.

The reason I thought that it worked for the EDL (which, as you correctly point out, it doesn't) is that when I looked at the EDL, there was nothing to the right of the decimal, and the data looked like the correct format for frames. However, as you again correctly point out, the information is formatted as milliseconds. However, milliseconds are just as easy to work with in Excel as frames because, like frames, they completely avoid having to deal with the date/time code conversions in Excel. As you know, Excel converts things that it thinks are dates or times into a large number which are then formatted in various ways for display. Trying to add or subtract these is often fraught with all sorts of problems.

By contrast, dealing with the numbers in the EDL should be a walk in the park because Excel will just see them as integer numbers. All you have to do is write one single function (a single formula) that will convert into milliseconds the information you are receiving from your client. That should take thirty seconds to write and debug. If it were me, I'd write it as a

user-defined function.

If you are not familiar with this, or if you need any help with Excel, I'd be glad to help, although an even better resource (and also one of the most genuinely helpful forums in the entire Internet universe) is this place:

Mr. Excel

I've done just about everything you can name in Excel (or before that, 1-2-3, and before that, Visicalc), but I ran into some really nasty anomalies in Excel when doing a big project for converting patient records for a doctor's office. I posted my questions in this forum, and within an hour (unbelievable response speed), I had received several extremely detailed, custom responses. You don't get any of the usual "hazing" that has become common in some forums (including this one) and you seldom get anyone who isn't brighter than you are (well, brighter than me, for sure).

I sometimes go there just to enjoy the amazing exchange of ideas. If the Internet merged with heaven, all forums would look like this one.

I can't recommend it too much.

Lyris wrote on 4/16/2012, 1:40 PM
So if anyone's interested, I ended up automating this process not with EDLs or Vegas scripts, but with an AutoHotKey script.

I made a basic GUI where I could input TC in and TC out (in minutes:seconds format). The script makes the timecodes Vegas friendly and sends mouse clicks and hotkeys to the trimmer (CTRL+G to select in, CTRL+SHIFT+G to select out, A to add to timeline) to do what I want. Of course because it works by intercepting the mouse, it's specific to my own PC's resolution, and of course my Vegas layout, otherwise I'd share it.
johnmeyer wrote on 4/16/2012, 2:23 PM
I ended up automating this process not with EDLs or Vegas scripts, but with an AutoHotKey script.Thank heaven for "sendkeys" and all its variants. It is the ultimate "kludge," but it is amazing how often you can quickly solve a problem by just feeding keystrokes to an application. Well done, and I am very glad you got your problems solved.

Whenever I hear about this sort of solution, I can't help but think of my contemporary, Philippe Kahn and his original software program, Sidekick. It was a "terminate but stay resident" (TSR) DOS program that gave you the first hint of what multi-processing would eventually "feel" like under Windows. One of its several features was a way to feed keystrokes to apps. Very clever stuff, at the time.