вт, 2 дек. 2025 г., 22:45 Terje J. Hanssen <[email protected]>:
> > > Den 02.12.2025 15:48, skrev Andrew Randrianasulu: > > On Tue, Dec 2, 2025 at 5:11 PM Terje J. Hanssen via > ffmpeg-user<[email protected]> <[email protected]> wrote: > > Hello list members > > Any ideas and suggestions to how to get ffmpeg vulkan video transcoding > to work? > All my attempts so far are unsuccessful and finish with Conversion failed! > Below is one code line with verbose output. > > Terje J. Hanssen > > -------- > > My system and hardware > Kernel: 6.12.59-1-longterm arch: x86_64 bits: 64 > Desktop: GNOME v: 49.1 Distro: openSUSE Tumbleweed-Slowroll 20251106 > Graphics: Device-1: Intel DG2 [Arc A750] driver: i915 v: kernel > > with > Vulkan v. 25.2.6, Mesa v. 25.2.6 and system ffmpeg-8 v. 8.0 (from Packman) > > I can verify the following ffmpeg Vulkan video support: > > ffmpeg -hide_banner -encoders | grep vulkan > V....D av1_vulkan AV1 (Vulkan) (codec av1) > V....D ffv1_vulkan FFmpeg video codec #1 (Vulkan) (codec ffv1) > V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) > V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc) > > And by enabling both Vulkan video decode and encode support in the ANV > driver via the following environment variable > > export ANV_DEBUG="video-decode,video-encode" > > I can verify the following Vulkan Video Encode support: > > vulkaninfo | grep -i encode > VK_KHR_video_encode_h264 : extension revision 14 > VK_KHR_video_encode_h265 : extension revision 14 > VK_KHR_video_encode_queue : extension revision 12 > queueFlags = QUEUE_VIDEO_DECODE_BIT_KHR | > QUEUE_VIDEO_ENCODE_BIT_KHR > VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_KHR > VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_KHR > > -------- > > ffmpeg -hide_banner -v verbose -init_hw_device "vulkan=vk:0" -hwaccel > vulkan -hwaccel_output_format vulkan -i hdv09_04.m2t -c:v h264_vulkan -y > hdv09_04_h264_vulkan.mp4 > > I *suspect* mpeg2 decoding is not supported by Vulkan video ? Unless > someone reesurrect Mesa shaders that used to work at some point as > vulkan compute shaders ? > > Try different (h264, h265, vp9, av1) input file ? > > > What I can tell is that ffmpeg vulkan decoding benchmarks using mpeg2 > seemingly has worked better for a long time according to > https://trac.ffmpeg.org/wiki/HWAccelIntro#Vulkan > > ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan > -hwaccel_output_format vulkan -i hdv09_04.m2t -f null - -benchmark > .........snip > [mpegts @ 0x563c726901c0] PES packet size mismatch.88 bitrate=N/A speed= > 145x elapsed=0:00:01.50 > [mpegts @ 0x563c726901c0] Packet corrupt (stream = 1, dts = 258142320). > [mpeg2video @ 0x563c72653500] ac-tex damaged at 10 61 > [mpeg2video @ 0x563c72653500] Warning MVs not available > [mpeg2video @ 0x563c72653500] concealing 630 DC, 630 AC, 630 MV errors in > P frame > [vist#0:0/mpeg2video @ 0x563c726e3b00] [dec:mpeg2video @ 0x563c726d4e40] > corrupt decoded frame > [out#0/null @ 0x563c726d5140] video:2422KiB audio:44770KiB subtitle:0KiB > other streams:0KiB global headers:0KiB muxing overhead: unknown > frame= 5963 fps=3635 q=-0.0 Lsize=N/A time=00:03:58.77 bitrate=N/A speed= > 146x elapsed=0:00:01.64 > bench: utime=19.196s stime=0.323s rtime=1.641s > bench: maxrss=185604KiB > Strange, may be some software decoding fallback patch now gets broken in ffmpeg? URL dies not list MPEG2 as Vulkan decodeable ... Do you have older ffmpeg (7.0, 7.1) around? > > ------ > > I have tried some other input files, here one mp4 that doesn't have the > same errors, but also terminate with Conversion failed! > > ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan > -hwaccel_output_format vulkan -i > mp4-example-video-download-full-hd-1920x1080.mp4 -c:v h264_vulkan -y > mp4-example-video-download-full-hd-1920x1080_h264_vulkan.mp4 > ..........snip > [h264_vulkan @ 0x556fed400d40] Unable to perform query: > VK_ERROR_DEVICE_LOST!psed=0:00:01.00 > wow, never saw this one! I am afraid something in kernel driver or ANV driver was upset ... With less Intel developers around I am not sure if such error will be diagnosed quickly .... You probably can try mesa3d issue tracker, may be it will get some developer attention this way ... [h264_vulkan @ 0x556fed400d40] Output failed: -542398533. > [vost#0:0/h264_vulkan @ 0x556fed400ac0] [enc:h264_vulkan @ 0x556fed402240] > Error submitting video frame to the encoder > [vost#0:0/h264_vulkan @ 0x556fed400ac0] [enc:h264_vulkan @ 0x556fed402240] > Error encoding a frame: Generic error in an external library > [vost#0:0/h264_vulkan @ 0x556fed400ac0] Task finished with error code: > -542398533 (Generic error in an external library) > [vost#0:0/h264_vulkan @ 0x556fed400ac0] Terminating thread with return > code -542398533 (Generic error in an external library) > [h264 @ 0x556fed4ced40] [vk @ 0x7f117c046280] Unable to submit command > buffer: VK_ERROR_DEVICE_LOST > [h264 @ 0x556fed4c9400] hardware accelerator failed to decode picture > [h264 @ 0x556fed4ced40] [vk @ 0x7f117c046280] Unable to submit command > buffer: VK_ERROR_DEVICE_LOST > [h264 @ 0x556fee17bb40] hardware accelerator failed to decode picture > [out#0/mp4 @ 0x556fed3ff900] video:0KiB audio:36KiB subtitle:0KiB other > streams:0KiB global headers:0KiB muxing overhead: 2.718802% > frame= 0 fps=0.0 q=0.0 Lsize= 37KiB time=N/A bitrate=N/A speed=N/A > elapsed=0:00:01.33 > [aac @ 0x556feef206c0] Qavg: 168.210 > Conversion failed! > > > [Vulkan @ 0x561a5f3bfbc0] Supported layers: > [Vulkan @ 0x561a5f3bfbc0] VK_LAYER_MESA_device_select > [Vulkan @ 0x561a5f3bfbc0] VK_LAYER_MESA_overlay > [Vulkan @ 0x561a5f3bfbc0] VK_LAYER_KHRONOS_validation > [Vulkan @ 0x561a5f3bfbc0] GPU listing: > [Vulkan @ 0x561a5f3bfbc0] 0: Intel(R) Arc(tm) A750 Graphics (DG2) > (discrete) (0x56a1) > [Vulkan @ 0x561a5f3bfbc0] Device 0 selected: Intel(R) Arc(tm) A750 > Graphics (DG2) (discrete) (0x56a1) > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_push_descriptor > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_EXT_physical_device_drm > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_EXT_shader_atomic_float > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_cooperative_matrix > [Vulkan @ 0x561a5f3bfbc0] Using device extension > VK_KHR_shader_subgroup_rotate > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_shader_expect_assume > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_maintenance1 > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_maintenance2 > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_external_memory_fd > [Vulkan @ 0x561a5f3bfbc0] Using device extension > VK_EXT_external_memory_dma_buf > [Vulkan @ 0x561a5f3bfbc0] Using device extension > VK_EXT_image_drm_format_modifier > [Vulkan @ 0x561a5f3bfbc0] Using device extension > VK_KHR_external_semaphore_fd > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_EXT_external_memory_host > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_queue > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_encode_queue > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_decode_queue > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_encode_h264 > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_decode_h264 > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_encode_h265 > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_decode_h265 > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_decode_vp9 > [Vulkan @ 0x561a5f3bfbc0] Using device extension VK_KHR_video_decode_av1 > [Vulkan @ 0x561a5f3bfbc0] Queue families: > [Vulkan @ 0x561a5f3bfbc0] 0: graphics compute transfer sparse > (queues: 1) > [Vulkan @ 0x561a5f3bfbc0] 1: encode decode (queues: 2) > [Vulkan @ 0x561a5f3bfbc0] Using device: Intel(R) Arc(tm) A750 Graphics (DG2) > [Vulkan @ 0x561a5f3bfbc0] Alignments: > [Vulkan @ 0x561a5f3bfbc0] optimalBufferCopyRowPitchAlignment: 128 > [Vulkan @ 0x561a5f3bfbc0] minMemoryMapAlignment: 4096 > [Vulkan @ 0x561a5f3bfbc0] nonCoherentAtomSize: 64 > [Vulkan @ 0x561a5f3bfbc0] minImportedHostPointerAlignment: 4096 > [Vulkan @ 0x561a5f3bfbc0] Using queue family 0 (queues: 1) for graphics > compute transfers > [Vulkan @ 0x561a5f3bfbc0] Using queue family 1 (queues: 2) for encode decode > [mpegts @ 0x561a5f45ba80] parser not found for codec none, packets or > times may be invalid. > Last message repeated 3 times > [mpeg2video @ 0x561a5f3d3b40] Invalid frame dimensions 0x0. > Last message repeated 3 times > [mpegts @ 0x561a5f45ba80] PES packet size mismatch > [mpegts @ 0x561a5f45ba80] Packet corrupt (stream = 1, dts = 258142320). > [mpegts @ 0x561a5f45ba80] Could not find codec parameters for stream 2 > (Unknown: none ([160][0][0][0] / 0x00A0)): unknown codec > Consider increasing the value for the 'analyzeduration' (0) and > 'probesize' (5000000) options > [mpegts @ 0x561a5f45ba80] Could not find codec parameters for stream 3 > (Unknown: none ([161][0][0][0] / 0x00A1)): unknown codec > Consider increasing the value for the 'analyzeduration' (0) and > 'probesize' (5000000) options > > Input #0, mpegts, from 'hdv09_04.m2t': > Duration: 00:03:59.06, start: 2629.496000, bitrate: 26110 kb/s > Program 100 > Stream #0:0[0x810]: Video: mpeg2video (Main), 1 reference frame > ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first, left), 1440x1080 > [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn, start 2629.680000 > Side data: > cpb: bitrate max/min/avg: 25000000/0/0 buffer size: 7340032 > vbv_delay: N/A > Stream #0:1[0x814]: Audio: mp2 (mp3float) ([3][0][0][0] / 0x0003), > 48000 Hz, stereo, fltp, 384 kb/s, start 2629.496000 > Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0), start > 2629.496000 > Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1), start > 2629.496000 > > [out#0/mp4 @ 0x561a60195240] No explicit maps, mapping streams > automatically... > [vost#0:0/h264_vulkan @ 0x561a5f41fec0] Created video stream from input > stream 0:0 > [aost#0:1/aac @ 0x561a5f4ac2c0] Created audio stream from input stream 0:1 > Stream mapping: > Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_vulkan)) > Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) > [vost#0:0/h264_vulkan @ 0x561a5f41fec0] Starting thread... > [aost#0:1/aac @ 0x561a5f4ac2c0] Starting thread... > [vf#0:0 @ 0x561a5f420500] Starting thread... > [af#0:1 @ 0x561a5f4ac900] Starting thread... > [vist#0:0/mpeg2video @ 0x561a5f4a0640] [dec:mpeg2video @ 0x561a5f4a5480] > Starting thread... > [aist#0:1/mp2 @ 0x561a5f4af380] [dec:mp2 @ 0x561a5f4add00] Starting > thread... > [in#0/mpegts @ 0x561a5f411e00] Starting thread... > Press [q] to stop, [?] for help > [graph_-1_in_0:1 @ 0x7f8cfc0043c0] tb:1/48000 samplefmt:s16p > samplerate:48000 chlayout:stereo > [format_out_#0:1 @ 0x7f8cfc004ec0] auto-inserting filter > 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter > 'format_out_#0:1' > [auto_aresample_0 @ 0x7f8cfc005c00] ch:2 chl:stereo fmt:s16p r:48000Hz > -> ch:2 chl:stereo fmt:fltp r:48000Hz > [graph -1 input from stream 0:0 @ 0x7f8cec004480] w:1440 h:1080 > pixfmt:yuv420p tb:1/90000 fr:25/1 sar:4/3 csp:bt709 range:tv > [auto_scale_0 @ 0x7f8cec005140] w:iw h:ih flags:'' interl:0 > [format @ 0x7f8cec004b00] auto-inserting filter 'auto_scale_0' between > the filter 'Parsed_null_0' and the filter 'format' > > Impossible to convert between the formats supported by the filter > 'Parsed_null_0' and the filter 'auto_scale_0' > Link 'Parsed_null_0.default' -> 'auto_scale_0.default': > src: yuv420p > dst: yuv420p > [vf#0:0 @ 0x561a5f420500] Error reinitializing filters! > [vf#0:0 @ 0x561a5f420500] Task finished with error code: -38 (Function > not implemented) > [vist#0:0/mpeg2video @ 0x561a5f4a0640] [dec:mpeg2video @ 0x561a5f4a5480] > Decoder returned EOF, finishing > [vist#0:0/mpeg2video @ 0x561a5f4a0640] [dec:mpeg2video @ 0x561a5f4a5480] > Terminating thread with return code 0 (success) > [vf#0:0 @ 0x561a5f420500] Terminating thread with return code -38 > (Function not implemented) > [in#0/mpegts @ 0x561a5f411e00] Terminating thread with return code 0 > (success) > [aist#0:1/mp2 @ 0x561a5f4af380] [dec:mp2 @ 0x561a5f4add00] Decoder > thread received EOF packet > [aist#0:1/mp2 @ 0x561a5f4af380] [dec:mp2 @ 0x561a5f4add00] Decoder > returned EOF, finishing > [aist#0:1/mp2 @ 0x561a5f4af380] [dec:mp2 @ 0x561a5f4add00] Terminating > thread with return code 0 (success) > [af#0:1 @ 0x561a5f4ac900] Filtergraph returned EOF, finishing > [af#0:1 @ 0x561a5f4ac900] All consumers returned EOF > [vost#0:0/h264_vulkan @ 0x561a5f41fec0] [enc:h264_vulkan @ > 0x561a5f4228c0] Encoder thread received EOF > [vost#0:0/h264_vulkan @ 0x561a5f41fec0] [enc:h264_vulkan @ > 0x561a5f4228c0] Could not open encoder before EOF > [vost#0:0/h264_vulkan @ 0x561a5f41fec0] Task finished with error code: > -22 (Invalid argument) > [vost#0:0/h264_vulkan @ 0x561a5f41fec0] Terminating thread with return > code -22 (Invalid argument) > [af#0:1 @ 0x561a5f4ac900] Terminating thread with return code 0 (success) > [aost#0:1/aac @ 0x561a5f4ac2c0] [enc:aac @ 0x561a5f41e1c0] Encoder > thread received EOF > [aost#0:1/aac @ 0x561a5f4ac2c0] Terminating thread with return code 0 > (success) > [out#0/mp4 @ 0x561a60195240] 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 elapsed=0:00:00.02 > [aac @ 0x561a5f4ac540] Qavg: 173.394 > [AVIOContext @ 0x561a601d55c0] Statistics: 0 bytes written, 0 seeks, 0 > writeouts > [in#0/mpegts @ 0x561a5f411e00] Input file #0 (hdv09_04.m2t): > [in#0/mpegts @ 0x561a5f411e00] Input stream #0:0 (video): 16 packets > read (1922470 bytes); 2 frames decoded; 0 decode errors; > [in#0/mpegts @ 0x561a5f411e00] Input stream #0:1 (audio): 29 packets > read (33408 bytes); 29 frames decoded; 0 decode errors (33408 samples); > [in#0/mpegts @ 0x561a5f411e00] Total: 45 packets (1955878 bytes) demuxed > [AVIOContext @ 0x561a5f45c040] Statistics: 8179856 bytes read, 3 seeks > Conversion failed! > > Exiting with exit code -38 > > > _______________________________________________ > ffmpeg-user mailing list -- [email protected] > To unsubscribe send an email to [email protected] > > > _______________________________________________ ffmpeg-user mailing list -- [email protected] To unsubscribe send an email to [email protected]
