查看
nvidia-smi
±----------------------------------------------------------------------------------------+
| NVIDIA-SMI 551.61 Driver Version: 551.61 CUDA Version: 12.4 |
|-----------------------------------------±-----------------------±---------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=++======|
| 0 NVIDIA GeForce RTX 4070 ... WDDM | 00000000:01:00.0 On | N/A |
| 0% 43C P8 12W / 285W | 711MiB / 16376MiB | 26% Default |
| | | N/A |
±----------------------------------------±-----------------------±---------------------+
查看硬件编解码器
c
ffmpeg -hwaccels
Hardware acceleration methods:
cuda
dxva2
qsv
d3d11va
opencl
vulkan
命令
同时使用cuda 进行解码和编码,把mp4文件从h264 转成h265,preset选择 medium
c
ffmpeg -hwaccel cuda -i c:/alt.mp4 -c:v hevc_nvenc -preset medium -c:a copy output.mp4
使用preset 选择 fast, 指定 码率为1M
c
ffmpeg -hwaccel cuda -i c:/alt.mp4 -c:v hevc_nvenc -preset fast -b:v 1M -c:a copy output1.mp4