Is there a method to convert timecode(hh:mm:ss:ff) to seconds ?
I'm trying to create a marker using markers.CreateMarker() method but for some reasons the supplied value in seconds doesn't match input timecodes.
For e.g. I have a timecode 00:03:00:00 on a 29.97fps(Non-drop frame). In order to convert it into seconds,
var a = time.split(':');
var seconds = ((Number(a[0])* 3600) + (Number(a[1]) * 60) + Number(a[2]));
var milliseconds = (Number(a[3])/ fps); // fps is 29.97
var result = seconds + parseFloat(milliseconds,5);
Result here is 180 seconds. Premiere shows this timecode as :
Non-Drop frame
In: 00:02:59:24 , which is 5 frames behind.
Drop frames gives me slightly better results
In: 00:02:59:28, which is 2 frames behind.
Please suggest.