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

ExtendScript: Identifying Images in Premiere

Explorer ,
May 16, 2020 May 16, 2020

Is there a way to check if the project item is an image or a video ?

  • type attribute only seperates video and audio
  • isSequence() seperates sequences from videos.

Is there something similar for seperating images from videos ?

Thanks !

TOPICS
Error or problem , SDK
1.2K
Translate
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

Community Expert , May 18, 2020 May 18, 2020

It's a bit complicated, but you can through project item metadata.

 

function getPrMetadata(projectItem, fieldNames) {
    var kPProPrivateProjectMetadataURI = "http://ns.adobe.com/premierePrivateProjectMetaData/1.0/";
    if (app.isDocumentOpen()) {
        if (projectItem) {
            if (ExternalObject.AdobeXMPScript === undefined)
                ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
            if (ExternalObject.AdobeXMPScript !== undefined) {
        
...
Translate
Adobe Employee ,
May 16, 2020 May 16, 2020

There isn't. 

Translate
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 ,
May 17, 2020 May 17, 2020

Theres no direct method, but you can try to infer it by considering how different media types will be handled by different methods eg calling canProxy() on Video/Movie clips will return true ... but on Stills will return false.

Translate
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
Community Expert ,
May 18, 2020 May 18, 2020
LATEST

It's a bit complicated, but you can through project item metadata.

 

function getPrMetadata(projectItem, fieldNames) {
    var kPProPrivateProjectMetadataURI = "http://ns.adobe.com/premierePrivateProjectMetaData/1.0/";
    if (app.isDocumentOpen()) {
        if (projectItem) {
            if (ExternalObject.AdobeXMPScript === undefined)
                ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
            if (ExternalObject.AdobeXMPScript !== undefined) {
                var retArray = []
                var retArray2 = []
                var projectMetadata = projectItem.getProjectMetadata();
                var xmp = new XMPMeta(projectMetadata);

                for (var pc = 0; pc < fieldNames.length; pc++) {
                    if (xmp.doesPropertyExist(kPProPrivateProjectMetadataURI, fieldNames[pc])) {
                        retArray.push([fieldNames[pc], xmp.getProperty(kPProPrivateProjectMetadataURI, fieldNames[pc])])
                        retArray2.push([xmp.getProperty(kPProPrivateProjectMetadataURI, fieldNames[pc])])
                    }
                }
                return (retArray2);
            }
        }
    }
    return (false);
}

var media = app.project.rootItem.children[0];
getPrMetadata(media, ['Column.Intrinsic.MediaType']);

 Images will return "Still Image" and videos will return "Video", however, be aware that this is language-dependent on the user's app locale.

Translate
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