This chapter was purposely left out of the GG manual because anyone who wants to write a plugin can look at the other
ones and see how they work as they will have to understand it anyway. Plus we did not want to have to review that
chapter to make sure it was all still correct.
I also found another framerate table, but it probably only affect ffmpeg plugins:
static AVRational best_frame_rate(double frame_rate) { static const int m1 = 1001*12, m2 = 1000*12; static const int freqs[] = { 40*m1, 48*m1, 50*m1, 60*m1, 80*m1,120*m1, 240*m1, 24*m2, 30*m2, 60*m2, 12*m2, 15*m2, 48*m2, 0, }; double max_err = 1.; int freq, best_freq = 0;
for( int i=0; (freq = i<30*12 ? (i+1)*1001 : freqs[i-30*12]); ++i ) { double framerate = (double)freq / m1; double err = fabs(frame_rate/framerate - 1.);
if( err >= max_err ) continue; max_err = err; best_freq = freq; } return max_err < 0.0001 ? (AVRational) { best_freq, m1 } : (AVRational) { 0, 0 }; }
in cinelerra/pluginfclient.C
guess we need to add 90*m2 there too?