5 Replies Latest reply on Oct 12, 2011 2:57 PM by philmodjunk

# Frames to Timecode Calculation

### Title

Frames to Timecode Calculation

### Post

I am trying to figure out how to write a calculation which will take the number of frames in a shot from a film project and convert that to a variation of timecode (mm:ss:ff).

I have a field called "Frame Rate" (Num; Global) in which I can put the fps for the current project (we work in everything from 23.976, 24, 25 and 29.97).  We generally work in non-drop frame so I'm not terribly worried about having a variable for drop frame and non-drop frame.  I have another field called "Frames" (Num) which stores the number of frames for that shot/record.

So, if in a 23.976 fps project, I have a shot that is 116 frames long, how can I write a calculation that will return that this shot is four seconds and 20 frames long (00:04:20)?

Other timecode calculations I've come across are about calucuations of adding or subtracting one timecode from another.  This is about converting the number of frames to a timecode type format.

• ###### 1. Re: Frames to Timecode Calculation

Getastime ( Div ( Frames ; FPS ) ) & ":" & Round ( Mod ( Frames ; FPS) ; 0 )

Use Text as your return type.

• ###### 2. Re: Frames to Timecode Calculation

Ok.  I was making it waaaay more complicated than it needed to be.  We're very close here with your calculation except that if it's less than 10 frames I get 00:03:2 instead of 00:03:02.

Thanks!

• ###### 3. Re: Frames to Timecode Calculation

Getastime ( Div ( Frames ; FPS ) ) & ":" & Left ( Round ( Mod ( Frames ; FPS) ; 0 ) & "00" ; 2 )

• ###### 4. Re: Frames to Timecode Calculation

Again, quite close.  It's returning :20 instead of :02.  I tried Right function just on the off chance....

• ###### 5. Re: Frames to Timecode Calculation

oops.

Getastime ( Div ( Frames ; FPS ) ) & ":" & Right ( "00" & Round (Mod ( Frames ; FPS) ; 0 ) ; 2 )