eoyilmaz / timecode

Python Module for SMPTE Time Code Manipulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect frame_number for 29.97 NDF

marcrleonard opened this issue · comments

import timecode
tt = timecode.Timecode('29.97')
tt.drop_frame=False
tt.set_timecode("00:10:00:00")
print(tt.frame_number)

>>> 18000

... Should this not be 17,982?

10 x 60 x 29.97 = 17,982

UPDATE:
In my example, it appears that this library is using the dropframe flag to trigger how the frames are being calculated. This is not correct. Dropframe is really just a 'mask' on top of how the timecodes are determined. This does make 'reversing out' frames<->timecodes tricky, but something here isn't quite right. The fact that I set the class as non-drop, THEN added the timecode should yield the proper frame count.

I see why you're falling in to those wrong assumptions. First of all in a 29.97 NDF timeline how many frames do you see in a clip with 00:00:01:00 duration that is 1 seconds. It is 30, not 29.97.

Anyway, lately I started using DaVinci Resolve as the calculator for these kind of questions. And Resolve gives me exactly 18000 frames for a 00:10:00:00 clip in a 29.97 NDF timeline. So the library is calculating it correctly.

Yes! I had a big 'duh' moment the next day. You are correct. Sorry to waste your time - I totally forgot to close this ticket. Thank you!