Add clips at ruler timecode.

farss wrote on 11/12/2010, 5:54 AM
I have 100s of clips all with TC matched to time of day. I have set my timeline start timecode to match time of day of the first clip I shot. I would like to add all the clips to the timeline so their timecode matches the ruler TC. I can do this by hand one at a time which is very tedious. Is there a script to automate this?

TIA
Bob.

Comments

megabit wrote on 11/12/2010, 7:35 AM
Usually, when keeping the names your acquisition device has given to consecutive clips, you can have them in the right order in Vegas Explorer window - selecting all and dragging by the first one should work the treat.

Unless you have them named randomly?

Piotr

AMD TR 2990WX CPU | MSI X399 CARBON AC | 64GB RAM@XMP2933  | 2x RTX 2080Ti GPU | 4x 3TB WD Black RAID0 media drive | 3x 1TB NVMe RAID0 cache drive | SSD SATA system drive | AX1600i PSU | Decklink 12G Extreme | Samsung UHD reference monitor (calibrated)

altarvic wrote on 11/12/2010, 8:15 AM
Maybe I misunderstood, but isn't Tools>Multicamera>Layout tracks by media timecode command does what you want?
megabit wrote on 11/12/2010, 9:32 AM
This should work - not sure about using TOD, though.

And, of course the method I mentioned above could only guarantee the clips' sequence and order - so if there are any gaps between them, it's not enough for what Bob needs...

Piotr

AMD TR 2990WX CPU | MSI X399 CARBON AC | 64GB RAM@XMP2933  | 2x RTX 2080Ti GPU | 4x 3TB WD Black RAID0 media drive | 3x 1TB NVMe RAID0 cache drive | SSD SATA system drive | AX1600i PSU | Decklink 12G Extreme | Samsung UHD reference monitor (calibrated)

Grazie wrote on 11/12/2010, 9:39 AM
Have the Clips in Order in ProjMedia

Select all in PM and then Right Drag selection to T/L - Release and use "Add Across Time".

Works for me.

Grazie

farss wrote on 11/12/2010, 2:45 PM
"Maybe I misunderstood, but isn't Tools>Multicamera>Layout tracks by media timecode command does what you want?"

Very close, the clips do end up at the correct timecode.
Problem is each clips is now on its own track, 270 of them to be exact!

"Select all in PM and then Right Drag selection to T/L - Release and use "Add Across Time"."

That seems to only add the clips ignoring the timecode, no different to Left Drag to T/L. I would have thought it would work, strange.
I've never been able to ge those Right Drag option to work, Add as Take in particular is a bust.

Bob.




Rosebud wrote on 11/12/2010, 3:34 PM
Hi Bob,

Please, try this one (.cs script) :


/*
* Add clips at ruler timecode
* November 12 2010 / Gilles Pialat
*
*/

using System;
using System.Windows.Forms;
using Sony.Vegas;

public class EntryPoint
{
Vegas myVegas;
public void FromVegas(Vegas vegas)
{
myVegas = vegas;
Media[] selectedMedia = myVegas.Project.MediaPool.GetSelectedMedia();

if (selectedMedia.Length == 0)
MessageBox.Show("Please select media in mediapool before to run this script");
else
{
myVegas.Project.Tracks.Add(new VideoTrack(0));
myVegas.Project.Tracks.Add(new AudioTrack(1));
foreach (Media media in selectedMedia)
{
VideoEvent videoEvnt;
AudioEvent audioEvnt;
TrackEventGroup group = new TrackEventGroup();
myVegas.Project.Groups.Add(group);

foreach (MediaStream mediaStream in media.Streams)
{
if (mediaStream.MediaType == MediaType.Video)
{
videoEvnt = new VideoEvent(media.TimecodeIn, media.Length);
Take activeTake = new Take(mediaStream, true);
myVegas.Project.Tracks[0].Events.Add(videoEvnt);
videoEvnt.Takes.Add(activeTake);
group.Add(videoEvnt);
}
if (mediaStream.MediaType == MediaType.Audio)
{
audioEvnt = new AudioEvent(media.TimecodeIn, media.Length);
Take activeTake = new Take(mediaStream, true);
myVegas.Project.Tracks[1].Events.Add(audioEvnt);
audioEvnt.Takes.Add(activeTake);
group.Add(audioEvnt);
}
}
}
}
}
}
farss wrote on 11/12/2010, 4:13 PM
Thank you so much,
that is working perfectly apart from one very minor issue that I can live with.
If I use it to add a bunch of clips to the T/L a second time it appears to always create new track(s) rather than add them to the selected track(s). Certainly not a show stopper. I can simply move the events down to the required tracks and deleted the unwanted tracks.

