221

I am using ffmpeg to tell me video info. Specifically:

ffmpeg -i video.ext

I get the output:

Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 704x576 [PAR 12:11 DAR 4:3], 9578 kb/s, 25 tbr, 90k tbn, 50 tbc

Does anyone know what tbr, tbn and tbc are exactly? I have seen speculation on the net but nothing definitive?

3

1 Answer 1

242

Well it's all about time. FFMpeg uses in fact three different timestamps in different bases in order to work.

  • tbn = the time base in AVStream that has come from the container
  • tbc = the time base in AVCodecContext for the codec used for a particular stream
  • tbr = tbr is guessed from the video stream and is the value users want to see when they look for the video frame rate

This was also asked on the FFmpeg mailing lists: What does the output of ffmpeg mean? tbr tbn tbc etc?

12
  • 9
    Thanks for this - the way 'I think' was used in these posts - I wasn't sure whether it was 'fact' or 'opinion'. How does TBR relate to frame per second exactly and under what conditions do they differ and why?
    – user7289
    Jul 7, 2010 at 23:05
  • 8
    Also see this answer and the ffmpeg source
    – djvg
    Sep 25, 2017 at 8:31
  • 24
    "the time base in AVStream that has come from the container" is a meaningless sentence.
    – Chloe
    Sep 29, 2018 at 6:04
  • 41
    @Gyan What is a "time base"? What is an "AVStream"? What is a "container"? Why would a time value come from a container? Isn't time objective? Same with all 3. This answer needs more words. Try rewording it first with the smallest number of basic English words, then second, append a longer version with many more words describing each jargon term in plain language, and how they related to each other, with examples.
    – Chloe
    Sep 29, 2018 at 17:34
  • 23
    Just spent a while figuring this out. Context: video and audio are each encoded using a codec (e.g., H.264), then stored together in a container (e.g., MP4). Both containers & codecs have a concept of time -- how long is the video, when does each frame start? These times are measured in ticks. In the codec, one frame might start at tick 10, and the next at tick 12. In the container, an audio track might be 1000 ticks long. The timebase is the number of ticks in each second. The key here is that the timebase can be different for the container (tbn) and the codec (tbc).
    – ianh
    Feb 27, 2021 at 16:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.