сб, 26 апр. 2025 г., 22:58 Andrew Randrianasulu <randrianasulu@gmail.com>:


сб, 26 апр. 2025 г., 22:48 Andrea paz <gamberucci.andrea@gmail.com>:
I re-did the test because I had not put in the environment variables.

RADV (AMD)  need different ones...


=====
The RDNA2 support remains off by default and there is no word from AMD yet when they may be providing updated firmware for the video events compatibility. Otherwise the support can be enabled via the RADV_PERFTEST=video_decode and RADV_PERFTEST=video_encode environment variables manually. 

====

but my hope was to see if libplacebo can be used with vaapi decode as noted in ffmpeg docs:

====
Interop with VAAPI hwdec to avoid round-tripping through RAM:
ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
=====

Decode seems to work, and together with libplacebo's tonemap and pulling frames back to sysmem I got 15 fps at full 4k!

RADV_PERFTEST=video_decode,video_encode time -p ./ffmpeg  -init_hw_device vulkan=vulkan -filter_hw_device vulkan   -hwaccel vulkan  -i ~/K38_sdcard1/Documents/iPhone11_4K-recorder_59.940HDR10.mov -vf  libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv -c:a copy -c:v rawvideo -f nut -benchmark /dev/null

frame= 1148 fps= 15 q=-0.0 Lsize=27900063KiB time=00:00:19.16 bitrate=11927607.4kbits/s speed=0.246x                                                                                                  
bench: utime=36.673s stime=64.718s rtime=77.794s                                                   
bench: maxrss=703552KiB                                                                            
real 79.39                                                                                         
user 36.77                                                                                         
sys 64.78                                                                                          




It seems to me that the result is similar:

export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json
export ANV_VIDEO_DECODE=1
export ANV_VIDEO_ENCODE=1

ffmpeg -init_hw_device vulkan=vk:0 -filter_hw_device vk -hwaccel vaapi
-hwaccel_output_format vaapi -i hdr_02.mp4 -vf
libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
-c:a copy -c:v hevc_vulkan -f avi  /dev/null
[...]
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hdr_02.mp4':
 Metadata:
   major_brand     : isom
   minor_version   : 512
   compatible_brands: isomiso2mp41
   creation_time   : 2017-06-04T23:05:26.000000Z
   encoder         : Lavf57.72.101
 Duration: 00:02:38.56, start: 0.000000, bitrate: 60142 kb/s
 Stream #0:0[0x1](und): Video: hevc (Main 10) (hev1 / 0x31766568),
yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DA
R 16:9], 60000 kb/s, 59.94 fps, 59.94 tbr, 90k tbn (default)
     Metadata:
       creation_time   : 2017-06-04T23:05:26.000000Z
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
 Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 125 kb/s (default)
     Metadata:
       creation_time   : 2017-06-04T23:05:26.000000Z
       handler_name    : SoundHandler
       vendor_id       : [0][0][0][0]
File '/dev/null' already exists. Overwrite? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (hevc (native) -> hevc (hevc_vulkan))
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[AVHWFramesContext @ 0x75ca2001aac0] Unsupported pixel format: vaapi!
[Parsed_libplacebo_0 @ 0x75ca20004600] Failed to configure output pad
on Parsed_libplacebo_0
[vf#0:0 @ 0x5b20b569c5c0] Error reinitializing filters!
[vf#0:0 @ 0x5b20b569c5c0] Task finished with error code: -22 (Invalid argument)
[vf#0:0 @ 0x5b20b569c5c0] Terminating thread with return code -22
(Invalid argument)
[vost#0:0/hevc_vulkan @ 0x5b20b56c5580] Could not open encoder before EOF
[vost#0:0/hevc_vulkan @ 0x5b20b56c5580] Task finished with error code:
-22 (Invalid argument)
[vost#0:0/hevc_vulkan @ 0x5b20b56c5580] Terminating thread with return
code -22 (Invalid argument)
[out#0/avi @ 0x5b20b55c3c80] 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
Conversion failed!