ffmpeg 性能测试与分析

http://www.ffmpeg.org/general.html#Video-Codecs · 支持的编解码器 ffmpeg -codecs · 支持的格式 ffmpeg -formats · 支持的编码器 ffmpeg -encoders · 支持的编码器 ffmpeg -decoder

http://www.ffmpeg.org/general.html#Video-Codecs

· 支持的编解码器

ffmpeg -codecs

· 支持的格式

ffmpeg -formats

· 支持的编码器

ffmpeg -encoders

· 支持的编码器

ffmpeg -decoders

硬件加速支持:

查看所有硬件加速器

ffmpeg -hwaccels

Untitled.png

ffmpeg -codecs | grep cuvid

Untitled.png

针对一段input.mp4(1920x1080 561帧 h264编码格式)

· 只解码

time ffmpeg -c:v h264 -i input.mp4 -benchmark -f null -

bench: utime=9.018s
bench: maxrss=180052kB

real 0m0.996s
user 0m9.093s
sys 0m0.185s

· 硬件解码

time ffmpeg -c:v h264_cuvid -i input.mp4 -benchmark -f null -

bench: utime=0.522s
bench: maxrss=157788kB

real 0m4.339s
user 0m0.626s
sys 0m0.365s

· 编解码 libx264 -level 3.1 crf=28

time ffmpeg -i input.mp4 -c:v libx264 -profile:v main -preset:v fast -level 3.1 output.mp4 -x264opts crf=28 -benchmark

real 0m6.861s
user 0m59.156s
sys 0m1.257s

· 编解码 libx264 -level 3.1 crf=18

time ffmpeg -i input.mp4 -c:v libx264 -profile:v main -preset:v fast -level 3.1 output.mp4 -x264opts crf=18 -benchmark

real 0m4.547s
user 1m0.103s
sys 0m1.255s

· 硬件编解码 h264_cuvid

time ffmpeg -i input.mp4 -c:v h264_nvenc  output.mp4 -x264opts crf=18 -benchmark

bench: utime=11.321s
bench: maxrss=314888kB

real 0m9.152s
user 0m11.418s
sys 0m1.693s

test

time ffmpeg -i input.mp4 -c:v h264_nvenc output.mp4 -qp 0 -x264opts crf=0 -an -preset:v fast -benchmark

LICENSED UNDER CC BY-NC-SA 4.0
Comment