Ffmpeg 硬解码编译方法

1、下载nv-codec-headers

git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git

2、编译nv-codec

cd nv-codec-headers 
make 
sudo make install

3、下载Ffmpeg

git clone https://git.ffmpeg.org/ffmpeg.git

4、configure

./configure --enable-shared --disable-static --disable-yasm --disable-doc --enable-gpl --enable-pthreads --disable-w32threads --disable-os2threads --enable-debug --enable-nvenc --enable-cuda --enable-cuvid --extra-cflags="-Invidia_sdk -I/usr/local/cuda-8.0/include" --extra-ldflags="-Lnvidia_sdk -L/usr/local/cuda-8.0/lib64" --enable-nonfree --enable-libfreetype --enable-libfontconfig --enable-libnpp --enable-gpl
make -j10 &&sudo make install

5、demo样例

ffmpeg -hwaccel_device 2 -hwaccel cuvid -c:v h264_cuvid  -i LHLYBHL-20-142-1543662000.h264 -vf "scale_npp=format=yuv420p,hwdownload,format=yuv420p"        -pix_fmt yuvj420p -color_range 2  -r 5  -ss 00:00:10 -t 00:14:59 ./tmp/frame%5d.jpg

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值