Setting project ruler start time to start of media

VegasProScripting wrote on 4/22/2013, 10:13 AM
Hi all,

I am using Vegas Pro 12.
In my extension/script, I am trying to load a media with non zero start of media into Vegas. I would like to set the project ruler start time to be the same as the start of media. How do I do this?

A new project is created when loading the media, the project's settings match the media. However, the ruler start time is always 00:00:00:00.
Is there any API call to do this, or retrieve start of media for file?

Best regards,

David

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

[Solution]
I found a solution for this, so I just answer my own question, if anyone else is interested.

Media media = new Media(path);
media.TimecodeIn

:)

Comments

Gary James wrote on 4/22/2013, 2:30 PM
I'm not sure what you're saying. Media is media. Media itself has no start time. Where it's positioned in the timeline determines its Start time. For example, If you want it to be positioned starting at 10 seconds from time zero, import it and place it at time 10 seconds from zero in the timeline.
VegasProScripting wrote on 4/23/2013, 4:36 AM
Media do has start time. It is like embedded meta data.

It is like EXIF for images, which contains things like "date picture taken".
"date picture taken" is not the same as "date created" or "date modified" in file system, and you don't want it to be modified when you copy files around.

You can even use Vegas to embedded a "start time" into your media.
* create new project
* change project ruler start time to 10 seconds
* import a media, place it at the start of timeline
* render

Now, if you open the output media using some video analysis software, you will see 10 seconds start of media.
VegasProScripting wrote on 4/23/2013, 4:37 AM
I know where I can set the ruler start time in the code.
However, I don't know how to get the start of media (using Vegas API).

Any idea?
Gary James wrote on 4/23/2013, 8:11 AM
Ok I understand now. I misunderstood what you were saying. My point was that when you place media in the Vegas timeline it will be positioned starting at whatever time you place it at, regardless of any other information that may be available. But this isn't what you were talking about.

To answer your question, Media is placed in a Take inside a TrackEvent. So the media is located and sized according to the .Start and .Length properties of the TrackEvent that hosts the Take that hosts the Media.