Meaning of ffmpeg output (tbc, tbn, tbr)

96,269

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?

Share:
96,269

Related videos on Youtube

user7289
Author by

user7289

Updated on July 08, 2022

Comments

  • user7289
    user7289 11 months

    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?

    • v010dya
      v010dya over 8 years
      This should be transferred to video.se if possible
  • user7289
    user7289 almost 13 years
    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?
  • gcb
    gcb about 7 years
    tbr is the framerate that the demuxer should use. in newer versions, ffmepg/avlib will even call it outright fps. here is a newer version output: Stream #0.0[0x1011]: Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 23.98 fps, 90k tbn, 47.95 tbc
  • djvg
    djvg over 5 years
    Also see this answer and the ffmpeg source
  • Chloe
    Chloe over 4 years
    "the time base in AVStream that has come from the container" is a meaningless sentence.
  • Gyan
    Gyan over 4 years
    @Chloe how is it meaningless?
  • Chloe
    Chloe over 4 years
    @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.
  • fuzzyTew
    fuzzyTew about 4 years
    @Chloe time base: basis from which timing of frames is determined; avstream: audio/video sequential data; container: file format that can contain channels of audio/video data, such as avi, mp4, or mkv; these are digital video words, likely from the ffmpeg source, but I think what you are saying is that the answer does not explain these ffmpeg terms, which is valid.
  • ianh
    ianh about 2 years
    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).
  • michael
    michael about 2 years
    this answer is helpful in describing these conceptual terms: stackoverflow.com/a/43337235/127971

Related