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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#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? |
|
|
|
|
|
|
#2 | Link |
|
Retried Guesser
Join Date: Jun 2012
Posts: 1,371
|
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);
}
|
|
|
|
|
|
#3 | Link |
|
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,869
|
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. |
|
|
|
|
|
#5 | Link |
|
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,869
|
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 | |
|
|