Opened 17 months ago
Closed 17 months ago
#11618 closed defect (invalid)
hwupload filter fails with "Cannot allocate memory" for VA-API on AMD RX 7900 XT (Navi 31) preventing H.264/HEVC hardware encoding initialization.
| Reported by: | CN | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | ffmpeg |
| Version: | 7.1 | Keywords: | hwupload |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
Summary of the bug: Fails to encode video files on Radeon hardware with various methods. Gemini says 'The problem is not necessarily with the h264_vaapi or hevc_vaapi encoder itself, but with the hwupload filter failing to allocate memory on your VA-API device. This is a lower-level issue than just a pixel format or encoder parameter problem.
This "Cannot allocate memory" error for hwupload when dealing with VA-API on AMD GPUs (especially newer ones like Navi 3x) can indicate several things'
How to reproduce:
see logs for versions and examples below:
--- FFmpeg Bug Report Log ---
Generated on: Sat 31 May 22:00:14 BST 2025
--- 1. vainfo output ---
Command: vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Mesa Gallium driver 25.1.1-arch1.2 for AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 19.1.7, DRM 3.61, 6.14.7-arch2-1)
vainfo: Supported profile and entrypoints
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileAV1Profile0 : VAEntrypointVLD
VAProfileAV1Profile0 : VAEntrypointEncSlice
VAProfileNone : VAEntrypointVideoProc
--- 2. pacman -Q mesa output ---
Command: pacman -Q mesa
mesa 1:25.1.1-2
--- 3. uname -r output (Kernel Version) ---
Command: uname -r
6.14.7-arch2-1
--- 4. lspci -k | grep -EA3 'VGA|3D|Display' output (GPU Info) ---
Command: lspci -k | grep -EA3 'VGA|3D|Display'
lspci: Unable to load libkmod resources: error -2
0b:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 [Radeon RX 7900 XT/7900 XTX/7900 GRE/7900M] (rev cc)
Subsystem: Sapphire Technology Limited PULSE RX 7900 XTX
Kernel driver in use: amdgpu
0b:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 31 HDMI/DP Audio
--- 5. FFmpeg Version and Configuration ---
Command: ffmpeg -version
ffmpeg version n7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 15.1.1 (GCC) 20250425
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
--- 6. Output of the failing synthetic FFmpeg command ---
Command: ffmpeg -v debug -init_hw_device vaapi=va:/dev/dri/renderD128 -f lavfi -i testsrc=s=1280x720:r=30:d=5 -vf 'hwupload=derive_device=va,format=nv12' -c:v h264_vaapi -qp 24 -y output_test_synthetic.mp4
ffmpeg version n7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 15.1.1 (GCC) 20250425
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'vaapi=va:/dev/dri/renderD128'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'lavfi'.
Reading option '-i' ... matched as input url with argument 'testsrc=s=1280x720:r=30:d=5'.
Reading option '-vf' ... matched as option 'vf' (alias for -filter:v (apply filters to video streams)) with argument 'hwupload=derive_device=va,format=nv12'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder ('copy' to copy stream without reencoding)) with argument 'h264_vaapi'.
Reading option '-qp' ... matched as AVOption 'qp' with argument '24'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'output_test_synthetic.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Applying option init_hw_device (initialise hardware device) with argument vaapi=va:/dev/dri/renderD128.
[AVHWDeviceContext @ 0x562c9170b800] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x562c9170b800] libva: Trying to open /usr/lib/dri/radeonsi_drv_video.so
[AVHWDeviceContext @ 0x562c9170b800] libva: Found init function vaDriverInit_1_22
[AVHWDeviceContext @ 0x562c9170b800] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x562c9170b800] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x562c9170b800] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x32313050 -> p012le.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x36313050 -> unknown.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x56595559 -> unknown.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x30303859 -> gray.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x50343434 -> yuv444p.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x56323234 -> yuv440p.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x50424752 -> unknown.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x42475241 -> argb.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x30335241 -> unknown.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x30334241 -> unknown.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x30335258 -> x2rgb10le.
[AVHWDeviceContext @ 0x562c9170b800] Format 0x30334258 -> unknown.
[AVHWDeviceContext @ 0x562c9170b800] VAAPI driver: Mesa Gallium driver 25.1.1-arch1.2 for AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 19.1.7, DRM 3.61, 6.14.7-arch2-1).
[AVHWDeviceContext @ 0x562c9170b800] Driver not found in known nonstandard list, using standard behaviour.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url testsrc=s=1280x720:r=30:d=5.
Applying option f (force container format (auto-detected otherwise)) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: testsrc=s=1280x720:r=30:d=5.
[AVFilterGraph @ 0x562c91915cc0] Setting 's' to value '1280x720'
[AVFilterGraph @ 0x562c91915cc0] Setting 'r' to value '30'
[AVFilterGraph @ 0x562c91915cc0] Setting 'd' to value '5'
detected 16 logical cores
[Parsed_testsrc_0 @ 0x562c91918d80] size:1280x720 rate:30/1 duration:5.000000 sar:1/1
[AVFilterGraph @ 0x562c91915cc0] query_formats: 2 queried, 3 merged, 0 already done, 0 delayed
[lavfi @ 0x562c91915900] All info found
Input #0, lavfi, from 'testsrc=s=1280x720:r=30:d=5':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0, 1, 1/30: Video: wrapped_avframe, 1 reference frame, rgb24, 1280x720 [SAR 1:1 DAR 16:9], 0/1, 30 fps, 30 tbr, 30 tbn
Successfully opened the file.
Parsing a group of options: output url output_test_synthetic.mp4.
Applying option vf (alias for -filter:v (apply filters to video streams)) with argument hwupload=derive_device=va,format=nv12.
Applying option c:v (select encoder/decoder ('copy' to copy stream without reencoding)) with argument h264_vaapi.
Successfully parsed a group of options.
Opening an output file: output_test_synthetic.mp4.
[out#0/mp4 @ 0x562c9191b780] No explicit maps, mapping streams automatically...
[vost#0:0/h264_vaapi @ 0x562c9191c000] Created video stream from input stream 0:0
[AVFilterGraph @ 0x562c9191ea40] Setting 'derive_device' to value 'va'
[AVFilterGraph @ 0x562c9191ea40] Setting 'pix_fmts' to value 'nv12'
[file @ 0x562c91921640] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_vaapi))
[vost#0:0/h264_vaapi @ 0x562c9191c000] Starting thread...
[vf#0:0 @ 0x562c9191e980] Starting thread...
[vist#0:0/wrapped_avframe @ 0x562c917a3400] [dec:wrapped_avframe @ 0x562c91920140] Starting thread...
[in#0/lavfi @ 0x562c91915040] Starting thread...
Press [q] to stop, ? for help
[AVFilterGraph @ 0x7f8d58001000] Setting 'derive_device' to value 'va'
[AVFilterGraph @ 0x7f8d58001000] Setting 'pix_fmts' to value 'nv12'
[graph -1 input from stream 0:0 @ 0x7f8d58004a00] Setting 'video_size' to value '1280x720'
[graph -1 input from stream 0:0 @ 0x7f8d58004a00] Setting 'pix_fmt' to value '2'
[graph -1 input from stream 0:0 @ 0x7f8d58004a00] Setting 'time_base' to value '1/30'
[graph -1 input from stream 0:0 @ 0x7f8d58004a00] Setting 'pixel_aspect' to value '1/1'
[graph -1 input from stream 0:0 @ 0x7f8d58004a00] Setting 'colorspace' to value '0'
[graph -1 input from stream 0:0 @ 0x7f8d58004a00] Setting 'range' to value '2'
[graph -1 input from stream 0:0 @ 0x7f8d58004a00] Setting 'frame_rate' to value '30/1'
[graph -1 input from stream 0:0 @ 0x7f8d58004a00] w:1280 h:720 pixfmt:rgb24 tb:1/30 fr:30/1 sar:1/1 csp:gbr range:pc
[format @ 0x7f8d58005640] Setting 'pix_fmts' to value 'vaapi'
[format @ 0x7f8d58005640] Setting 'color_ranges' to value 'tv|pc'
[Parsed_hwupload_0 @ 0x7f8d58004280] Query format failed for 'Parsed_hwupload_0': Cannot allocate memory
[vf#0:0 @ 0x562c9191e980] Error reinitializing filters!
[vf#0:0 @ 0x562c9191e980] Task finished with error code: -12 (Cannot allocate memory)
[vf#0:0 @ 0x562c9191e980] Terminating thread with return code -12 (Cannot allocate memory)
[vost#0:0/h264_vaapi @ 0x562c9191c000] Encoder thread received EOF
[vost#0:0/h264_vaapi @ 0x562c9191c000] Could not open encoder before EOF
[vost#0:0/h264_vaapi @ 0x562c9191c000] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_vaapi @ 0x562c9191c000] Terminating thread with return code -22 (Invalid argument)
[vist#0:0/wrapped_avframe @ 0x562c917a3400] [dec:wrapped_avframe @ 0x562c91920140] Decoder returned EOF, finishing
[vist#0:0/wrapped_avframe @ 0x562c917a3400] [dec:wrapped_avframe @ 0x562c91920140] Terminating thread with return code 0 (success)
[vist#0:0/wrapped_avframe @ 0x562c917a3400] All consumers of this stream are done
[in#0/lavfi @ 0x562c91915040] All consumers are done
[in#0/lavfi @ 0x562c91915040] Terminating thread with return code 0 (success)
[out#0/mp4 @ 0x562c9191b780] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
[AVIOContext @ 0x562c91921700] Statistics: 0 bytes written, 0 seeks, 0 writeouts
[in#0/lavfi @ 0x562c91915040] Input file #0 (testsrc=s=1280x720:r=30:d=5):
[in#0/lavfi @ 0x562c91915040] Input stream #0:0 (video): 3 packets read (1320 bytes); 2 frames decoded; 0 decode errors;
[in#0/lavfi @ 0x562c91915040] Total: 3 packets (1320 bytes) demuxed
Conversion failed!
Change History (5)
comment:2 by , 17 months ago
Having tried both of these I can confirm neither worked. Added some more logs if helpeful.
--- FFmpeg Command Attempts Log ---
Generated on: Mon 2 Jun 22:51:33 BST 2025
--- Attempt 1: hwupload=derive_device=vaapi (Synthetic Input) ---
Command: ffmpeg -v debug -init_hw_device vaapi=va:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_device va -hwaccel_output_format vaapi -f lavfi -i testsrc=s=1280x720:r=30:d=5 -map 0:v:0 -vf 'hwdownload,format=nv12,hwupload=derive_device=vaapi' -c:v h264_vaapi -qp 24 -y output_synthetic_vaapi.mp4
ffmpeg version n7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 15.1.1 (GCC) 20250425
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'vaapi=va:/dev/dri/renderD128'.
Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'vaapi'.
Reading option '-hwaccel_device' ... matched as option 'hwaccel_device' (select a device for HW acceleration) with argument 'va'.
Reading option '-hwaccel_output_format' ... matched as option 'hwaccel_output_format' (select output format used with HW accelerated decoding) with argument 'vaapi'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'lavfi'.
Reading option '-i' ... matched as input url with argument 'testsrc=s=1280x720:r=30:d=5'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:v:0'.
Reading option '-vf' ... matched as option 'vf' (alias for -filter:v (apply filters to video streams)) with argument 'hwdownload,format=nv12,hwupload=derive_device=vaapi'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder ('copy' to copy stream without reencoding)) with argument 'h264_vaapi'.
Reading option '-qp' ... matched as AVOption 'qp' with argument '24'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'output_synthetic_vaapi.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Applying option init_hw_device (initialise hardware device) with argument vaapi=va:/dev/dri/renderD128.
[AVHWDeviceContext @ 0x5625d027c800] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x5625d027c800] libva: Trying to open /usr/lib/dri/radeonsi_drv_video.so
[AVHWDeviceContext @ 0x5625d027c800] libva: Found init function vaDriverInit_1_22
[AVHWDeviceContext @ 0x5625d027c800] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x5625d027c800] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x5625d027c800] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x32313050 -> p012le.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x36313050 -> unknown.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x56595559 -> unknown.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x30303859 -> gray.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x50343434 -> yuv444p.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x56323234 -> yuv440p.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x50424752 -> unknown.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x42475241 -> argb.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x30335241 -> unknown.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x30334241 -> unknown.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x30335258 -> x2rgb10le.
[AVHWDeviceContext @ 0x5625d027c800] Format 0x30334258 -> unknown.
[AVHWDeviceContext @ 0x5625d027c800] VAAPI driver: Mesa Gallium driver 25.1.1-arch1.2 for AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 19.1.7, DRM 3.61, 6.14.9-arch1-1).
[AVHWDeviceContext @ 0x5625d027c800] Driver not found in known nonstandard list, using standard behaviour.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url testsrc=s=1280x720:r=30:d=5.
Applying option hwaccel (use HW accelerated decoding) with argument vaapi.
Applying option hwaccel_device (select a device for HW acceleration) with argument va.
Applying option hwaccel_output_format (select output format used with HW accelerated decoding) with argument vaapi.
Applying option f (force container format (auto-detected otherwise)) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: testsrc=s=1280x720:r=30:d=5.
[AVFilterGraph @ 0x5625d0487100] Setting 's' to value '1280x720'
[AVFilterGraph @ 0x5625d0487100] Setting 'r' to value '30'
[AVFilterGraph @ 0x5625d0487100] Setting 'd' to value '5'
detected 16 logical cores
[Parsed_testsrc_0 @ 0x5625d048a200] size:1280x720 rate:30/1 duration:5.000000 sar:1/1
[AVFilterGraph @ 0x5625d0487100] query_formats: 2 queried, 3 merged, 0 already done, 0 delayed
[lavfi @ 0x5625d0486bc0] All info found
Input #0, lavfi, from 'testsrc=s=1280x720:r=30:d=5':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0, 1, 1/30: Video: wrapped_avframe, 1 reference frame, rgb24, 1280x720 [SAR 1:1 DAR 16:9], 0/1, 30 fps, 30 tbr, 30 tbn
Successfully opened the file.
Parsing a group of options: output url output_synthetic_vaapi.mp4.
Applying option map (set input stream mapping) with argument 0:v:0.
Applying option vf (alias for -filter:v (apply filters to video streams)) with argument hwdownload,format=nv12,hwupload=derive_device=vaapi.
Applying option c:v (select encoder/decoder ('copy' to copy stream without reencoding)) with argument h264_vaapi.
Successfully parsed a group of options.
Opening an output file: output_synthetic_vaapi.mp4.
[out#0/mp4 @ 0x5625d048c9c0] Adding streams from explicit maps...
[vost#0:0/h264_vaapi @ 0x5625d048d240] Created video stream from input stream 0:0
[AVFilterGraph @ 0x5625d048fbc0] Setting 'pix_fmts' to value 'nv12'
[AVFilterGraph @ 0x5625d048fbc0] Setting 'derive_device' to value 'vaapi'
[file @ 0x5625d0492ac0] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_vaapi))
[vost#0:0/h264_vaapi @ 0x5625d048d240] Starting thread...
[vf#0:0 @ 0x5625d048fb00] Starting thread...
[vist#0:0/wrapped_avframe @ 0x5625d0316040] [dec:wrapped_avframe @ 0x5625d0491700] Starting thread...
[in#0/lavfi @ 0x5625d0486400] Starting thread...
Press [q] to stop, ? for help
[AVFilterGraph @ 0x7f6ee0001000] Setting 'pix_fmts' to value 'nv12'
[AVFilterGraph @ 0x7f6ee0001000] Setting 'derive_device' to value 'vaapi'
[graph -1 input from stream 0:0 @ 0x7f6ee0004e00] Setting 'video_size' to value '1280x720'
[graph -1 input from stream 0:0 @ 0x7f6ee0004e00] Setting 'pix_fmt' to value '2'
[graph -1 input from stream 0:0 @ 0x7f6ee0004e00] Setting 'time_base' to value '1/30'
[graph -1 input from stream 0:0 @ 0x7f6ee0004e00] Setting 'pixel_aspect' to value '1/1'
[graph -1 input from stream 0:0 @ 0x7f6ee0004e00] Setting 'colorspace' to value '0'
[graph -1 input from stream 0:0 @ 0x7f6ee0004e00] Setting 'range' to value '2'
[graph -1 input from stream 0:0 @ 0x7f6ee0004e00] Setting 'frame_rate' to value '30/1'
[graph -1 input from stream 0:0 @ 0x7f6ee0004e00] w:1280 h:720 pixfmt:rgb24 tb:1/30 fr:30/1 sar:1/1 csp:gbr range:pc
[format @ 0x7f6ee0005900] Setting 'pix_fmts' to value 'vaapi'
[format @ 0x7f6ee0005900] Setting 'color_ranges' to value 'tv|pc'
[auto_scale_0 @ 0x7f6ee0007540] w:iw h:ih flags: interl:0
[Parsed_hwdownload_0 @ 0x7f6ee00042c0] auto-inserting filter 'auto_scale_0' between the filter 'graph -1 input from stream 0:0' and the filter 'Parsed_hwdownload_0'
Impossible to convert between the formats supported by the filter 'graph -1 input from stream 0:0' and the filter 'auto_scale_0'
[vf#0:0 @ 0x5625d048fb00] Error reinitializing filters!
[vf#0:0 @ 0x5625d048fb00] Task finished with error code: -38 (Function not implemented)
[vf#0:0 @ 0x5625d048fb00] Terminating thread with return code -38 (Function not implemented)
[vost#0:0/h264_vaapi @ 0x5625d048d240] Encoder thread received EOF
[vost#0:0/h264_vaapi @ 0x5625d048d240] Could not open encoder before EOF
[vost#0:0/h264_vaapi @ 0x5625d048d240] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_vaapi @ 0x5625d048d240] Terminating thread with return code -22 (Invalid argument)
[vist#0:0/wrapped_avframe @ 0x5625d0316040] [dec:wrapped_avframe @ 0x5625d0491700] Decoder returned EOF, finishing
[vist#0:0/wrapped_avframe @ 0x5625d0316040] [dec:wrapped_avframe @ 0x5625d0491700] Terminating thread with return code 0 (success)
[vist#0:0/wrapped_avframe @ 0x5625d0316040] All consumers of this stream are done
[in#0/lavfi @ 0x5625d0486400] All consumers are done
[in#0/lavfi @ 0x5625d0486400] Terminating thread with return code 0 (success)
[out#0/mp4 @ 0x5625d048c9c0] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
[AVIOContext @ 0x5625d0492c00] Statistics: 0 bytes written, 0 seeks, 0 writeouts
[in#0/lavfi @ 0x5625d0486400] Input file #0 (testsrc=s=1280x720:r=30:d=5):
[in#0/lavfi @ 0x5625d0486400] Input stream #0:0 (video): 3 packets read (1320 bytes); 2 frames decoded; 0 decode errors;
[in#0/lavfi @ 0x5625d0486400] Total: 3 packets (1320 bytes) demuxed
Conversion failed!
--- Attempt 2: hwupload (without derive_device) (Synthetic Input) ---
Command: ffmpeg -v debug -init_hw_device vaapi=va:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_device va -hwaccel_output_format vaapi -f lavfi -i testsrc=s=1280x720:r=30:d=5 -map 0:v:0 -vf 'hwdownload,format=nv12,hwupload' -c:v h264_vaapi -qp 24 -y output_synthetic_no_derive.mp4
ffmpeg version n7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 15.1.1 (GCC) 20250425
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.101 / 61. 19.101
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-init_hw_device' ... matched as option 'init_hw_device' (initialise hardware device) with argument 'vaapi=va:/dev/dri/renderD128'.
Reading option '-hwaccel' ... matched as option 'hwaccel' (use HW accelerated decoding) with argument 'vaapi'.
Reading option '-hwaccel_device' ... matched as option 'hwaccel_device' (select a device for HW acceleration) with argument 'va'.
Reading option '-hwaccel_output_format' ... matched as option 'hwaccel_output_format' (select output format used with HW accelerated decoding) with argument 'vaapi'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'lavfi'.
Reading option '-i' ... matched as input url with argument 'testsrc=s=1280x720:r=30:d=5'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:v:0'.
Reading option '-vf' ... matched as option 'vf' (alias for -filter:v (apply filters to video streams)) with argument 'hwdownload,format=nv12,hwupload'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder ('copy' to copy stream without reencoding)) with argument 'h264_vaapi'.
Reading option '-qp' ... matched as AVOption 'qp' with argument '24'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'output_synthetic_no_derive.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Applying option init_hw_device (initialise hardware device) with argument vaapi=va:/dev/dri/renderD128.
[AVHWDeviceContext @ 0x5652c9de8800] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x5652c9de8800] libva: Trying to open /usr/lib/dri/radeonsi_drv_video.so
[AVHWDeviceContext @ 0x5652c9de8800] libva: Found init function vaDriverInit_1_22
[AVHWDeviceContext @ 0x5652c9de8800] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x5652c9de8800] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x32313050 -> p012le.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x36313050 -> unknown.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x56595559 -> unknown.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x30303859 -> gray.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x50343434 -> yuv444p.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x56323234 -> yuv440p.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x50424752 -> unknown.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x42475241 -> argb.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x30335241 -> unknown.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x30334241 -> unknown.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x30335258 -> x2rgb10le.
[AVHWDeviceContext @ 0x5652c9de8800] Format 0x30334258 -> unknown.
[AVHWDeviceContext @ 0x5652c9de8800] VAAPI driver: Mesa Gallium driver 25.1.1-arch1.2 for AMD Radeon RX 7900 XT (radeonsi, navi31, LLVM 19.1.7, DRM 3.61, 6.14.9-arch1-1).
[AVHWDeviceContext @ 0x5652c9de8800] Driver not found in known nonstandard list, using standard behaviour.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url testsrc=s=1280x720:r=30:d=5.
Applying option hwaccel (use HW accelerated decoding) with argument vaapi.
Applying option hwaccel_device (select a device for HW acceleration) with argument va.
Applying option hwaccel_output_format (select output format used with HW accelerated decoding) with argument vaapi.
Applying option f (force container format (auto-detected otherwise)) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: testsrc=s=1280x720:r=30:d=5.
[AVFilterGraph @ 0x5652c9ff2bc0] Setting 's' to value '1280x720'
[AVFilterGraph @ 0x5652c9ff2bc0] Setting 'r' to value '30'
[AVFilterGraph @ 0x5652c9ff2bc0] Setting 'd' to value '5'
detected 16 logical cores
[Parsed_testsrc_0 @ 0x5652c9ff5d00] size:1280x720 rate:30/1 duration:5.000000 sar:1/1
[AVFilterGraph @ 0x5652c9ff2bc0] query_formats: 2 queried, 3 merged, 0 already done, 0 delayed
[lavfi @ 0x5652c9ff2680] All info found
Input #0, lavfi, from 'testsrc=s=1280x720:r=30:d=5':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0, 1, 1/30: Video: wrapped_avframe, 1 reference frame, rgb24, 1280x720 [SAR 1:1 DAR 16:9], 0/1, 30 fps, 30 tbr, 30 tbn
Successfully opened the file.
Parsing a group of options: output url output_synthetic_no_derive.mp4.
Applying option map (set input stream mapping) with argument 0:v:0.
Applying option vf (alias for -filter:v (apply filters to video streams)) with argument hwdownload,format=nv12,hwupload.
Applying option c:v (select encoder/decoder ('copy' to copy stream without reencoding)) with argument h264_vaapi.
Successfully parsed a group of options.
Opening an output file: output_synthetic_no_derive.mp4.
[out#0/mp4 @ 0x5652c9ff8340] Adding streams from explicit maps...
[vost#0:0/h264_vaapi @ 0x5652c9ff8bc0] Created video stream from input stream 0:0
[AVFilterGraph @ 0x5652c9ffb600] Setting 'pix_fmts' to value 'nv12'
[file @ 0x5652c9ffe540] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_vaapi))
[vost#0:0/h264_vaapi @ 0x5652c9ff8bc0] Starting thread...
[vf#0:0 @ 0x5652c9ffb540] Starting thread...
[vist#0:0/wrapped_avframe @ 0x5652c9e80480] [dec:wrapped_avframe @ 0x5652c9ffd0c0] Starting thread...
[in#0/lavfi @ 0x5652c9ff1ec0] Starting thread...
Press [q] to stop, ? for help
[AVFilterGraph @ 0x7ff834001000] Setting 'pix_fmts' to value 'nv12'
[graph -1 input from stream 0:0 @ 0x7ff834004dc0] Setting 'video_size' to value '1280x720'
[graph -1 input from stream 0:0 @ 0x7ff834004dc0] Setting 'pix_fmt' to value '2'
[graph -1 input from stream 0:0 @ 0x7ff834004dc0] Setting 'time_base' to value '1/30'
[graph -1 input from stream 0:0 @ 0x7ff834004dc0] Setting 'pixel_aspect' to value '1/1'
[graph -1 input from stream 0:0 @ 0x7ff834004dc0] Setting 'colorspace' to value '0'
[graph -1 input from stream 0:0 @ 0x7ff834004dc0] Setting 'range' to value '2'
[graph -1 input from stream 0:0 @ 0x7ff834004dc0] Setting 'frame_rate' to value '30/1'
[graph -1 input from stream 0:0 @ 0x7ff834004dc0] w:1280 h:720 pixfmt:rgb24 tb:1/30 fr:30/1 sar:1/1 csp:gbr range:pc
[format @ 0x7ff834005840] Setting 'pix_fmts' to value 'vaapi'
[format @ 0x7ff834005840] Setting 'color_ranges' to value 'tv|pc'
[auto_scale_0 @ 0x7ff834007580] w:iw h:ih flags: interl:0
[Parsed_hwdownload_0 @ 0x7ff8340041c0] auto-inserting filter 'auto_scale_0' between the filter 'graph -1 input from stream 0:0' and the filter 'Parsed_hwdownload_0'
Impossible to convert between the formats supported by the filter 'graph -1 input from stream 0:0' and the filter 'auto_scale_0'
[vf#0:0 @ 0x5652c9ffb540] Error reinitializing filters!
[vf#0:0 @ 0x5652c9ffb540] Task finished with error code: -38 (Function not implemented)
[vf#0:0 @ 0x5652c9ffb540] Terminating thread with return code -38 (Function not implemented)
[vost#0:0/h264_vaapi @ 0x5652c9ff8bc0] Encoder thread received EOF
[vost#0:0/h264_vaapi @ 0x5652c9ff8bc0] Could not open encoder before EOF
[vost#0:0/h264_vaapi @ 0x5652c9ff8bc0] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_vaapi @ 0x5652c9ff8bc0] Terminating thread with return code -22 (Invalid argument)
[vist#0:0/wrapped_avframe @ 0x5652c9e80480] [dec:wrapped_avframe @ 0x5652c9ffd0c0] Decoder returned EOF, finishing
[vist#0:0/wrapped_avframe @ 0x5652c9e80480] [dec:wrapped_avframe @ 0x5652c9ffd0c0] Terminating thread with return code 0 (success)
[vist#0:0/wrapped_avframe @ 0x5652c9e80480] All consumers of this stream are done
[in#0/lavfi @ 0x5652c9ff1ec0] All consumers are done
[in#0/lavfi @ 0x5652c9ff1ec0] Terminating thread with return code 0 (success)
[out#0/mp4 @ 0x5652c9ff8340] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
[AVIOContext @ 0x5652c9ffe600] Statistics: 0 bytes written, 0 seeks, 0 writeouts
[in#0/lavfi @ 0x5652c9ff1ec0] Input file #0 (testsrc=s=1280x720:r=30:d=5):
[in#0/lavfi @ 0x5652c9ff1ec0] Input stream #0:0 (video): 3 packets read (1320 bytes); 2 frames decoded; 0 decode errors;
[in#0/lavfi @ 0x5652c9ff1ec0] Total: 3 packets (1320 bytes) demuxed
Conversion failed!
--- End of Log ---
Log file generated: ffmpeg_command_attempts_20250602_225133.log
Please review the log file for any sensitive information before sharing.
comment:3 by , 17 months ago
The input of hwdownload must be hardware frames. However, testsrc always generates software frames, and hwaccel will not work here. Therefore, pipeline negotiation fails.
comment:4 by , 17 months ago
This resolved my issue, thanks! I assume the ticket must be rejected/closed by an admin?



hwupload=derive_device=va:
vais not a supported hardware device type. Change it tovaapior simply remove the=derive_device=va.