<div dir="ltr">Helo,<div>I am trying to decode a video stream in C++ application using ffmpeg cuda hardware acceleration.<br>My windows machine has GPU is GTX1060  Update driver version 512.59<br><br><br>err = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_CUDA,<br>            NULL, NULL, 0) <br><br>Function fails with errorcode -12<br>but when I pass AV_HWDEVICE_TYPE_DXVA2, it succeeds.<br><br>----------------------------</div><div>My observations about ffmpeg cuda compiled tool :<br>  I observed that cuda based image decoding and video decoding is working fine using ffmpeg tool as below example works and use GPU for decoding purpose.<br>ex1. ffmpeg -hwaccel cuda -i "D:\myvideo.avi"  output.mp4<br>ex2. ffmpeg -hwaccel cuda -i D:\myvideo.mp4 -y ./tests/%04d.jpg<br><br></div><div>also the tool shows it supports cuda hardware acceleration.</div><div>command:  ffmpeg.exe -hwaccels<br>output: ffmpeg version 4.4.git Copyright (c) 2000-2022 the FFmpeg developers<br>  built with Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30140 for x64<br>  configuration: --enable-nonfree --enable-shared --enable-ffnvcodec --enable-cuda-llvm --enable-gpl --disable-debug --enable-cuda-nvcc --enable-libnpp --toolchain=msvc --extra-cflags=-I../nv_sdk --extra-ldflags='-libpath:../nv_sdk' --nvccflags='-gencode arch=compute_60,code=sm_60 -O2'<br>  libavutil      57. 24.101 / 57. 24.101<br>  libavcodec     59. 28.100 / 59. 28.100<br>  libavformat    59. 23.100 / 59. 23.100<br>  libavdevice    59.  6.100 / 59.  6.100<br>  libavfilter     8. 38.100 /  8. 38.100<br>  libswscale      6.  6.100 /  6.  6.100<br>  libswresample   4.  6.100 /  4.  6.100<br>  libpostproc    56.  5.100 / 56.  5.100<br>Hardware acceleration methods:<br>cuda<br>dxva2<br>d3d11va<br><br><br>-----------------------------------------<br><br><br>So it looks like the compiled libraries are fine. I am missing some other thing.<br>Can someone help on this cuda based decoding using ffmpeg.<br></div><div><br></div><div><br></div><div>Thanks</div><div>Santosh</div></div>