FFmpeg av_dump_format输出的tbn、tbc、tbr、PAR、DAR的含义
来源:互联网 发布:windows 7 共享 选项卡 编辑:程序博客网 时间:2024/04/29 15:25
av_dump_format(fmtCtx, 0, "rtmp://live.hkstv.hk.lxdns.com/live/hks", 0);
会打印流媒体的信息,比如:
[flv @ 0x7fa6ec813400] Stream discovered after head already parsedInput #0, flv, from 'rtmp://live.hkstv.hk.lxdns.com/live/hks': Metadata: author : PowerSmart copyright : description : datarate : 500 livetime : 1453688059 timeshift : 0 Duration: 01:00:00.00, start: 0.000000, bitrate: N/A Stream #0:0: Audio: aac (LC), 32000 Hz, stereo, fltp Stream #0:1: Video: h264 (Constrained Baseline), yuv420p, 640x480, 15.17 fps, 15 tbr, 1k tbn, 30 tbc
其中,15 tbr, 1k tbn, 30 tbc
是什么意思,很多人并不了解。
There are three different time bases for time stamps in FFmpeg. The values printed are actually reciprocals of these, i.e. 1/tbr, 1/tbn and 1/tbc.
tbn is the time base in AVStream that has come from the container, I think. It is used for all AVStream time stamps.
tbc is the time base in AVCodecContext for the codec used for a particular stream. It is used for all AVCodecContext and related time stamps.
tbr is guessed from the video stream and is the value users want to see when they look for the video frame rate, except sometimes it is twice what one would expect because of field rate versus frame rate.
tbr一般被当成帧率。当视频的码率为固定码率时,FFmpeg显示tbr为正常的码率值。当视频有变长码率时,FFmpeg打印的tbr为多个码率的均值,看着像音频流。比如:
Video: h264, yuv420p, 640x480, 22050 tbr, 22050 tbn, 44100 tbc
新问题Stream #0.0[0xfe]: Video: h264, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 59.94 tbr, 90k tbn, 59.94 tbc
中PAR、DAR是什么含义?
PAR - pixel aspect ratio大多数情况为1:1,就是一个正方形像素,否则为长方形像素
DAR - display aspect ratio就是视频播放时,我们看到的图像宽高的比例,缩放视频也要按这个比例来,否则会使图像看起来被压扁或者拉长了似的。
SAR - storage aspect ratio就是对图像采集时,横向采集与纵向采集构成的点阵,横向点数与纵向点数的比值。比如VGA图像640/480 = 4:3,D-1 PAL图像720/576 = 5:4
这三者的关系PAR x SAR = DAR或者PAR = DAR/SAR.
如果一段视频的DAR为4:3,它的SAR为VGA存储的4:3,那么可推出PAR为1:1,如果它的SAR为D-1 PAL存储的5:4,那么可以推出PAR为16:15
看上图,假设这就是一个D-1 PAL图像,每个方格代表一个存储的点,横向有5个点,纵向有4个点,所以SAR为5:4
现已知这幅图象的宽度为160,高度为120,即DAR为4:3
那这个方格的宽高比是多少呢?答案16:15,即PAR,这个方格代表的是一个长方形的像素。
视频三比率SAR,PAR,DAR是从宏观上描述一个视频轮廓很重要的三个参数。在不同的文档中,通常对这三个参数有不同的表述。但是,均指代同一事物。
参考及推荐阅读:
- What does the output of ffmpeg mean? tbr tbn tbc etc?
- What does the video output stream details from ffmpeg mean?
- ffmpeg frame rate
- 对PAR DAR SAR的理解
原文链接:http://www.jianshu.com/p/5b78a91f1091
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
- FFmpeg av_dump_format输出的tbn、tbc、tbr、PAR、DAR的含义
- FFmpeg av_dump_format输出的tbn、tbc、tbr、PAR、DAR的含义
- ffmpeg中tbc tbr tbn代表的含义
- ffmpeg中tbr tbc tbn的含义解释
- tbr tbn tbc 的意思
- tbr tbn tbc 的意思
- ffmpeg 的 tbr tbc 和 tbn的意义
- ffmpeg 的 tbr tbc 和 tbn的意义
- ffmpeg 的 tbr tbc 和 tbn的意义
- tbr tbn tbc
- tbr tbn tbc
- tbr tbn tbc
- FFmpeg 中的一些参数意义(tbr, tbn, tbc)
- SAR PAR DAR的区别
- SAR,PAR,DAR的理解
- 对PAR DAR SAR的理解
- 对PAR DAR SAR的理解
- 对PAR DAR SAR的理解
- C++著名类库
- USACO 2016 open Silver 解题报告
- 2016GDOI的总结
- COCOS2DX 3.X 相关命令
- (一) cifar10分类训练
- FFmpeg av_dump_format输出的tbn、tbc、tbr、PAR、DAR的含义
- ObjectInputStream序列化反序列化
- ABAP SY标签
- Google、百度、谷歌的最本质区别
- 各种开发API文档+开发工具
- HTTP协议知识点总结
- 菜鸟从零开始初始WebSocket -Server篇(二)
- 文件与IO(一)之字节流
- <根据马士兵>动态加载过程