learn_ffmpeg 发表于 2016-6-1 18:49:06

ffmpeg中是怎么使用NV 的CUDA进行编码的

ffmpeg中是怎么使用NV 的CUDA进行编码的

孙悟空 发表于 2016-6-6 13:32:42

nvidia有NvENC,不过使用的encoder
https://developer.nvidia.com/nvidia-video-codec-sdk

在编译ffmpeg的时候configure配置时需要开启
--enable-nvenc         enable NVIDIA NVENC support

孙悟空 发表于 2016-6-6 13:34:06

下面是记录的笔记,安装SDK后需要确认一些信息
nvidia-smi-a 查看GPU状态命令

/root/NVIDIA_CUDA-7.0_Samples/bin/x86_64/linux/release 这个下面有一系列的GPU的测试工具,可以使用
查看
# ./deviceQuery
./deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "Tesla K20c"
CUDA Driver Version / Runtime Version          7.0 / 7.0
CUDA Capability Major/Minor version number:    3.5
Total amount of global memory:               4800 MBytes (5032706048 bytes)
(13) Multiprocessors, (192) CUDA Cores/MP:   2496 CUDA Cores
GPU Max Clock rate:                            706 MHz (0.71 GHz)
Memory Clock rate:                           2600 Mhz
Memory Bus Width:                              320-bit
L2 Cache Size:                                 1310720 bytes
Maximum Texture Dimension Size (x,y,z)         1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
Maximum Layered 1D Texture Size, (num) layers1D=(16384), 2048 layers
Maximum Layered 2D Texture Size, (num) layers2D=(16384, 16384), 2048 layers
Total amount of constant memory:               65536 bytes
Total amount of shared memory per block:       49152 bytes
Total number of registers available per block: 65536
Warp size:                                     32
Maximum number of threads per multiprocessor:2048
Maximum number of threads per block:         1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size    (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch:                        2147483647 bytes
Texture alignment:                           512 bytes
Concurrent copy and kernel execution:          Yes with 2 copy engine(s)
Run time limit on kernels:                     No
Integrated GPU sharing Host Memory:            No
Support host page-locked memory mapping:       Yes
Alignment requirement for Surfaces:            Yes
Device has ECC support:                        Enabled
Device supports Unified Addressing (UVA):      Yes
Device PCI Domain ID / Bus ID / location ID:   0 / 4 / 0
Compute Mode:
   < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.0, CUDA Runtime Version = 7.0, NumDevs = 1, Device0 = Tesla K20c
Result = PASS

孙悟空 发表于 2016-6-6 13:35:51

https://github.com/Brainiarc7/ffmpeg_libnvenc

也可以参考这个

learn_ffmpeg 发表于 2016-6-13 15:21:07

大师兄 这个nvenc搞出来了但是我用的是GTX TITANX 这个显卡,每个系统限制2路转码,这个是不能接受的,现在准备改成cuda并行计算进行加速,你有没有什么资料?谢谢大师兄:D

learn_ffmpeg 发表于 2016-6-13 15:21:49

好牛逼的显卡

孙悟空 发表于 2016-6-13 16:59:08

learn_ffmpeg 发表于 2016-6-13 15:21
好牛逼的显卡

现在看懂了?

learn_ffmpeg 发表于 2016-6-13 18:33:32

知道cuda怎么用了!但是要把实现cuda加速x265的编码,我还需要走很长的路:lol
页: [1]
查看完整版本: ffmpeg中是怎么使用NV 的CUDA进行编码的