Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
24th September 2015, 11:33 | #1 | Link | |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
ShowSMPTE() drop-frame algorithms
I'm looking for the algorithms used to implement ShowSMPTE's drop-frame counting. It's help file covers NTSC TV, but none of the others:
Quote:
Any ideas how those were implemented? |
|
24th September 2015, 14:43 | #2 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Sure, it's in the source code:
http://avisynth2.cvs.sourceforge.net...ew=markup#l815 Code:
if (dropframe) { if (rate == 30) { int c = 0; c = off_min + 60*off_hour; // number of drop events c -= c/10; // less non-drop events on 10 minutes c *=2; // drop 2 frames per drop event offset_f -= c; } else { // Need to cogitate with the guys about this // gotta drop 86.3 counts per hour. So until // a proper formula is found, just wing it! offset_f -= 2 * ((offset_f+1001)/2002); } |
24th September 2015, 15:31 | #3 | Link |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,843
|
I have used this (in my own bash scripting)
From frames to DF timecode: fps=30 D=$(( frames/17982 )) M=$(( frames%17982 )) frames=$(( frames+ 18*D + 2*((M - 2)/1798) )) # Count frames, seconds, minutes and hours frame=$(( frames%fps )) second=$(( frames/fps%60 )) minute=$(( frames/fps/60%60 )) hour=$(( frames/fps/60/60%24 )) It's based on the code provided by some SMPTE guy and works fine even up to 24H TC. |
25th September 2015, 12:56 | #5 | Link |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,843
|
It works well, even if it looks strange
I did figure it out, but don't remember anymore. Also note that DF timecode only exists for 29.97p, 59.94i, 59.94p. There is no such a thing in the industry for eg. 23.976p. |
Thread Tools | Search this Thread |
Display Modes | |
|
|