Re: Create a timecode with expressions
Posted: March 14th, 2019, 8:02 am
Hi,
I added a simple timecode to my video and now I'd like to make the numbers speed up as if there was a fast forward, and stop them, then rewind and so on as if it were a tape
this is the expression so far
function pad(str, max) {
str = str.toString();
return str.length < max ? pad("0" + str, max) : str;
}
function digits(myVal, myNumDigits, myPad) {
var s = myVal.toString();
while (s.length < myNumDigits) s = '0' + s;
return pad(Math.floor(s), myPad);
}
hr = digits(time / 3600, 2, 2);
min = digits(time % 3600 / 60, 2, 2);
sec = digits(time % 60, 2, 2);
hr + ":" + min + ":" + sec;
which works just fine, but I wish I could use keyframes to make them go faster.
or any tool, which I propably don't know yet
I am sorry if that seems like a dumb question, but I am not so well versed in code yet.
Glad if you could help me out if my idea is even possible....
thank you so much
cheers!
I added a simple timecode to my video and now I'd like to make the numbers speed up as if there was a fast forward, and stop them, then rewind and so on as if it were a tape
this is the expression so far
function pad(str, max) {
str = str.toString();
return str.length < max ? pad("0" + str, max) : str;
}
function digits(myVal, myNumDigits, myPad) {
var s = myVal.toString();
while (s.length < myNumDigits) s = '0' + s;
return pad(Math.floor(s), myPad);
}
hr = digits(time / 3600, 2, 2);
min = digits(time % 3600 / 60, 2, 2);
sec = digits(time % 60, 2, 2);
hr + ":" + min + ":" + sec;
which works just fine, but I wish I could use keyframes to make them go faster.
or any tool, which I propably don't know yet
I am sorry if that seems like a dumb question, but I am not so well versed in code yet.
Glad if you could help me out if my idea is even possible....
thank you so much
cheers!