Talk:ShowFrameNumber
From Avisynth wiki
ShowSMPTE: integral or drop-frame framerates only
On reading text-overlay.cpp ShowSMPTE::ShowSMPTE
, it looks like the framerate must be an integer (±0.001) or be in drop-frame range (eg, 23.975 - 23.977); framerates like 24.25 will be rounded to int(24.25+0.5)==24.0
and the time calculation will be off. This can't be right!
## (source 24fps) ShowTime(y=50) ## top center ShowSMPTE ## time is correct
AssumeFPS(24000, 1001) ShowTime(y=50) ShowSMPTE ## time is correct
AssumeFPS(24.25) ## any number not an integer ±0.001 or listed in drop-frame table ShowTime(y=50) ShowSMPTE ## time is wrong
Raffriff42 04:08, 29 December 2015 (CET)
- Inserted a warning re: non-integral frame rates with ShowSMPTE -- Raffriff42 06:28, 1 January 2016 (CET)
- If I understand it correctly, the timecodes will always be off for non-integral frame rates. That is, unless you treat them all as drop frames, and count how much frames should be dropped every minute (note: this will not be the SMPTE standard anymore). Perhaps better would have been to throw an error for non-integral framerates and not being one of those standard drop-frame ranges. Admin 17:52, 3 January 2016 (CET)
- Edit2: Did you actually run that script (with source fps = 24.25)? AviSynth throws an error in my case. Relevant code:
- rate = int(_rate + 0.5);
- ...
- else if (abs(_rate - rate) > 0.001) {
- env->ThrowError("ShowSMPTE: rate argument must be 23.976, 29.97 or an integer");
- hi Admin; I ran the test with AssumeFPS as above, not fps=; I knew fps= enforces correct input as you say -- Raffriff42 19:06, 3 January 2016 (CET)
- Post your exact script please. If i use the script:
- clip = BlankClip()
- clip = clip.AssumeFPS(24.25)
- ShowSMPTE(clip, x=320, y=240, font="georgia", size=24, text_color=$ff0000)
- I get the error. Admin 19:29, 3 January 2016 (CET)
ShowSMPTE: fps argument
I don't quite get the fps argument; is it to force a different framerate for timecode display purposes? For example, to show 24fps film frames on a 30fps video clip?
Raffriff42 04:17, 29 December 2015 (CET)
- On testing, it seems the frame rate is overridden, throwing off the real time reading. Would not be useful in the above scenario.
- Inserted an "unclear" tag, like this: roses are blue(unclear) -- Raffriff42 06:28, 1 January 2016 (CET)
- Good question. I will ask Ian. Admin 18:20, 3 January 2016 (CET)