'how to use GPU in ffmpeg (mp4 to jpg): Device creation failed: -12

I have used option '-hwaccel cuvid'.

sp.run(['ffmpeg','-hwaccel', 'cuvid',
                '-i', video_path, 
                '-q:v','2',
                '-f','image2',
                os.path.join(frame_path,'image_%6d.jpg')])

and got error

Device creation failed: -12.
[h264 @ 0x55ce2cce9440] No device available for decoder: device type cuda needed for codec h264.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Device setup failed for decoder on input stream #0:0 : Cannot allocate memory

i'm using GPU server through ssh

thanks for watching.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source