ffmpeg+libx264编码H.264的视频

本文介绍如何正确配置FFmpeg与libx264进行视频编码,包括两遍编码法及单遍恒定率因子(CRF)编码的具体命令行参数设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ffmpeg+libx264不是装好就能work的,具体来说,需要在ffmpeg的命令行中加入一些option才能工作,具体请看这篇文章

下面是正确的命令行:

x264 – Recommended General Options

For all rate control methods you will probably want libx264 to select the number of threads to use to maximise its performance on your CPU(s):

-threads 0

Two-Pass Example

So if you wanted to encode using two-pass VBR, the command line would be something like:

ffmpeg -i INPUT -an -pass 1 -vcodec libx264 -vpre slow_firstpass -b BIT_RATE -bt BIT_RATE -threads 0 OUTPUT.mp4

Note: We don’t encode the audio in the first pass because we will not be using the data that was output.

ffmpeg -i INPUT -acodec libfaac -ab 128k -pass 2 -vcodec libx264 -vpre slow -b BIT_RATE -bt BIT_RATE -threads 0 OUTPUT.mp4

Single-Pass Constant Rate Factor (CRF) Example

Or for a single pass CRF encode:

ffmpeg -i INFILE -acodec libfaac -ab 96k -vcodec libx264 -vpre slow -crf 22 -threads 0 OUTPUT.mp4

转载于:https://www.cnblogs.com/super119/archive/2010/12/13/1904329.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值