Am 02.12.25 um 15:10 schrieb Terje J. Hanssen via ffmpeg-user:
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

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

[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]

I had similar problems with OpenSuse + ffmpeg, with e.g.: Ubuntu-Mate + ffmpeg 8.0 (compiled by me) no problems. I did use driver, provided by AMD, perhaps there are also provided driver by Intel for linux systems.

Richard


_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to