I'm looking for a function that converts an integer value in frames to NTSC Drop Frame Timecode (hh:mm:ss.ff).
I'm using Delphi, but could be in any language.
Thanks
I'm looking for a function that converts an integer value in frames to NTSC Drop Frame Timecode (hh:mm:ss.ff).
I'm using Delphi, but could be in any language.
Thanks
function FramesToNTSCDropFrameCode(Frames:Integer;FramesPerSecond:Double):string;
var
iTH, iTM, iTS, iTF : word;
MinCount, MFrameCount : word;
begin
DivMod( Frames, Trunc(SecsPerMin * FramesPerSecond), MinCount, MFrameCount );
DivMod( MinCount, MinsPerHour, iTH, iTM );
DivMod( MFrameCount, Trunc(FramesPerSecond), ITS, ITF );
Result := Format('%.2d:%.2d:%.2d.%.2d',[iTH,iTM,iTS,iTF]);
end;
You will need to copy the DivMod routine from the SysUtils unit, and also include the sysUtils unit in whatever implements this function.