ffmpeg 的 tbr tbc 和 tbn的意义
ffmpeg 的 tbr tbc 和 tbn的意义_北雨南萍的博客-CSDN博客 https://blog.csdn.net/fireroll/article/details/8607951
- ffmpeg -i video.flv
- Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 704x576 [PAR 12:11 DAR 4:3], 9578 kb/s, 25 tbr, 90k tbn, 50 tbc
- 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
不是所有参数都能得到的,有的文件没有这些信息,要看解析层而定。
代码如下:
25 tbr代表帧率;
代码如下:
- if(st->codec->codec_type == CODEC_TYPE_VIDEO){
- if(st->r_frame_rate.den && st->r_frame_rate.num)
- print_fps(av_q2d(st->r_frame_rate), "tbr");
- if(st->time_base.den && st->time_base.num)
- print_fps(1/av_q2d(st->time_base), "tbn");
- if(st->codec->time_base.den && st->codec->time_base.num)
- print_fps(1/av_q2d(st->codec->time_base), "tbc");
- }
90k tbn代表文件层(st)的时间精度,即1S=1200k,和duration相关;
50 tbc代表视频层(st->codec)的时间精度,即1S=50,和strem->duration和时间戳相关。
标签:
ffmpeg
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!