Skip to main content
Inspiring
March 9, 2015
Question

What's wrong with the duration?

  • March 9, 2015
  • 2 replies
  • 856 views

Why do we get different duration values?

Value of 0.2 is taken from the sequence of 6 frames (0-5) at 30 fps. And 6 is a correct value.

MyNewProxy = app.project.importPlaceholder("test", 1920, 1080, 30, 0.2);
alert
(timeToCurrentFormat(MyNewProxy.duration,30));

ptOkMib.jpg

This topic has been closed for replies.

2 replies

Legend
March 11, 2015

My guess is that this is having to do with the whole Javascript floating point time to frame conversion math happening behind the scenes. Similar to what is happening with time, displayStartTime, inPoint, outPoint, etc....

A few threads have touched on the subject already...

CompItem.displayStartTime precision problem

Composition duration and precision problem

timeToCurrentFormat bug?

If your issue happens to also be related to the same thing, then I think Adobe needs to help us all figure out a solid solution for this. It's been a headache for a lot of developers.

UQg
Legend
March 9, 2015

try setting the last argument ('isDuration') to true: alert(timeToCurrentFormat(MyNewProxy.duration,30, true));

It might solve it.


Xavier.

r2-no-d2Author
Inspiring
March 9, 2015

the problem is not alert! it shows the correct value.