• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to get source clip times?

Explorer ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

How to get source clip times, for sequence markers or player position or clip start and end points?

If I make a sub sequence and change start time, I lose original sequence time values.

so I need original clip times. Is there a way to get this?

TOPICS
SDK

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Dec 08, 2017 Dec 08, 2017

Here's some proof of concept code. Please bear in mind though the QE DOM is not officially supported. This assumes Your CTI is placed somewhere on the first clip which is placed on the first video track of your timeline. The caveat here is this currently won't work with frame based file sequences.

var CTI_ticks = app.project.activeSequence.getPlayerPosition().ticks;

var clip = app.project.activeSequence.videoTracks[0].clips[0];

if ((parseInt(clip.start.ticks) <= parseInt(CTI_ticks)) && parseInt(CTI

...

Votes

Translate

Translate
Engaged ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

Let me rephrase to make sure this is understood correctly:

You have a sequence A containing some clips, which you duplicate (or create a nested sequence from) to sequence B, and you then change the starting time(code) of sequence B.

Now you want to iterate through sequence B, but you need to have the in and out values of the respective clips in sequence A, is this correct?

In that case, I would tend to think if sequence B is a "clip" in sequence A, and you know the in-point of sequence B (in sequence A), it's pretty straightforward, isn't it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

to simplify my request.

How  do you get a clip time in source monitor ,when you place a marker in a sequence timeline ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

Thanks for clarifying. So basically you want to perform a "match frame" operation.

Well, PrPro gives you the start time for a clip on a track, and when you subtract this from the current playhead position in the timeline, and add the result to the clip's inPoint, you're pretty much there, aren't you?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 04, 2017 Dec 04, 2017

Copy link to clipboard

Copied

Exactly. I'm trying to find "Match Frame" Time.

But I tried above method, but its not giving me time from source clip except 0. May be i'm not doing it right.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 05, 2017 Dec 05, 2017

Copy link to clipboard

Copied

Anyone know how to get CLIP TIME (Seconds, Ticks or TimeCode) from at corresponding Match Frame Position of a Player Position in timeline sequence ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 08, 2017 Dec 08, 2017

Copy link to clipboard

Copied

Here's some proof of concept code. Please bear in mind though the QE DOM is not officially supported. This assumes Your CTI is placed somewhere on the first clip which is placed on the first video track of your timeline. The caveat here is this currently won't work with frame based file sequences.

var CTI_ticks = app.project.activeSequence.getPlayerPosition().ticks;

var clip = app.project.activeSequence.videoTracks[0].clips[0];

if ((parseInt(clip.start.ticks) <= parseInt(CTI_ticks)) && parseInt(CTI_ticks) < parseInt(clip.end.ticks)) {

    var offset = parseInt(CTI_ticks) - parseInt(clip.start.ticks); // ticks property is a string thus needs conversion

    var frame = parseInt(clip.inPoint.ticks)+offset;

    var ftime = frame/254016000000;

    app.enableQE();

    qe.source.openFilePath(clip.projectItem.getMediaPath());

    if (ExternalObject.AdobeXMPScript === undefined) {

        ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');

    }

    if (ExternalObject.AdobeXMPScript !== undefined) {

        var info = new XMPMeta(clip.projectItem.getProjectMetadata());

        var theNS = "http://ns.adobe.com/premierePrivateProjectMetaData/1.0/";

        var timebase = info.getProperty(theNS,"Column.Intrinsic.MediaTimebase");

        timebaseF = parseFloat (timebase.value.replace (" fps","").replace(",",".")); // should a comma be used instead of a decimal point

       

        var frames = timebaseF * (ftime-Math.floor(ftime));

        var timeFormat = ""+Math.floor(ftime)+"."+frames;

        qe.source.player.startScrubbing();

        qe.source.player.scrubTo(timeFormat);  // will take either TC or seconds.frames, not seconds.milliseconds!

        qe.source.player.endScrubbing();

        // or use qe.source.player.setInPoint(timeFormat) // will take either TC or seconds.frames, not seconds.milliseconds!

    }

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 13, 2017 Dec 13, 2017

Copy link to clipboard

Copied

Hi maximus1105​,

have you tried my proposed solution? Follow-up is always appreciated...

Best,

e.d.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 13, 2017 Dec 13, 2017

Copy link to clipboard

Copied

LATEST

e.d,

I'm sorry not to respond immediately.

I simply opened a sequence and tried to run the code as-is, from ExtendScript Toolkit ,

Premiere Pro stopped responding and I had to Shut down. And I couldn't open the sequence again. I had to get a copy of sequence to restore it.

I'm sure I might have done something wrong.

May be I have to include additional libraries. I'm not sure.

But thanks for your solution. I'll try again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines