ffmpeg 采用cuda 硬编解码

在找资料的过程中,找到两中方法:
第一种是ffmpeg官方文档,连接:
http://ffmpeg.org/doxygen/trunk/hw_decode_8c-example.html
第二种是git上一种:
https://github.com/chinahbcq/ffmpeg_hw_decode

两种方法都测试过,可以通过,不过第二种简单一点。

ps:
这一份也不错
https://www.cnblogs.com/betterwgo/p/6613641.html

参考:
https://www.cnblogs.com/huty/p/8517132.html
GPU视频解码之CUVID
https://blog.csdn.net/xiaoluer/article/details/53787545

https://blog.csdn.net/qq_27825451/article/details/89082978
NVIDIA的显卡驱动程序和CUDA完全是两个不同的概念哦!CUDA是NVIDIA推出的用于自家GPU的并行计算框架,也就是说CUDA只能在NVIDIA的GPU上运行,而且只有当要解决的计算问题是可以大量并行计算的时候才能发挥CUDA的作用。
CUDA的本质是一个工具包(ToolKit);但是二者虽然不一样的。

视频解码库CUVID
https://blog.csdn.net/chao56789/article/details/77984098
CUVID是基于CUDA的视频解码库,利用CUVID进行解码,主要包括以下四个步骤:

1.解析视频数据文件
2.在GPU端解码
3.转换解码后的数据(YUV420、NV12 —> RGBA)
4.将RGBA数据显示出来

NVIDIA Video Codec SDK
在这里插入图片描述

https://developer.nvidia.com/nvidia-video-codec-sdk

909636074+wechat
在这里插入图片描述

A comprehensive set of API including high-performance tools, samples and documentation for hardware accelerated video encode and decode on Windows and Linux.

NVIDIA GPUs contain one or more hardware-based decoder and encoder(s) (separate from the CUDA cores) which provides fully-accelerated hardware-based video decoding and encoding for several popular codecs. With decoding/encoding offloaded, the graphics engine and the CPU are free for other operations.

GPU hardware accelerator engines for video decoding (referred to as NVDEC) and video encoding (referred to as NVENC) support faster than real-time video processing which makes them suitable to be used for transcoding applications, in addition to video playback.

ffmpeg -i -c:v libx264 -b:v 2048k -vf scale=1280:-1 -y

上述命令将输入视频转码为h264编码的视频

-c:v:指定编码器,编码器列表可以使用ffmpeg -codecs查看
-vf scale:指定输出视频的宽高,高-1代表按照比例自动适应
-b:v:指定输出视频的码率,即输出视频每秒的bit数
libx264支持的其他参数请使用ffmpeg -h encoder=libx264命令查询,如转码为其他编码,也可使用类似命令查询可用参数

FFmpeg 编译支持NVIDIA硬件编解码-windows平台
nvdec和cuivd区别

http://trac.ffmpeg.org/wiki/HWAccelIntro

  • 3
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值