Question

So the AVCodecContext structure has a nice little member named time_base which is used to represent frames per second when encoding video, which is what I'm doing. time_base is an AVRational structure which consists of a numerator (num) and a denominator (den). I'm not good at math and so the only rational number I can think of for 29.9 is 29 and 9/10, which doesn't work. What should I fill num and den with?

p.s the answer is not 299/10

Was it helpful?

Solution

If you mean the color NTSC framerate, it is actually 60/1.001/2 (~29.97002997002997). The convention "29.97 frames per second" is often seen, but it is only an estimation. So, as you already noted, a time_base (i.e., the reciprocal of the framerate) of {1001,30000} is correct for NTSC.

More information (including justification for the strange rate): https://en.wikipedia.org/wiki/NTSC#Lines_and_refresh_rate

OTHER TIPS

Well, hmmm. That's a tricky one. According to this patch it's 1001,30000 for NTSC/30p

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top