Bob.
farss wrote on 11/12/2010, 6:06 PM
Rosebud,
a simply HUGE thank you for that script.
I now have 270 clips synced to 9 hours of audio. Doing this by hand was taking forever.

Bob.
Grazie wrote on 11/12/2010, 7:51 PM
I'm obviously not understanding anything about this at all. And that is a bust.

Where had you previously mentioned about synching to audio? Totally confused.

Grazie
Chienworks wrote on 11/12/2010, 8:44 PM
Grazie, say you had a 9 hour project based on 9 hours of the day, say from noon to 9pm. The project is mostly the sound going on during that 9 hours, so you have 9 hours of audio on the timeline.

Now, suppose that at various times during that 9 hours you shoot some short video clips now and then. Not the full 9 hours, just little snippets.

Now suppose that you want to put those snippets on the timeline so that they line up against the 9 hour background audio at the time they were taken. You'll end up with the clips in sync with the times they were originally shot, but there may be lots of large gaps between them. For example, a clip shot at 4:25:17 pm will start at 4:25:17 on the timeline even if the previous clip ended at 4:02:36.

Now, i'm not saying that Bob mentioned audio to begin with, but it fits the scenario whether it was mentioned or not, and he did mention audio at the end.
Grazie wrote on 11/12/2010, 9:33 PM
Kelly, thanks for that. Really appreciate the explanation.

So, Bob wanted to place clips that were taken at various times of the day and have the gaps in videoing show as spaces. He wanted to do this, we now surmise, because he had another motive/reason for doing so: Bob already had an existing audio track that was to be his full-day reference.

Now, how was I to know that? You guys had picked up on some clue that evaded me. If I had realised that then my I wouldn't have proffered the solution I had. I was more
concered that Bob could populate his T/L with his clips in order and, naturally, without gaps. Who'd have thought huh? Well, now I know, and obviously you guys had, that that was exactly what he was after. I now see, the clue to the clue was this mention of "timecode". I still have much to learn.

What a great script Gilles!

Grazie
Rosebud wrote on 11/12/2010, 10:18 PM
Bob,

I'm very glad to help you.
Delete those lines if you don't want to create new tracks each time you are running the script:
myVegas.Project.Tracks.Add(new VideoTrack(0));
myVegas.Project.Tracks.Add(new AudioTrack(1));

Nota: The first track should always to be a video track and the second an audio track.
farss wrote on 11/12/2010, 10:35 PM
"So, Bob wanted to place clips that were taken at various times of the day and have the gaps in videoing show as spaces. He wanted to do this, we now surmise, because he had another motive/reason for doing so: Bob already had an existing audio track that was to be his full-day reference. "

YES !

Actually the audio track is kind of irrelevant in the wider view of why one might wish to do this. One might have several cameramen wondering around just picking up interesting shots. Maybe some of them got different angles of the same thing. Also these kind of all day festivals have schedules, so having a timeline of the various bits and pieces of video that matches the plan for the day makes it easy to identify what was going on.

In my own case indeed I had an all day audio recording that I'm using as the master reference. The Edirol R-4 and R-44 can be setup to name files and folders using date and time the recording starts. Very handy. As the files are written to SDHC cards in FAT32 each file is only 2GB so every 2 hours or so I have a new file with date and time, just to be sure, to be sure, that everything is correct.

Now if someone can recommend a way to avoid heatstroke, I found one of those sun shades you put behind your car's windscreen to get the camera protected but only had a narrow brimmed hat for myself. That and a general lack of fluids.....

Bob.

altarvic wrote on 11/12/2010, 10:57 PM
"Problem is each clips is now on its own track, 270 of them to be exact!"

If all the clips have the same tape name, they will be placed on the same track
Grazie wrote on 11/12/2010, 11:03 PM
One man's irrelervance, is another man's clarity. Ah, if only everybody thought like I - NOT!

Grazie
farss wrote on 11/13/2010, 2:12 AM
"If all the clips have the same tape name, they will be placed on the same track"

OK, that makes sense except these clips are MXF from a EX camera. How does one assign a tape name to those?
Come to think of it, some cameras use tapes that are only 40 minutes long. I believe one can assign camera numbers to each of the physical cameras and that is stored on the tape. Question is will this function in Vegas use that data?

Bob.