当前位置:网站首页>Three steps of ffmpeg CBR precise bitstream control
Three steps of ffmpeg CBR precise bitstream control
2022-06-11 17:39:00 【,,,, Nanshan light rain】
x264 You can set VBR and CBR The encoding mode of ,VBR Variable bit rate ,CBR Is a constant bit rate . Although on the Internet VBR Mostly , however CBR There is still a .
ffmpeg It's through -b:v To specify the video bit rate , But this setting is the average , It can not control the fluctuation range well . If you want to control fluctuations , It is also necessary to control the maximum code rate and the minimum code rate , namely -b:v,maxrate,minrate. At the same time, in order to better control the fluctuation during coding, you can also set the buffer size , Setting the -bufsize that will do .buffer The smaller is not the better , It's just right , Such as 1Mbit/s,bufsize Set to 50KB, It can well control the fluctuation of code rate .
ffmpeg -i input.mp4 -c:v libx264 -x264opts "bframes=10:b-adapt=0" -b:v
1000k -maxrate 1000k -minrate 1000k -bufsize 50k -nal-hrd cbr -g 50 -sc_threshold 0
output.ts
Let's analyze this command line , As follows .
● Set up B Number of frames , And every two P Include between frames 10 individual B frame
● Set the video bit rate to 1000kbit/s
● Set the maximum code rate to 1000kbit/s
● Set the minimum code rate to 1000kbit/s
● Set the encoded buffer The size is 50KB
● Set up H.264 The coding HRD The signal form is CBR
● Set every 50 Frame a GOP
● Set scene switching not to force keyframes
Generated according to the above parameter settings output.ts file , Use Bitrate Viewer Observe the rate fluctuation effect , The result is shown in Fig. 4-6 Shown .
It can be seen from the figure that the code rate fluctuation is the minimum 996kbit/s, The maximum bit rate is 1001kbit/s, The bit rate is controlled
Supplementary information B frame :
If you don't want to B frame , multi-purpose B Frames can make h264 The real compression ratio reaches 200,I The frame compression rate is the lowest ,P Frame medium ,B The frame is the highest , therefore B Frames also increase the encoder load , But it can reduce the bit rate . Compared with not using , multi-purpose B When the frame , The same bit rate video is clearer .
Add :
ABR yes VBR and CBR The hybrid scheme of ,VBR Generally used for media storage , Instead of network transmission , In fact, network transmission is called CBR It's usually ABR, As long as the bit rate is controlled within the unit time .ABR Coding is... In speed VBR Coded 2 To 3 times , But lower than CBR.
CBR The disadvantage of coding is that the quality is unstable , When there is movement , The quality will go down , Especially when the set bit rate is low .
VBR The advantage of is that when the content is simple , The allocated bit rate is less , When the video is complex, more bit rates are allocated , So when the file size is the same ,VBR The video quality of is better than CBR. When both are of the same quality ,VBR The size may be just CBR Half of .
边栏推荐
- 6-3 批量求和(*)
- 聚类方法汇总
- 信息安全数学基础 Chapter 1——整除
- 为什么udp流设置1316字节
- From manufacturing to "intelligent manufacturing", explore the way for manufacturing enterprises to break the situation
- 6-3 读文章(*)
- 04_ Feature engineering feature selection
- Service学习笔记03- 前台服务实战
- Use exe4j to convert The jar file is packaged as Exe file
- R语言 mice包 Error in terms.formula(tmp, simplify = TRUE) : ExtractVars里的模型公式不对
猜你喜欢

Test basis: black box test

QLineEdit 设置输入掩码

Authoring share | understanding saml2 protocol

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mod

Automated testing selenium

Summary of clustering methods

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_ mod

Authing biweekly news: online application market (5.10-5.22)

送给大模型的「高考」卷:442人联名论文给大模型提出204个任务,谷歌领衔

Service learning notes 01 start method and life cycle
随机推荐
tidb-lightning配置数据还原路由
Merge K ascending linked lists ---2022/02/26
ArrayList collection, object array
Tidb unsafe recover (tikv downtime is greater than or equal to half the number of replicas)
【深度学习基础】神经网络的学习(3)
Mathematical foundations of information security Chapter 3 - finite fields (I)
Automated testing selenium
信息安全数学基础 Chapter 3——有限域(一)
Dynamic: capturing network dynamics using dynamic graph representation learning
R language to find missing value location of data set
Difference between require and ES6 import
CentOS7服务器配置(四)---安装redis
你还不懂线程池的设计及原理吗?掰开揉碎了教你设计线程池
What problems are exposed when all Sohu employees are cheated?
Remove key lookup bookmark from SQL Server
Service learning notes 03 front desk service practice
有效的括号---2022/02/23
R language mice package error in terms Formula (TMP, simplify = true): the model formula in extractvars is incorrect
聚类方法汇总
6-3 reading articles (*)