[FFmpeg-trac] #11505(avcodec:new): Cuvid decoders do not work with CUDA hwaccel anymore
FFmpeg
trac at avcodec.org
Wed Mar 12 16:06:59 EET 2025
#11505: Cuvid decoders do not work with CUDA hwaccel anymore
-------------------------------------+-------------------------------------
Reporter: bermond | Type: defect
Status: new | Priority: normal
Component: avcodec | Version: git-
Keywords: cuvid cuda | master
Nvidia hw_decode hwaccel | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Cuvid decoders do not work with CUDA hwaccel anymore in FFmpeg git master.
An error message says that `Codec h264_cuvid is not supported with this
chroma format`.
How to reproduce:
{{{
$ ffmpeg -init_hw_device cuda=gpu:0 -hwaccel cuda -hwaccel_output_format
cuda -hwaccel_device gpu -c:v h264_cuvid -i input.mp4 -y test-out.mp4
ffmpeg version N-118749-g0f7d77fc42 Copyright (c) 2000-2025 the FFmpeg
developers
built with gcc 14.2.1 (GCC) 20250207
configuration: --prefix=/usr --enable-lto --disable-rpath --enable-gpl
--enable-version3 --enable-nonfree --enable-shared --disable-static
--disable-stripping --disable-htmlpages --enable-gray --enable-alsa
--enable-avisynth --enable-bzlib --enable-chromaprint --enable-frei0r
--enable-gcrypt --enable-gmp --enable-gnutls --enable-iconv --enable-
ladspa --enable-lcms2 --enable-libaom --enable-libaribb24 --enable-
libaribcaption --enable-libass --enable-libbluray --enable-libbs2b
--enable-libcaca --enable-libcelt --enable-libcdio --enable-libcodec2
--enable-libdav1d --enable-libdavs2 --enable-libdc1394 --enable-libdvdnav
--enable-libdvdread --enable-libfdk-aac --enable-libflite --enable-
libfontconfig --enable-libfreetype --enable-libfribidi --enable-
libharfbuzz --enable-libglslang --enable-libgme --enable-libgsm --enable-
libiec61883 --enable-libilbc --enable-libjack --enable-libjxl --enable-
libklvanc --enable-libkvazaar --enable-liblc3 --enable-liblcevc-dec
--enable-liblensfun --enable-libmodplug --enable-libmp3lame --enable-
libopencore-amrnb --enable-libopencore-amrwb --enable-libopencv --enable-
libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopenvino
--enable-libopus --enable-libplacebo --enable-libpulse --enable-
libqrencode --enable-libquirc --enable-librabbitmq --enable-librav1e
--enable-librist --enable-librsvg --enable-librubberband --enable-librtmp
--disable-libshaderc --enable-libshine --enable-libsmbclient --enable-
libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-
libssh --enable-libsvtav1 --enable-libsvthevc --enable-libsvtvp9
--disable-libtensorflow --enable-libtesseract --enable-libtheora
--disable-libtls --disable-libtorch --enable-libtwolame --enable-libuavs3d
--enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libvvenc --enable-
libwebp --enable-libx264 --enable-libx265 --enable-libxevd --enable-
libxeve --enable-libxavs --enable-libxavs2 --enable-libxcb --enable-
libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-libxvid
--enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi
--enable-lv2 --enable-lzma --enable-decklink --disable-mbedtls --enable-
libmysofa --enable-openal --enable-opencl --enable-opengl --disable-
openssl --disable-pocketsphinx --enable-sndio --enable-sdl2 --enable-
vapoursynth --enable-vulkan --enable-xlib --enable-zlib --enable-amf
--enable-cuda-nvcc --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec
--enable-libdrm --enable-libvpl --enable-libnpp --enable-nvdec --enable-
nvenc --enable-omx --enable-rkmpp --enable-v4l2-m2m --enable-vaapi
--enable-vdpau
libavutil 59. 59.100 / 59. 59.100
libavcodec 61. 33.102 / 61. 33.102
libavformat 61. 9.107 / 61. 9.107
libavdevice 61. 4.100 / 61. 4.100
libavfilter 10. 9.100 / 10. 9.100
libswscale 8. 13.101 / 8. 13.101
libswresample 5. 4.100 / 5. 4.100
libpostproc 58. 4.100 / 58. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2023-02-17T22:54:31.000000Z
Duration: 00:00:40.75, start: 0.000000, bitrate: 817 kb/s
Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661),
yuv420p(tv, bt709, progressive), 576x1024 [SAR 1:1 DAR 9:16], 684 kb/s,
29.97 fps, 29.97 tbr, 30k tbn (default)
Metadata:
creation_time : 2023-02-17T22:54:31.000000Z
handler_name : ISO Media file produced by Google Inc. Created on:
02/17/2023.
vendor_id : [0][0][0][0]
Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2023-02-17T22:54:31.000000Z
handler_name : ISO Media file produced by Google Inc. Created on:
02/17/2023.
vendor_id : [0][0][0][0]
[h264_cuvid @ 0x5ea53363e140] Codec h264_cuvid is not supported with this
chroma format.
[vist#0:0/h264 @ 0x5ea5335a5f40] [dec:h264_cuvid @ 0x5ea533683d00] Error
while opening decoder: Invalid argument
Error opening output file test-out.mp4.
Error opening output files: Invalid argument
}}}
The command bellow, without hwaccel, works:
{{{
$ ffmpeg -c:v h264_cuvid -i input.mp4 -y test-out.mp4
}}}
A git bisect shows the offending commit as being:
7e9655800da385f8dc9d31f6ac831910f98c8c9e.
Operating System: Arch Linux
FFmpeg: git master
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11505>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list