4 Replies Latest reply on Feb 13, 2018 3:56 AM by Aecorn

    How to get clip starting timecode

    anoopnr134 Level 1

      Hi,

       

      Is there any way to get the premiere project asset starting timecode from extendscript?

      Any properties we can get from app.project.rootItem.children[0] or qe.project.getItemAt(0)

       

      clip Timecode.png

      Thank you.

        • 1. Re: How to get clip starting timecode
          Bruce Bullis Adobe Employee

          The best way to get details about a sequence is exporting it to FCP XML. If you're looking for a sequence's starting time code:

           

                 var startTimeOffset = activeSequence.zeroPoint;

          • 2. Re: How to get clip starting timecode
            emam-dev Level 1

            Hi Bruce,

             

            What about the clip start timecode without converting that into a sequence?

            Any option to get the start time code of a clip in the latest Premiere pro versions?

             

            Thanks and Regards,

            Anoop NR

            • 3. Re: How to get clip starting timecode
              Bruce Bullis Adobe Employee

              There's lots of interesting time information available in PPro's private project metadata, for each projectItem.

               

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

               

               

              if (app.isDocumentOpen()) {

               

               

              var projectItem= app.project.rootItem.children[0]; // just grabs first projectItem.

               

               

              if (projectItem) {

               

               

              if (ExternalObject.AdobeXMPScript === undefined) {
              ExternalObject.AdobeXMPScript= new ExternalObject('lib:AdobeXMPScript');
              }

               

               

              if (ExternalObject.AdobeXMPScript !== undefined) {// safety-conscious!

               

               

              var projectMetadata= projectItem.getProjectMetadata();
              var xmp= new XMPMeta(projectMetadata);
              var obj= xmp.dumpObject();
              }
              }

              }

              • 4. Re: How to get clip starting timecode
                Aecorn Level 1

                Ive been fiddeling around a bit and this might be what you are looking for:

                 

                    var startTicks = app.project.activeSequence.zeroPoint;

                    var startSeconds = startTicks / 254016000000 ;

                    alert (startSeconds);

                 

                (damn, saw Bruces full answer after writing this).

                Try to see if you are able to convert from ticks to your timecode, there are other forum posts regarding this, and it depends on your fps.

                 

                 

                Regarding clips

                If you know where the clip is in the timeline, say its the first clip in the second track in the active sequence you can do:

                 

                app.enableQE();

                var startTime = app.project.activeSequence.videoTracks[1].clips[0].start;

                alert (startTime);

                 

                This time may be relevant to the start time of your sequence though? Im not sure without testing.

                You can walk the timeline for names of clips etc... Also remember you can use markers for stuff...

                 

                Here's a snippet I wrote that might help you thinking, it picks the first clip in the first video track and copies it to the second, with the same editpoints. Im having some trouble of making it ignore audio connected to the video-projectItem though...

                 

                 

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

                        app.project.activeSequence.videoTracks[1].insertClip(clip1.projectItem, clip1.start);      

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

                 

                 

                        if (clip1.start.seconds > clip2.end.seconds){

                            clip2.end = clip1.end;

                            clip2.start = clip1.start;

                        }else{

                             clip2.start = clip1.start;

                            clip2.end = clip1.end;

                            }

                 

                 

                        clip2.inPoint = clip1.inPoint;

                        clip2.outPoint = clip1.outPoint;

                        clip2.duration = clip1.duration;

                 

                There is a function for setting the "ZeroPoint" which might be what your after, setZeroPoint(), but I cant find a twin detection function, aka getZeroPoint().