Meaning of ffmpeg output (tbc, tbn, tbr) [closed]
Asked Answered
P

1

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?

Pinter answered 7/7, 2010 at 22:45 Comment(3)
This should be transferred to video.se if possibleTombstone
See this detailed answer at superuser: superuser.com/questions/1362410/…Erst
Or the same in video stackexchange video.stackexchange.com/questions/35455/…Thilda
S
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?

Stemma answered 7/7, 2010 at 23:3 Comment(12)
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?Pinter
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 tbcHeal
Also see this answer and the ffmpeg sourceLum
"the time base in AVStream that has come from the container" is a meaningless sentence.Dulia
@Dulia how is it meaningless?Advancement
@Advancement 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.Dulia
@Dulia 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.Valance
The answer has some value, but it doesn't answer the questionHarass
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).Tripinnate
this answer is helpful in describing these conceptual terms: https://mcmap.net/q/120581/-what-is-video-timescale-timebase-or-timestamp-in-ffmpegSaturable
I don't know how to make of this answer. I have two videos, one says: 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc , another says: 56.18 fps, 90k tbr, 90k tbn, 180k tbc . Some software (moviepy ) is giving me fps=29.07 for the first one, fps=90000 for the second one. Apparently this moviepy is using the tbr as fps .Kenakenaf
For more details, see this answer at superuser: superuser.com/questions/1362410/…Erst

© 2022 - 2024 — McMap. All rights reserved.