Eli Ning 2020-07-27 12:20 采纳率: 0%
浏览 262

ffmpeg 硬件加速 生成图片

ffmpeg可以使用cuda硬件加速的方法 解码编码mp4。
所以在想可不可以也加速抽离图片

第二个需求是把视频抽离成单张图片,用的是这个方法

ffmpeg -i 1.mp4 -f image2 q:v 2 -an -r 10 -s 320*180 D:\cut\%4d.jpg

在ffmpeg里面文档看到的方法是有专门的剥离器叫“Demuxers”

在N卡的发布手册里面也看到有jpeg图片格式解码编码的支持。
请问我上面代码怎么改进?

Libraries
The scientific and utility libraries listed below are available in the lib/ directory (DLLs on Windows are in bin/), and their interfaces are available in the include/ directory.
cublas (BLAS)
cublas_device (BLAS Kernel Interface)
cuda_occupancy (Kernel Occupancy Calculation [header file implementation])
cudadevrt (CUDA Device Runtime)
cudart (CUDA Runtime)
cufft (Fast Fourier Transform [FFT])
cupti (CUDA Profiling Tools Interface)
curand (Random Number Generation)
cusolver (Dense and Sparse Direct Linear Solvers and Eigen Solvers)
cusparse (Sparse Matrix)
libcu++ (CUDA Standard C++ Library)
nvJPEG (JPEG encoding/decoding)
npp (NVIDIA Performance Primitives [image and signal processing])
nvblas ("Drop-in" BLAS)
nvcuvid (CUDA Video Decoder [Windows, Linux])
nvgraph (CUDA nvGRAPH [accelerated graph analytics])
nvml (NVIDIA Management Library)
nvrtc (CUDA Runtime Compilation)
nvtx (NVIDIA Tools Extension)
thrust (Parallel Algorithm Library [header file implementation])

也测试过了如下代码都失败了

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i 1.ts -c:v h264_nvenc -vframes 54000 image%5d.jpg

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i 1.ts -c:v h264_nvenc -vframes 54000 image%5d.jpg

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i 1.mp4 -c:v h264_nvenc -f image2 -r 1 image%5d.jpg

ffmpeg -hwaccel cuvid -i 1.mp4 -f image2 -r 5 image%5d.jpg

请问我上面代码怎么改进?

  • 写回答

1条回答 默认 最新

  • threenewbee 2020-07-27 16:45
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?