当前位置:网站首页>Ffmpeg hard codec inter QSV

Ffmpeg hard codec inter QSV

2022-06-11 17:39:00 ,,,, Nanshan light rain

Hard codec in addition to the use of Nvidia Of GPU outside ,Inter Of QSV It is also a good plan , Follow Nvidia The difference is , If you want to use ffmepg Of Inter QSV codec , Need to compile ffmepg On when QSV Support for , That is, add the compile option :–enable-libmfx.

see ffmpeg Has been opened in h264 Protocol supported Libraries :

ffmpeg -hide_banner -codecs | grep h264

DEV.LS h264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part
10 (decoders: h264 h264_qsv ) (encoders: libx264 libx264rgb h264_nvenc
h264_qsv h264_vaapi nvenc nvenc_h264 )

Check it out. ffmpeg Yes Inter QSV Parameter support for :

ffmpeg -h encoder=h264_qsv


Use examples :
adopt ffmpeg -h encoder=h264 And ffmpeg -h decoder=h264 see h264_qsv You can see the hardware parameter information ,h264_qsv Only support nv12 And qsv Pixel format , So it's using yuv420p It needs to be converted into nv12 Can only be ,FFmpeg The conversion of this operation can be performed automatically , Here is an example of hard transcoding :

./ffmpeg -i 10M1080P.mp4 -pix_fmt nv12 -vcodec h264_qsv -an -y output.mp4

After command line execution ,FFmpeg Will use h264_qsv Decode and encode .

Inter QSV h265
ffmepg Medium Inter QSV h265 The parameters of Inter QSV h264 The parameters for are similar , However, the parameter specifying whether to use soft coding or hard coding has been added .
Use examples :
./ffmpeg -hide_banner -y -hwaccel qsv -i 10M1080P.mp4 -an -c:v hevc_qsv -load_plugin hevc_hw -b:v 5M -maxrate 5M out.mp4

原网站

版权声明
本文为[,,,, Nanshan light rain]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111716458003.html