13 Replies Latest reply on May 24, 2016 10:15 AM by innerspaceouterspace

    Setting XMP data having inconsistent results

    innerspaceouterspace Level 1

      $.pipelineTools.MetadataController.prototype.setMediaStartTimecode = function(timecode) {

          var path = "Column.Intrinsic.MediaStart"

          // Testing

          val = this.xmpMetadata.setStructField(

              XMPConst.NS_DM,

              "startTimecode",

              XMPConst.NS_DM,

              "timeValue",

              "00:00:00:00"

          )

          this.xmpMetaChanges.push(path)   

       

          // "http://ns.adobe.com/xmp/1.0/DynamicMedia/"

          var val = this.xmpMetadata.setStructField(

              XMPConst.NS_DM,

              "altTimecode",

              XMPConst.NS_DM,

              "timeValue",

              timecode

          )

          this.xmpMetaChanges.push(path)

      }

       

      It's always reporting in ESTK the correct timecode, but isn't always setting the same value.

      As you can see in ESTK:

       

      However, random clips are getting set to 00:00:00:00

      Is there a logic to how the metadata is pulled? I've tried ensuring that there is a startTimecode field first (because sometimes that field just completely doesn't exist in some cases and needs to be created), but this doesn't do anything. Alttimecode is the one we want to use because it's the offset we're using for the potential of having extra frames being brought in at a future point.

       

       

      The above is a clip that was supposed to have MediaStart set to 00:00:04:05 and this is a clip that had the value correctly set:

       

       

      Both using the same code, same calculation, same session.

       

       

      Seems to be inconsistent and dumping the XMP on the files results in this:

       

      grw020(successful):

               <xmpDM:startTimecode rdf:parseType="Resource">

                  <xmpDM:timeFormat>24Timecode</xmpDM:timeFormat>

                  <xmpDM:timeValue>00:00:00:00</xmpDM:timeValue>

               </xmpDM:startTimecode>

               <xmpDM:altTimecode rdf:parseType="Resource">

                  <xmpDM:timeValue>00:00:04:05</xmpDM:timeValue>

                  <xmpDM:timeFormat>24Timecode</xmpDM:timeFormat>

               </xmpDM:altTimecode>

       

       

      soc020(unsuccessful):

               <xmpDM:altTimecode rdf:parseType="Resource">

                  <xmpDM:timeValue>00:00:04:05</xmpDM:timeValue>

               </xmpDM:altTimecode>

               <xmpDM:startTimecode rdf:parseType="Resource">

                  <xmpDM:timeValue>00:00:00:00</xmpDM:timeValue>

               </xmpDM:startTimecode>

       

       


      As you can see, grw020 somehow magically gets the timeFormat string and using the same code in the same session, soc020 does not get the timeFormat value.
      Now I'm curious as to how the successful clip is getting the stray value, and secondly - why it's populating incorrectly? This is in a sequence that is at 23.976 and It's populating with 24Timecode - when it should be populating with 23976Timecode like I've seen in other clips.

      Overall, this seems to be a very inconsistent setting of data.

       

      Thanks.

        • 1. Re: Setting XMP data having inconsistent results
          Bruce Bullis Adobe Employee

          I've never heard of a problem like this.

           

          Instead of snippets, could you please send a contiguous .jsx file containing all referenced code, (small!) footage, and step-by-step instructions to repro the problem in ESTK?

           

          I find the lack of semicolons in your code above a little terrifying, but that's just familiarity talking.

          • 2. Re: Setting XMP data having inconsistent results
            innerspaceouterspace Level 1

            I really don't think it's going to be feasible to break it out, our codebase is pretty tightly integrated, covering multiple js files and the jsx file. I'll give it a shot and e-mail it to you.

             

            I do have a related question, though.

             

            Is there some sort of switch(hidden or not) inside of Premiere that determines when to read/use this information and how it interprets the information?
            Everything I do indicates that I appear to be setting the information correctly in the metadata, given that I'm dumping the XMP on the clips after importing them into the scene and the timeValue data is correct, even if the timeFormat code is not there.

             

             

            Basically, is there something behind the scenes I may not be seeing that's determining which of the values to use? Like perhaps it's determining to use the startTimecode(0) instead of the altTimecode(4:05) and I don't see where that is happening?

            Based on the XMP Specification, it should use altTimecode instead of startTimecode, but this isn't the result we're seeing.

             

             

             

             

             

             

            And semicolons are terrifying None of the code has it if it can be helped.

            • 3. Re: Setting XMP data having inconsistent results
              Bruce Bullis Adobe Employee

              Whatever you can do to provide a repro case, with step-by-step instructions on how to repro the issue, would be much appreciated.

               

              I don't know of any switch within PPro for deciding when to pay attention to [stuff]; you could determine what we're doing, by importing similar assets with different XMP fields set.

              • 4. Re: Setting XMP data having inconsistent results
                innerspaceouterspace Level 1


                So I did a diff on the XMP before and after the setting of the altTimeCode and the above is the result.
                Premiere will not use the altTimecode unless you set startTimeScale and startTimeSampleSize. You don't need to have the startTimecode, but it won't use altTimecode unless those two are set. Doing the diff above showed me what the main differences were before and after updating the clips and allowed me to find the two necessary properties.


                I started hard-coding in the startTimeScale and startTimeSampleSize and the function works as expected now.

                 

                 

                Bruce, I need to know what the startTimeScale and startTimeSampleSize values are so I can figure out how to dynamically generate them - they're not in the XMP documentation (general), I'm not sure if there's Premiere specific XMP documentation. If there is, that would be awesome.
                In addition - timeFormat still seems to be getting incorrectly generated. I've seen it sometimes generate at 23976Timecode(which is correct) but frequently it says 24Timecode. Our projects are running at either 23.976 or 29.976, and both of these are acceptable values according to the XMP documentation.


                In addition to that as well, if timeFormat can be 23976Timecode, wouldn't that mean that startTimeScale could/should also be 23976/23.976 and not 24?

                 

                Marking this as correct as it is the solution.

                • 5. Re: Setting XMP data having inconsistent results
                  Bruce Bullis Adobe Employee

                  I need to know what the startTimeScale and startTimeSampleSize values are so I can figure out how to dynamically generate them

                  Those will depend on the time base of the projectItem in use.

                  • 6. Re: Setting XMP data having inconsistent results
                    innerspaceouterspace Level 1

                    I'm sorry, maybe my request wasn't as clear as I'd intended - I'm looking for what they are in the context of Premiere - not in the context of the metadata.

                     

                    For instance, there are two uses for setting the metadata for altTimecode - updating a shot that already exists and importing a new shot, in which case the projectItem wouldn't be in use, as it would not exist.

                     

                    So my question - how are these relevant for Premiere, how can I get this information from Premiere without depending on an existing item, as there may not be an existing projectItem to use?

                     

                    The only solution I've come up with is to figure it out from the frameRate and generate my own strings which is a very obtuse way of constructing it. Do you have a better solution?

                     

                    Thanks.

                    • 7. Re: Setting XMP data having inconsistent results
                      Bruce Bullis Adobe Employee

                      So my question - how are these relevant for Premiere, how can I get this information from Premiere without depending on an existing item, as there may not be an existing projectItem to use?

                      If there is no associated projectItem, then to what would those startTimeScale and startTimeSampleSize refer? PPro projects contain items, which have time values. The project itself doesn't have any sense of time.

                      • 8. Re: Setting XMP data having inconsistent results
                        innerspaceouterspace Level 1

                        That's exactly what I'm trying to figure out.

                         

                        And what IS startTimeSampleSize, what does that mean? In everything I've seen thus far, it's just been a value of '1' - but I don't know what this is.

                        • 9. Re: Setting XMP data having inconsistent results
                          Bruce Bullis Adobe Employee

                          While I wait to hear back from some timecode wizards, you could import some representative footage, get their XMP, and see what those values are...

                          • 11. Re: Setting XMP data having inconsistent results
                            innerspaceouterspace Level 1

                            So I've been trying to progress with this and I've been stuck for days.

                             

                             

                             

                            Is there ANY documentation about what is needed for determining a clip's timerate using metadata, and setting altTimeCode and stuff like that? It's very undefined for everything -

                             

                             

                            For instance, I'm setting the framerate and altTimeCode and the Edit > Preferences > Media > Indeterminate Media Timebase is overriding everything I set in here.

                             

                            I set this information:

                                     <xmpDM:videoFrameRate>29.970000</xmpDM:videoFrameRate>

                                     <xmpDM:startTimeScale>29.970000</xmpDM:startTimeScale>

                                     <xmpDM:startTimeSampleSize>1</xmpDM:startTimeSampleSize>

                                     <xmpDM:startTimecode rdf:parseType="Resource">

                                        <xmpDM:timeValue>00:00:00:00</xmpDM:timeValue>

                                        <xmpDM:timeFormat>2997NonDropTimecode</xmpDM:timeFormat>

                                     </xmpDM:startTimecode>

                                     <xmpDM:altTimecode rdf:parseType="Resource">

                                        <xmpDM:timeValue>00:00:03:12</xmpDM:timeValue>

                                        <xmpDM:timeFormat>2997NonDropTimecode</xmpDM:timeFormat>

                                     </xmpDM:altTimecode>

                             

                            And Premiere will COMPLETELY ignore it if Indeterminate Media Timebase is set to 23.97 - this is hampering our clip updating, and there's no source of information that I can use as a frame of reference.

                            • 12. Re: Setting XMP data having inconsistent results
                              Bruce Bullis Adobe Employee

                              Is there ANY documentation

                              No; we are still pursuing answers internally.

                              • 13. Re: Setting XMP data having inconsistent results
                                innerspaceouterspace Level 1

                                I don't believe it's possible to set the framerate on a clip using XMP or Project Metadata and have Premiere notice the change. I'm successfully able to edit the startTimecode, altTimecode, and other values, however whether I set the value in XMP or Project Metadata, there is no change in framerate.

                                 

                                It appears that Indeterminate Media Timebase will override all attempts at setting the framerate, even though the correct and desired information is in both the XMP output and the Project metadata output after importing.

                                 

                                I test this by setting Indeterminate Media Timebase to 59.97 fps and import a clip with no metadata on it.

                                Once this process is done, I wait for the event loop to finish importing and then attempt to set the framerate to 23.976 through both XMP and Project Metadata. It does not change. However, any of the other values will change.