[英]Why this ffmpeg mp4/mkv/wmv/flv/avi to webm command line with cuda is as slow as with CPU?
我正在播放我的視頻文件,我想將它們從 mp4、mkv、wmv、avi、flv、mov... 轉換為 webm。
所以我寫了這個:
for file in *
do
if [ -f "$file" ]
then filename="${file%.*}"
../ffmpeg -hwaccel nvdec -hwaccel_device 0 -hwaccel_output_format cuda -i "$file" -c:v vp9 -b:v 0 -crf 31 -c:a libvorbis "$filename".webm
fi
done
如圖所示,我編譯了自己的 ffmpeg 二進制文件,其中包含以下選項:
./configure --enable-gpl --enable-libx264 --enable-nonfree --enable-cuda-nvcc --enable-libvpx --enable-vaapi --enable-libvorbis --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
它可以工作,但是,對於 CPU,我的速度為 0.1x,而對於 cuda...幾乎相同。
我的中央處理器? 第 11 代英特爾(R) 酷睿(TM) i7-11800H
我的 GPU? GeForce RTX™ 3060 移動版
文件大小? 300-3000mb(與任何速度相同)
有什么我可以做的嗎? (我也試過 vp9_vaapi,得到
Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scale_0'
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
有什么線索嗎? 還是我必須放棄?
謝謝
好吧,經過一些測試,最好的結果是使用
-c:v libvpx-vp9 -cpu-used 8 -deadline realtime
速度從 0.05 倍增加到 1.12 倍慢,但是,已經足夠好了。
質量對我來說很好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.