Skip to main content
Known Participant
June 6, 2024
Answered

Keyframe time off by an hour (ExtendScript)

  • June 6, 2024
  • 2 replies
  • 876 views

Weird issue I've come across.  Here's what's happening:

 

  1. I create a brand new project
  2. I add a Black Video (right-click on project, New Item, Black Video - leave all defaults)
  3. I add a keyframe to the Opacity property on the Black Video right at the beginning (timestamp 00:00:00:00).

 

Then I run the following test script:

 

var c = app.project.activeSequence.videoTracks[0].clips[0];
var oc = c.components[0];   //AE.ADBE Opacity
var op = oc.properties[0];  //Opacity
var keys = op.getKeys();
var k = keys[0];
var s = k.seconds;          //s = 3599.9964

 

So the timestamp for the keyframe, which should be 0, is off by an hour.  I'm guessing the fact that it's actually 3599.9964 seconds instead of a round 3600 is because my project is at 59.94 fps.

 

Any idea what's happening here?  I'm trying to add keys to this clip via script, and none of them were appearing so I started to test.  I could obviously adjust my script to account for it, but without knowing why it's happening that feels sort of hacky and I'm unsure if I can trust the difference to always be an hour.

 

Thoughts?

This topic has been closed for replies.
Correct answer Bruce Bullis

I can repro the behavior.
I'm pretty sure what you're seeing is because project items created for 'black video' actually have no timebase. 
If I replace 'black video' with 'Universal Counting Leader', I get a correct (0.0 seconds) start time. 


Setting expectations: No further changes to PPro's ExtendScript API are planned our scheduled; the team is focused on exposing UXP-based extensibility. 



2 replies

Known Participant
June 6, 2024

Whenever I see an hour difference in a programming context, I immediately suspect system clock + timezone issues.  Not sure how that could have any effect here, though.

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
June 6, 2024

I can repro the behavior.
I'm pretty sure what you're seeing is because project items created for 'black video' actually have no timebase. 
If I replace 'black video' with 'Universal Counting Leader', I get a correct (0.0 seconds) start time. 


Setting expectations: No further changes to PPro's ExtendScript API are planned our scheduled; the team is focused on exposing UXP-based extensibility. 



Known Participant
June 6, 2024

So the hour difference for black video should at least be consistent, right?

Bruce Bullis
Community Manager
Community Manager
June 6, 2024

Interesting! You're the first to report such an issue. 

Thoughts?

Can you provide a project that displays the behavior described [above], when your snippet is run? [offline media is fine]

Known Participant
June 6, 2024

Just sent.  It's just a new project with a black video and a sequence.