Latest post Tue, Jul 22 2014 4:11 PM by aramsey. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • Mon, Jul 21 2014 7:05 PM

    • aramsey
    • Not Ranked
    • Joined on Wed, Jul 2 2014
    • Posts 7
    • Points 75

    AMA Plug-in shows current date/time as video creation date

    Hi all,

    I'm working on a plug-in for Avid NewsCutter 10.5.2 and I've run into an issue. Whenever I link to an AMA clip, the program reports the current date and time as the video's creation date. I.e., if the video was created on January 7th, 2014 and I added it to my current Bin right now, it would report today's date and time instead. Does anyone know what could be causing this, or where the creation date/time is modified in the source code? Not sure what component contains this data. Any help would be great.

    Thanks,

    Alex

  • Mon, Jul 21 2014 7:59 PM In reply to

    • akharkev
    • Not Ranked
    • Joined on Wed, Apr 28 2010
    • Posts 19
    • Points 205
    • ! Avid Employee

    Re: AMA Plug-in shows current date/time as video creation date

    Clip creation date is stored in the CreationTime property of clip's Master Mob. To display specific creation date in a bin AMA plug-in needs to set Master Mob CreationTime to desired value in AAF metadata that the plug-in returns to AMA  host via IMediaContainer::GetAAFMasterClips() .

    Alexey

     

  • Mon, Jul 21 2014 8:45 PM In reply to

    • aramsey
    • Not Ranked
    • Joined on Wed, Jul 2 2014
    • Posts 7
    • Points 75

    Re: AMA Plug-in shows current date/time as video creation date

    Right, thanks. So I see that that value is stored as an aafTime_stamp_constref - is there a way to easily convert between this struct and a FileTime or a Local Time value generated from Windows?

  • Mon, Jul 21 2014 9:07 PM In reply to

    • akharkev
    • Not Ranked
    • Joined on Wed, Apr 28 2010
    • Posts 19
    • Points 205
    • ! Avid Employee

    Re: AMA Plug-in shows current date/time as video creation date

    There's AMA::ConvertTime(const time_t, aafTimeStamp_t*) in amasdk/include/MetadataUtils.hpp.

    Alexey

  • Mon, Jul 21 2014 9:37 PM In reply to

    • aramsey
    • Not Ranked
    • Joined on Wed, Jul 2 2014
    • Posts 7
    • Points 75

    Re: AMA Plug-in shows current date/time as video creation date

    Awesome, thanks so much. I see that the const time_t is a typedef long, do you know what value this is expecting? I'm assuming either number of seconds since 1970 or 100 nano-seconds since 1601?

  • Tue, Jul 22 2014 1:22 PM In reply to

    • akharkev
    • Not Ranked
    • Joined on Wed, Apr 28 2010
    • Posts 19
    • Points 205
    • ! Avid Employee

    Re: AMA Plug-in shows current date/time as video creation date

    time_t is the number of seconds since 01/01/1970.

    I just discovered that AMA::ConvertTime() for reasons yet unknown to me converts only date but not time. While we're looking at why and what we can do you can use something like this for conversion:

    aafTimeStamp_t aafTime;
    time_t osTime;
    struct tm* temp = gmtime(&osTime);
    memset(&aafTime, 0, sizeof(aafTimeStamp_t));
    aafTime.date.month = temp->tm_mon+1;
    aafTime.date.day = temp->tm_mday;
    aafTime.date.year = temp->tm_year + 1900;
    aafTime.time.hour = temp->tm_hour;
    aafTime.time.minute = temp->tm_min;
    aafTime.time.second = temp->tm_sec;

    Alexey

     

  • Tue, Jul 22 2014 4:11 PM In reply to

    • aramsey
    • Not Ranked
    • Joined on Wed, Jul 2 2014
    • Posts 7
    • Points 75

    Re: AMA Plug-in shows current date/time as video creation date

    Won't this return the current time, not the file's creation time?

    I ended up circumventing this by retrieving the file time and converting it to system time, and then creating an aafTimeStamp_t variable and assigning the values from system time to this aafTimeStamp_t. It's now working correctly.

Page 1 of 1 (7 items)

© Copyright 2011 Avid Technology, Inc.  Terms of Use |  Privacy Policy |  Site Map |  Find a Reseller