time_base of ffmpeg transcode
来源:互联网 发布:杉杉来了知乎 编辑:程序博客网 时间:2024/06/08 03:35
ffmpeg-2.2.2
ffmpeg -f mpegts -i film.ts -c:a libfaac -c:v libx264 -f mp4 ff.mp4
1. video
1.1 get frame_rate in transcode_init
Line: 2497
if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {
if (ost->filter && !ost->frame_rate.num)
ost->frame_rate = av_buffersink_get_frame_rate(ost->filter->filter);
.......................................................
}
=> ost->frame_rate = {num = 24000, den = 1001}
so far, (initializing value)
enc->time_base = {0, 1}
enc->pkt_timebase = {0, 0}
ost->st->time_base = {1, 90000}
1.2 get codec->time_base in transcode_init
Line: 2531
case AVMEDIA_TYPE_VIDEO:
codec->time_base = av_inv_q(ost->frame_rate);
=>
codec->time_base = {1001, 24000}
1.3 get st->time_base and enc->pkt_timebase
=>avformat_write_header =>mov_write_header =>
for (i = 0; i < s->nb_streams; i++) {
AVStream *st= s->streams[i];
MOVTrack *track= &mov->tracks[i];
...........................................................................................
track->enc = st->codec;
track->st = st;
..............................................................................................
if (mov->video_track_timescale) {
track->timescale = mov->video_track_timescale;
} else {
track->timescale = st->codec->time_base.den; // track->timescale = 24000;
while(track->timescale < 10000)
track->timescale *= 2;
}
....................................................................................................
avpriv_set_pts_info(st, 64, 1, track->timescale);
=>st->time_base = {1, 24000}
=>st->codec->pkt_timebase = {1, 24000}
.......................................................................................................
}
而如果: ffmpeg -f mpegts -i film.ts -c:a libfaac -c:v libx264 -f mpegts ff.ts
st->codec->time_base = {1001, 24000}
则在 mpegts_write_header =>
for(i = 0;i < s->nb_streams; i++) {
st = s->streams[i];
avpriv_set_pts_info(st, 33, 1, 90000);
=>st->time_base = {1, 90000}
=>st->codec->pkt_timebase = {1, 90000}
..........................................................................
}
- time_base of ffmpeg transcode
- ffmpeg time_base
- ffmpeg time_base
- ffmpeg time_base
- FFMPEG transcode 整理分析
- ffmpeg time_base详解
- ffmpeg time_base详解
- ffmpeg time_base详解
- ffmpeg time_base详解
- ffmpeg time_base详解
- ffmpeg time_base详解
- ffmpeg time_base详解
- ffmpeg time_base介绍
- ffmpeg: time_base分析
- ffmpeg time_base详解
- ffmpeg源码分析:transcode()函数
- FFmpeg源码剖析-框架:transcode()
- FFMPEG Intro - AvCodecContext time_base Set
- Windows 下安装NPM
- 怎么查看自己电脑主板是否集成显卡
- WebRTC学习笔记
- ZOJ-3777-Problem Arrangement
- 程序员的11个阶段
- time_base of ffmpeg transcode
- 怎样在Word 2010文档中选择纵向或横向
- 《平凡的世界》
- ListCtrl::DeleteColumn的一点小经验(在原作中加了图片---youhx555)(2014-05-18)
- 复数类的改进
- ACCESS中的关键字
- 中国名气网
- myeclipse崩溃闪退解决方案
- Android高效加载大图、多图解决方案,有效避免程序OOM