Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › get MP3 metadata using XMP

  • Dan Ebberts

    November 7, 2014 at 4:09 am

    This should get you started. It assumes that the mp3 has been imported into the project and is item 1 in the stack. I’m not sure about the namespaces (especially the first one), but it should give you the idea:

    if( ! ExternalObject.AdobeXMPScript ) ExternalObject.AdobeXMPScript = new ExternalObject(“lib:AdobeXMPScript”);
    var myFootageFile = app.project.item(1).file;
    myFootageFile.open(“r”);
    var fileData = new XMPFile(myFootageFile.fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_ONLY_XMP);
    var xmp = fileData.getXMP();
    var title = xmp.getProperty(XMPConst.NS_PDF, “Title”, XMPConst.STRING);
    alert (title);
    var artist = xmp.getProperty(XMPConst.NS_DM, “artist”, XMPConst.STRING);
    alert (artist);
    var album = xmp.getProperty(XMPConst.NS_DM, “album”, XMPConst.STRING);
    alert (album);

    fileData.closeFile(0);
    myFootageFile.close();

    Dan

  • Adam Houghton

    November 7, 2014 at 5:05 pm

    Thanks Dan! Your site and posts have been my go to resource for learning AE scripting. So cool to have you answer my question!

  • Joseph Gomes

    May 5, 2021 at 3:05 am

    i know this thread is years old but its the closest ive come to this issue. i see that this seems to be the solution but i must be too new to AE because i dont know what to make of this. would you be willing to give a more step-by-step process on how to implement this?

    for clarity, im looking to do something similar with audio file metadata. id like a text layer to change based on the title and artist metadata of a WAV file, as well as the album art if possible. that way, i dont have to manually change the text in the text layers, nor do i have to change the album art file. if its relevant, i use the “Replace Footage” function for the audio file, rather than importing a new file every time.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy