ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to display remaining time in timecode

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jon Mendo
Expression to display remaining time in timecode
on Mar 11, 2020 at 5:51:08 am

Hey Smart People!
I would LOVE some help with this and I can't seem to find it anywhere. I would like to display the remaining comp time in timecode as the source text.

I have several comps that I am rendering out to run through a media server and I would like to give my Resoulme Operator a way to see on the content how much time is remaining for each clip. Any help would be greatly appreciated.

Thanks!
Mendo


Return to posts index

Andrei Popa
Re: Expression to display remaining time in timecode
on Mar 11, 2020 at 9:03:30 am

This works. You can also remove some values if you would like to not see them.


function rawToTimecode(number) {
var seconds = Math.floor(number);
var minutes = Math.floor(seconds / 60);
var hours = Math.floor(minutes / 60);
var frames = Math.round((number - seconds) / thisComp.frameDuration);
return [hours, minutes, seconds, frames]
.map(
function (n) {
return (n > 10) ? n : "0" + n
}
).join(":");
}
var rawTime = thisComp.duration - time;
rawToTimecode(rawTime)



Andrei
My Envato portfolio.


Return to posts index

Andrei Popa
Re: Expression to display remaining time in timecode
on Mar 11, 2020 at 10:46:00 am

I forgot to subtract the over-60 values in the end. This should be the correct way:
function rawToTimecode(number){
var seconds = Math.floor(number);
var minutes = Math.floor(seconds / 60);
var hours = Math.floor(minutes / 60);
var frames = Math.round((number-seconds)/thisComp.frameDuration);
return [hours,minutes%60,seconds%60,frames]
.map(
function(n){
return(n>10) ? n : "0"+n
}
).join(":");
}
var rawTime = thisComp.duration-time;
rawToTimecode(rawTime)


Andrei
My Envato portfolio.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]