Question

I used ffmpeg to get video info. The output is

  Duration: 00:05:57.00, start: 0.000000, bitrate: 611 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 808x610, 609 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc

The time base is used to somehow(this is also my another question) calculate when to decode and show the frame, right? So whose time base is used, container (12800) or codec (50)?

The another question is why tbn=12800 and not 90000?

Was it helpful?

Solution

Both are correct, both are different

The tbn is a function of the encoder creating the stream. So for a 10 fps stream, it can be 90000, which implies 90000 ticks a second, giving you 9000 ticks per frame. It can also simply be 10, which implies 1 tick per frame (for the same 10 fps stream). 90000 is commonly used at streaming level (ts streaming comes to mind) but encoders are not bound by this. This (tbn) is something decoders will use, not the application systems which use container data.

If you have a container, you should use the container time base and time stamps because it is normalized across all streams in the container. You will use parameters like tbn only inside a codec decoder.

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