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

Help with script to update shotDate for a video clip

New Here ,
Aug 28, 2007 Aug 28, 2007
As hard as it is for me to believe, Adobe Premiere Pro doesn't take the date code when capturing video clips from a DV camera and put it into the "shotDate" video metadata field. Instead, it (stupidly in my view) sets the shotDate to the date when the video clip is being captured, not when it was shot. I want to write a script to correct this.

So far I've been able to get access to the existing, bad shotDate property, but I can't seem to set it successfully. The relevant portion of my code is as follows. Can anyone point me in the right direction as to why my setting the property isn't working? Thanks in advance!

---

var md = thumb.synchronousMetadata;
md.namespace = "http://ns.adobe.com/xmp/1.0/DynamicMedia/";
var BadShotDate = md.shotDate;
$.writeln("Bad Shot Date: ", BadShotDate);
// Get the XMP packet as a string and create the XMPMeta object
var xmp = new XMPMeta(md.serialize());
var d = new XMPDateTime(new Date()); // Dummy value for testing
xmp.setProperty(XMPConst.NS_XMP, "shotDate", d, XMPConst.XMPDATE);
var updatedPacket = xmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
thumb.metadata = new Metadata(updatedPacket);
TOPICS
Scripting
564
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
New Here ,
Aug 29, 2007 Aug 29, 2007
I figured it out, so I thought I would post a follow-up for anybody else running into the same issue. The following function will set the shot date metadata to whatever string is supplied for the given thumbnail:

function SetShotDate(thumb, newshotdate)
{
if(thumb.hasMetadata)
{
// Get the metadata object - wait for valid values
var md = thumb.synchronousMetadata;
md.namespace = XMPConst.NS_DM;

var xmp = new XMPMeta(md.serialize());
xmp.setProperty(XMPConst.NS_DM, "shotDate", newshotdate);

var updatedPacket = xmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
thumb.metadata = new Metadata(updatedPacket);
}
}
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
New Here ,
Nov 30, 2008 Nov 30, 2008
LATEST
Very nice

Good Luck.
______
My Si tes
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