時間基相關(guān)的定義
tbr 表示幀率,該參數(shù)傾向于一個基準(zhǔn),往往tbr跟fps相同。(the time base in AVStream that has come from the container) tbn 表示視頻流 timebase(時間基準(zhǔn)),比如ts流的timebase 為90000,flv格式視頻流timebase為1000 (the time base in AVCodecContext for the codec used for a particular stream) tbc 表示視頻流codec timebase ,對于264碼流該參數(shù)通過解析sps間接獲取(通過sps獲取幀率)(tbr is guessed from the video stream and is the value users want to see when they look for the video frame rate)
時間基相關(guān)的設(shè)置
分別設(shè)置tbn為80k、tbc為45、tbr為25 ffmpeg -hide_banner -i input.mp4 -c:v libx264 -time_base 1/80000 -enc_time_base 1/45 -r 25 -f mp4 output.mp4 -y output視頻輸出信息 Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 720x1280, q=-1--1, 25 fps, 80k tbn, 45 tbc (default) 詳細(xì)的轉(zhuǎn)碼日志
ffmpeg -hide_banner -i input.mp4 -c:v libx264 -time_base 1/80000 -enc_time_base 1/45 -r 25 -f mp4 output.mp4 -y
Input Metadata:major_brand
: qt minor_version
: 0compatible_brands: qt creation_time
: 2020-08-03T12:32:30.000000ZDuration: 00:00:20.54, start: 0.000000, bitrate: 4446 kb/sStream Metadata:creation_time
: 2020-08-03T12:32:30.000000Zhandler_name
: Core Media AudioStream Metadata:creation_time
: 2020-08-03T12:32:30.000000Zhandler_name
: Core Media Videoencoder
: H.264
Stream mapping:Stream Stream
Press
[ q
] to stop,
[ ?
] for help
[ libx264 @ 0x7fa61d010800
] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[ libx264 @ 0x7fa61d010800
] profile High, level 3.1, 4:2:0, 8-bit
[ libx264 @ 0x7fa61d010800
] 264 - core 159 r2999 296494a - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac
= 1 ref
= 3 deblock
= 1:0:0 analyse
= 0x3:0x113 me
= hex subme
= 7 psy
= 1 psy_rd
= 1.00:0.00 mixed_ref
= 1 me_range
= 16 chroma_me
= 1 trellis
= 1 8x8dct
= 1 cqm
= 0 deadzone
= 21,11 fast_pskip
= 1 chroma_qp_offset
= -2 threads
= 18 lookahead_threads
= 3 sliced_threads
= 0 nr
= 0 decimate
= 1 interlaced
= 0 bluray_compat
= 0 constrained_intra
= 0 bframes
= 3 b_pyramid
= 2 b_adapt
= 1 b_bias
= 0 direct
= 1 weightb
= 1 open_gop
= 0 weightp
= 2 keyint
= 250 keyint_min
= 25 scenecut
= 40 intra_refresh
= 0 rc_lookahead
= 40 rc
= crf mbtree
= 1 crf
= 23.0 qcomp
= 0.60 qpmin
= 0 qpmax
= 69 qpstep
= 4 ip_ratio
= 1.40 aq
= 1:1.00
Output Metadata:major_brand
: qt minor_version
: 0compatible_brands: qt encoder
: Lavf58.29.100Stream Metadata:creation_time
: 2020-08-03T12:32:30.000000Zhandler_name
: Core Media Videoencoder
: Lavc58.54.100 libx264Side data:cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1Stream Metadata:creation_time
: 2020-08-03T12:32:30.000000Zhandler_name
: Core Media Audioencoder
: Lavc58.54.100 aac
frame
= 926 fps
= 213 q
= -1.0 Lsize
= 3969kB time
= 00:00:20.51 bitrate
= 1585.4kbits/s dup
= 595 drop
= 0 speed
= 4.71x
video:3614kB audio:321kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.865847%
[ libx264 @ 0x7fa61d010800
] frame I:8 Avg QP:18.62 size: 56722
[ libx264 @ 0x7fa61d010800
] frame P:233 Avg QP:22.08 size: 11749
[ libx264 @ 0x7fa61d010800
] frame B:685 Avg QP:25.08 size: 743
[ libx264 @ 0x7fa61d010800
] consecutive B-frames: 1.1% 0.4% 1.3% 97.2%
[ libx264 @ 0x7fa61d010800
] mb I I16
.. 4: 13.0% 32.4% 54.6%
[ libx264 @ 0x7fa61d010800
] mb P I16
.. 4: 2.1% 4.1% 0.9% P16
.. 4: 42.2% 9.5% 6.5% 0.0% 0.0% skip:34.7%
[ libx264 @ 0x7fa61d010800
] mb B I16
.. 4: 0.0% 0.0% 0.0% B16
.. 8: 19.6% 0.2% 0.0% direct: 0.2% skip:79.9% L0:48.1% L1:51.0% BI: 0.8%
[ libx264 @ 0x7fa61d010800
] 8x8 transform intra:49.1% inter:72.7%
[ libx264 @ 0x7fa61d010800
] coded y,uvDC,uvAC intra: 53.5% 62.9% 12.8% inter: 6.0% 7.8% 0.1%
[ libx264 @ 0x7fa61d010800
] i16 v,h,dc,p: 40% 24% 24% 12%
[ libx264 @ 0x7fa61d010800
] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 12% 40% 4% 4% 6% 3% 4% 3%
[ libx264 @ 0x7fa61d010800
] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 14% 18% 7% 8% 9% 5% 6% 3%
[ libx264 @ 0x7fa61d010800
] i8c dc,h,v,p: 50% 18% 27% 6%
[ libx264 @ 0x7fa61d010800
] Weighted P-Frames: Y:3.4% UV:0.4%
[ libx264 @ 0x7fa61d010800
] ref P L0: 66.2% 16.2% 12.6% 4.9% 0.2%
[ libx264 @ 0x7fa61d010800
] ref B L0: 91.8% 6.7% 1.5%
[ libx264 @ 0x7fa61d010800
] ref B L1: 93.2% 6.8%
[ libx264 @ 0x7fa61d010800
] kb/s:1438.45
[ aac @ 0x7fa61d012000
] Qavg: 235.295
總結(jié)
以上是生活随笔 為你收集整理的ffmpeg设置视频 tbr、tbn、tbc 的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔 網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔 推薦給好友。