[FFmpeg-user] Failed setup for format cuda: hwaccel initialisation returned error

Douglas Rhiner douglasrhiner at gmail.com
Mon Nov 1 00:10:49 EET 2021


I just can't seem to get FFMPEG to play nice with hardware acceleration.
After the input file is read the following errors kick-back:

[h264 @ 000002366512e8c0] Video width 5120 not within range from 48 to 4096
[h264 @ 000002366512e8c0] Using more than 32 (40) decode surfaces might
cause nvdec to fail.
[h264 @ 000002366512e8c0] Try lowering the amount of threads. Using 16
right now.
[h264 @ 000002366512e8c0] Failed setup for format cuda: hwaccel
initialisation returned error.

And the encoding continues & completes.
The first error I think is because we are feeding it a video that is 5120px
wide.
The last error is the one that is persistent.

I've been staring at this one for too long and need another set of eyes.

I've tried probably 6 different formulas for compile/config ffmpeg to no
avail.
Here is my last try at this.

*Environment*
Windows 10 Pro
AMD Ryzen TR 3970X
ASUS TUF RTX3090 OC
64GB RAM


*Config commands*./configure --toolchain=msvc
./configure --toolchain=msvc --enable-cuda-nvcc --enable-nonfree
–disable-shared --enable-libnpp --extra-cflags=-I../nv_sdk
--extra-ldflags=-libpath:../nv_sdk

*Command to run:*
ffmpeg -hwaccel cuda -hwaccel_output_format cuda -y -i
"X:\publish\target\360video_transition\318943\318943.mp4" -c:v h264_nvenc
-profile:v high -level:v 5.1 -b:v 3000k -maxrate 3000k -bufsize 2225k -vf
scale=-2:720 -c:a aac -b:a 315k -movflags +faststart -f mp4
"X:\publish\target\360video_transition\318943\720_3000.mp4"

*Output:*
ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200523
  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libdav1d --enable-libbluray --enable-libfreetype
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid
--enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2
--enable-avisynth --enable-libopenmpt
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'X:\publish\target\360video_transition\318943\318943.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2021-10-21T21:23:20.000000Z
  Duration: 00:00:35.41, start: 0.000000, bitrate: 55522 kb/s
    Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 317 kb/s (default)
    Metadata:
      creation_time   : 2021-10-21T21:23:35.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
    Stream #0:1(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
bt709), 5120x2560, 55262 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
(default)
    Metadata:
      creation_time   : 2021-10-21T21:23:44.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : AVC Coding
    Side data:
      stereo3d: 2D
      spherical: equirectangular (0.000000/0.000000/0.000000)
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
  Stream #0:0 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help



*[h264 @ 000002366512e8c0] Video width 5120 not within range from 48 to
4096[h264 @ 000002366512e8c0] Using more than 32 (40) decode surfaces might
cause nvdec to fail.[h264 @ 000002366512e8c0] Try lowering the amount of
threads. Using 16 right now.[h264 @ 000002366512e8c0] Failed setup for
format cuda: hwaccel initialisation returned error.*
Output #0, mp4, to
'X:\publish\target\360video_transition\318943\720_3000.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    encoder         : Lavf58.29.100
    Stream #0:0(eng): Video: h264 (h264_nvenc) (High) (avc1 / 0x31637661),
yuv420p, 1440x720, q=-1--1, 3000 kb/s, 29.97 fps, 30k tbn, 29.97 tbc
(default)
    Metadata:
      creation_time   : 2021-10-21T21:23:44.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : Lavc58.54.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 3000000/0/3000000 buffer size: 2250000
vbv_delay: -1
      stereo3d: 2D
      spherical: equirectangular (0.000000/0.000000/0.000000)
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 315 kb/s (default)
    Metadata:
      creation_time   : 2021-10-21T21:23:35.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
      encoder         : Lavc58.54.100 aac
[mp4 @ 000002366721e800] Starting second pass: moving the moov atom to the
beginning of the file
frame= 1060 fps= 92 q=30.0 Lsize=   14560kB time=00:00:35.38
bitrate=3370.5kbits/s speed=3.07x
video:13169kB audio:1360kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.210827%
[aac @ 0000023667490980] Qavg: 13133.060


-- 
Douglas Rhiner
JD Publishing
CTO
C.530-448-2754
Skype.douglasrhiner
924 Incline Way Suite L
Incline Village, NV
89451


More information about the ffmpeg-user mailing list