Get Frame Rate of project Item with Extendscript CEP Panel

Explorer ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Hi,

I'm trying to access the "frame_rate" or "time_display" from a clips metadata via Extendscript.  I can see the fields (highlighted below) when I alert projItem.getProjectMetadata but when I try to access those fields independantly (following the example from the sample panel) it doesn't return anything.  See code below.  I know you need "Column.Intrinsic.VideoInPoint" in the URI for the Clip In Point, does anyone know what you need for the highlighted fields?

 

{89ACC161-3D2C-48B1-BCD9-738D8A36C5FB}.png

 

 

function getMetaData (clip){
	//alert("Test")
   if (ExternalObject.AdobeXMPScript == undefined){
	   ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript")
   }
   if (clip.type == ProjectItemType.CLIP){
	   var kPProPrivateProjectMetadataURI	= "http://ns.adobe.com/premierePrivateProjectMetaData/1.0/";
	   var videoInPoint = "Column.Intrinsic.VideoInPoint";
	   var videoOutPoint= "Column.Intrinsic.VideoOutPoint";
	   var frameRate = "Column.Intrinsic.MediaTimebase";
	   var fieldType = "Column.PropertyText.FieldOrder";
	   var mediaIn = "Column.Intrinsic.MediaStart";
	   var mediaOut = "Column.Intrinsic.MediaEnd";
	   var ticks = "frame_rate";
	   
	   var projectMetaData		= clip.getProjectMetadata();
	   var newXMP		= new XMPMeta(projectMetaData);
	   var inPoint	= newXMP.getProperty(kPProPrivateProjectMetadataURI, videoInPoint);
	   var outPoint	= newXMP.getProperty(kPProPrivateProjectMetadataURI, videoOutPoint);
	   var frameRate = newXMP.getProperty(kPProPrivateProjectMetadataURI, frameRate);
	   var fieldOrder = newXMP.getProperty(kPProPrivateProjectMetadataURI, fieldType);
	   var mediaStart = newXMP.getProperty(kPProPrivateProjectMetadataURI, mediaIn);
	   var mediaEnd = newXMP.getProperty(kPProPrivateProjectMetadataURI, mediaOut);
	   var frameRateTicks = newXMP.getProperty(kPProPrivateProjectMetadataURI, ticks);
	   metaData = [inPoint, outPoint, frameRate, fieldOrder, mediaStart, mediaEnd, frameRateTicks]
	   return metaData
}else{

   alert ("No Clip")
}
}

 

TOPICS
SDK

Views

257

Likes

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

Adobe Employee , Jun 07, 2021 Jun 07, 2021
You'll note that frame_rate occurs ~10 times in the private metadata for any given projectItem; frame_rate is a member of the in/out points, as well as SoundTimeCode.  var kPProPrivateProjectMetadataURI = "http://ns.adobe.com/premierePrivateProjectMetaData/1.0/"; if (ExternalObject.AdobeXMPScript === undefined) { ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript'); } var first = app.project.rootItem.children[0]; if (first) { var projectMetadata = first.getProje...

Likes

Translate

Translate
Adobe Employee ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Framerate is available as part of a projectItem's footage interpretation. 

 

https://ppro-scripting.docsforadobe.dev/item/projectitem.html?highlight=framerate#projectitem-getfoo...

I think time_display is driven off of sequence settings, not data intrinsic to a projectItem.

 

 

Likes

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 ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

Yes I know however the metadata field called frame_rate has a different value than the frame Rate from getFootageInterpretation.  You can see in the picture i posted.  I believe its in ticks per second.  Any idea how I would access those fields?

 

Likes

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
Adobe Employee ,
Jun 07, 2021 Jun 07, 2021

Copy link to clipboard

Copied

LATEST

You'll note that frame_rate occurs ~10 times in the private metadata for any given projectItem; frame_rate is a member of the in/out points, as well as SoundTimeCode. 

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

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

var first = app.project.rootItem.children[0];  

if (first) {
   var projectMetadata = first.getProjectMetadata();
   if (projectMetadata) {
       var projectMetadataAsXMP = new XMPMeta(projectMetadata);
       if (projectMetadataAsXMP) {
           var exampleFieldName = "Column.Intrinsic.AudioInPoint";
           var inPointInfo = projectMetadataAsXMP.getProperty(kPProPrivateProjectMetadataURI, exampleFieldName);
           if (inPointInfo) {
               var inPointVal   = inPointInfo.value;  	
           }
       }
   }
}




For premierePrivateProjectMetaData:time_display values, it'll be one of the following (taken from the PProPanel sample). 

var TIMEDISPLAY_24Timecode = 100;
var TIMEDISPLAY_25Timecode = 101;
var TIMEDISPLAY_2997DropTimecode = 102;
var TIMEDISPLAY_2997NonDropTimecode = 103;
var TIMEDISPLAY_30Timecode = 104;
var TIMEDISPLAY_50Timecode = 105;
var TIMEDISPLAY_5994DropTimecode = 106;
var TIMEDISPLAY_5994NonDropTimecode = 107;
var TIMEDISPLAY_60Timecode = 108;
var TIMEDISPLAY_Frames = 109;
var TIMEDISPLAY_23976Timecode = 110;
var TIMEDISPLAY_16mmFeetFrames = 111;
var TIMEDISPLAY_35mmFeetFrames = 112;
var TIMEDISPLAY_48Timecode = 113;
var TIMEDISPLAY_AudioSamplesTimecode = 200;
var TIMEDISPLAY_AudioMsTimecode = 201;

Likes

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