More readable version. I use it in the video I am currently working on. :fps=60; frames = time % fps; ms = floor(frames * 1000 / fps) seconds = floor(time / fps); minutes = floor(seconds / 60); seconds = seconds % 60; return string.format("%02d:%02d.%03d", minutes, seconds, ms)
I had an issue running this where my minute counter would go up by 1 every 30 seconds. The mistake with your script is with "minutes = floor(seconds / fps);" because minutes aren't the second count divided by the frame rate. They should always be seconds divided by 60, because the length of a minute doesn't change. It just so happens that your version runs fine at 60fps...but my video is at 30fps, hence the problem. Fixed version: :fps=[your frame rate]; frames = time % fps; ms = floor(frames * 1000 / fps) seconds = floor(time / fps); minutes = floor(seconds / 60); seconds = seconds % 60; return string.format("%02d:%02d.%03d", minutes, seconds, ms) Side note to everyone: certain frame rates may make certain fractions of seconds look weird. I initially set out to use centi-seconds, but at 30fps the timer just hits 03/06/10/13/16/20 etc...milli-seconds would just be the same with another 0. I decided to do deci-seconds, which flip exactly every three frames, which is nice. Just chance 1000 to 100 or 10 as needed (you can also change "ms" to "cs" or "ds" if you're a weird perfectionist like me).
This tutorial was really helpful, to create a timer for a Rc Car Race Video. Switching the timer to a compound clip allowed me to cut it and insert a Replay in Slow Motion. Thank You!
Excellent tutorial. I further found out that to make it universal / framerate independent, use comp:GetPrefs("Comp.FrameFormat.Rate") instead of a number 24, 30, 60 etc.
Thanks a lot! I'm currently doing a 24 hour challenge video and am trying to figure out how to get the simple count up timer to go past 9 hours and 16min. It seems to not go past this time mark. Do you know a way around this?
Haven't tried with something that long but can't see why it would fail. Maybe a number is overflowing, i will investigate over the weekend and will report back :)
I have tried your method but gives me either 0.033 increaments every frame so it's not actually an ms counter but still a frame counter*fps (which in my case is 30)
Hm, i don't get miliseconds to work properly with 50 fps video. Last digit is always 0 and next one to the last one is an even number (2,4,6,8). Any advice?
More readable version. I use it in the video I am currently working on.
:fps=60;
frames = time % fps;
ms = floor(frames * 1000 / fps)
seconds = floor(time / fps);
minutes = floor(seconds / 60);
seconds = seconds % 60;
return string.format("%02d:%02d.%03d", minutes, seconds, ms)
I had an issue running this where my minute counter would go up by 1 every 30 seconds.
The mistake with your script is with "minutes = floor(seconds / fps);" because minutes aren't the second count divided by the frame rate. They should always be seconds divided by 60, because the length of a minute doesn't change. It just so happens that your version runs fine at 60fps...but my video is at 30fps, hence the problem.
Fixed version:
:fps=[your frame rate];
frames = time % fps;
ms = floor(frames * 1000 / fps)
seconds = floor(time / fps);
minutes = floor(seconds / 60);
seconds = seconds % 60;
return string.format("%02d:%02d.%03d", minutes, seconds, ms)
Side note to everyone: certain frame rates may make certain fractions of seconds look weird. I initially set out to use centi-seconds, but at 30fps the timer just hits 03/06/10/13/16/20 etc...milli-seconds would just be the same with another 0. I decided to do deci-seconds, which flip exactly every three frames, which is nice. Just chance 1000 to 100 or 10 as needed (you can also change "ms" to "cs" or "ds" if you're a weird perfectionist like me).
@@kgaumont
Oh, I just noticed 😅 sorry about that
I've edited my script
For curious, it used to be: minutes = floor(seconds / fps);
thank you!
This tutorial was really helpful, to create a timer for a Rc Car Race Video. Switching the timer to a compound clip allowed me to cut it and insert a Replay in Slow Motion. Thank You!
Finally a correct timer, you would think this would be one of the most basic features of a video editor. Anyways, you're the man, thank you.
Awesome! I was editing footage and realized the timer was based in FPS. There are so many tutorials that have inaccurate timers.
Thank you so much man, I spent hours trying to make the damn timecode work you saved my day
Excellent tutorial. I further found out that to make it universal / framerate independent, use comp:GetPrefs("Comp.FrameFormat.Rate") instead of a number 24, 30, 60 etc.
Can you explain a little more or just write out the whole expression
@@gsxrunit string.format( "%02d:%02d.%03d",
math.floor(time/(comp:GetPrefs("Comp.FrameFormat.Rate")*60)),
math.floor(time/comp:GetPrefs("Comp.FrameFormat.Rate")%60),
math.floor(time%comp:GetPrefs("Comp.FrameFormat.Rate")*(1000/comp:GetPrefs("Comp.FrameFormat.Rate")))
)
@@MonoMoto worked. amazing!
Thank you so much! My onboards in kart will never be the same again! haha
awesome tutorial, well explained, thank you so much
OMG! Worked! thank you, thank you, thank you!!!
what font did you use, this looks awesome
Excellent! Just saw the other tutorials as well and while trying noticed whotf needs frames???
thank you, it works perfectly
I commend you for being the only one to make it just wish you made it for or popular fps like 30fps in my case lol
Awesome! thank you man!
Thanks a lot! I'm currently doing a 24 hour challenge video and am trying to figure out how to get the simple count up timer to go past 9 hours and 16min. It seems to not go past this time mark. Do you know a way around this?
Haven't tried with something that long but can't see why it would fail. Maybe a number is overflowing, i will investigate over the weekend and will report back :)
thanks!
omg, thats awesome
I have tried your method but gives me either 0.033 increaments every frame so it's not actually an ms counter but still a frame counter*fps (which in my case is 30)
Hm, i don't get miliseconds to work properly with 50 fps video. Last digit is always 0 and next one to the last one is an even number (2,4,6,8). Any advice?
it says media offline at random spots in my clip any way to fix this?
part 2:
how to do that table with the laps and times. PLEASE
thanks!
Did not expect to see u here!
Obby god
ALSO U USE DAVINCI NANI