@malcolmlewis
While -profile:v seemingly is said to be correct for current ffmpeg versions and -vprofile legacy, the ffmpeg-8 help for h264_vulkan say
ffmpeg -hide_banner -h encoder=h264_vulkan
....
-profile <int> E..V....... Set profile (profile_idc and constraint_set*_flag) (from -99 to 65535) (default -99)
constrained_baseline 578 E..V.......
main 77 E..V.......
high 100 E..V.......
high444p 110 E..V.......
I have tried all options; -profile main, -profile:v main, -vprofile main and w/o profile
1) SkyLake/i7/HD530/Nvidia machine
Vulkan works on Intel HD530 iGPU and fails on Nvidia dGPU, where nvenc works
vulkaninfo | egrep -i 'intel|nvidia'
GPU id = 0 (NVIDIA GeForce GTX 960)
GPU id = 1 (Intel(R) HD Graphics 530 (SKL GT2))
VK_LAYER_NV_optimus (NVIDIA Optimus layer) Vulkan version 1.4.312, layer version 1:
GPU id = 0 (NVIDIA GeForce GTX 960)
GPU id = 1 (Intel(R) HD Graphics 530 (SKL GT2))
VK_LAYER_NV_present (NVIDIA GR2608 layer) Vulkan version 1.4.312, layer version 1:
GPU id = 0 (NVIDIA GeForce GTX 960)
GPU id = 1 (Intel(R) HD Graphics 530 (SKL GT2))
GPU id : 0 (NVIDIA GeForce GTX 960) [VK_KHR_xcb_surface, VK_KHR_xlib_surface]:
GPU id : 1 (Intel(R) HD Graphics 530 (SKL GT2)) [VK_KHR_xcb_surface, VK_KHR_xlib_surface]:
GPU id : 0 (NVIDIA GeForce GTX 960) [VK_KHR_wayland_surface]:
GPU id : 1 (Intel(R) HD Graphics 530 (SKL GT2)) [VK_KHR_wayland_surface]:
deviceName = NVIDIA GeForce GTX 960
driverID = DRIVER_ID_NVIDIA_PROPRIETARY
driverName = NVIDIA
deviceName = Intel(R) HD Graphics 530 (SKL GT2)
driverID = DRIVER_ID_INTEL_OPEN_SOURCE_MESA
driverName = Intel open-source Mesa driver
VK_INTEL_shader_integer_functions2 : extension revision 1
ffmpeg -hide_banner -v verbose -init_hw_device "vulkan"
[Vulkan @ 0x562a48d46b80] Supported layers:
[Vulkan @ 0x562a48d46b80] VK_LAYER_MESA_device_select
[Vulkan @ 0x562a48d46b80] VK_LAYER_NV_optimus
[Vulkan @ 0x562a48d46b80] VK_LAYER_NV_present
[Vulkan @ 0x562a48d46b80] GPU listing:
[Vulkan @ 0x562a48d46b80] 0: NVIDIA GeForce GTX 960 (discrete) (0x1401)
[Vulkan @ 0x562a48d46b80] 1: Intel(R) HD Graphics 530 (SKL GT2) (integrated) (0x1912)
[Vulkan @ 0x562a48d46b80] 2: llvmpipe (LLVM 21.1.7, 256 bits) (software) (0x0)
[Vulkan @ 0x562a48d46b80] Device 0 selected: NVIDIA GeForce GTX 960 (discrete) (0x1401)
While this simpler codeline using h264_nvenc works and encodes a small output file of 1.4M
ffmpeg -hide_banner -hwaccel cuda -hwaccel_output_format cuda -i hdv1080i50.m2t -c:v h264_nvenc hdv1080i50_h264_nvenc.mp4
obviously something is missing that hinder access to Nvidia using vulkan !??
vk:0 Nvidia:
---------------
Tried -profile main, -profile:v main, -vprofile main and w/o profile, and ffmpeg error out on Nvidia with
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv1080i50.m2t -vf "format=nv12,hwupload" -c:v h264_vulkan -profile:v main -y hdv1080i50_h264_main_vulkan_nv12_vk0.mp4
..........
[h264_vulkan @ 0x55f0d3d9dbc0] Device does not support the VK_KHR_video_encode_queue extension!
[vost#0:0/h264_vulkan @ 0x55f0d3da0c80] [enc:h264_vulkan @ 0x55f0d3d8aa80] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0x55f0d3d9f400] Error sending frames to consumers: Function not implemented
[vf#0:0 @ 0x55f0d3d9f400] Task finished with error code: -38 (Function not implemented)
[vf#0:0 @ 0x55f0d3d9f400] Terminating thread with return code -38 (Function not implemented)
[vost#0:0/h264_vulkan @ 0x55f0d3da0c80] [enc:h264_vulkan @ 0x55f0d3d8aa80] Could not open encoder before EOF
[vost#0:0/h264_vulkan @ 0x55f0d3da0c80] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_vulkan @ 0x55f0d3da0c80] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 0x55f0d3d9b100] 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.04
[aac @ 0x55f0d3d87c00] Qavg: 175.195
Conversion failed!
export ANV_DEBUG="video-decode,video-encode"
vk:1 Intel HD530:
-----------------
Tried -profile main, -profile:v main, -vprofile main and w/o profile, and all works on Intel HD530
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv1080i50.m2t -vf "format=nv12,hwupload" -c:v h264_vulkan -profile main -y hdv1080i50_h264_main_vulkan_nv12_vk0.mp4
-----------
du -sh *.m2t *.mp4
16M hdv1080i50.m2t (interlaced mpeg2video input file)
20M hdv1080i50_h264_main_vulkan_nv12_vk1.mp4 (progressive ouput file, main profile)
1,4M hdv1080i50_h264_nvenc.mp4
17M hdv1080i50_h264_vulkan_nv12_vk1.mp4 (progressive output file, w/o profile)
2) Alder Lake/Intel Arc A750 (DG2) machine
Vulkan fails in all attempts. Do you get any of my code lines or other to work on your A380?
vulkaninfo | grep -i 'intel'
GPU id = 0 (Intel(R) Arc(tm) A750 Graphics (DG2))
GPU id : 0 (Intel(R) Arc(tm) A750 Graphics (DG2)) [VK_KHR_xcb_surface, VK_KHR_xlib_surface]:
GPU id : 0 (Intel(R) Arc(tm) A750 Graphics (DG2)) [VK_KHR_wayland_surface]:
deviceName = Intel(R) Arc(tm) A750 Graphics (DG2)
driverID = DRIVER_ID_INTEL_OPEN_SOURCE_MESA
driverName = Intel open-source Mesa driver
VK_INTEL_shader_integer_functions2 : extension revision 1
ffmpeg -hide_banner -v verbose -init_hw_device "vulkan"
[Vulkan @ 0x556afcc3ab80] Supported layers:
[Vulkan @ 0x556afcc3ab80] VK_LAYER_MESA_device_select
[Vulkan @ 0x556afcc3ab80] GPU listing:
[Vulkan @ 0x556afcc3ab80] 0: Intel(R) Arc(tm) A750 Graphics (DG2) (discrete) (0x56a1)
[Vulkan @ 0x556afcc3ab80] 1: llvmpipe (LLVM 21.1.7, 256 bits) (software) (0x0)
[Vulkan @ 0x556afcc3ab80] Device 0 selected: Intel(R) Arc(tm) A750 Graphics (DG2) (discrete) (0x56a1)
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_push_descriptor
[Vulkan @ 0x556afcc3ab80] Using device extension VK_EXT_physical_device_drm
[Vulkan @ 0x556afcc3ab80] Using device extension VK_EXT_shader_atomic_float
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_cooperative_matrix
[Vulkan @ 0x556afcc3ab80] Using device extension VK_EXT_shader_object
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_shader_subgroup_rotate
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_shader_expect_assume
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_maintenance1
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_maintenance2
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_external_memory_fd
[Vulkan @ 0x556afcc3ab80] Using device extension VK_EXT_external_memory_dma_buf
[Vulkan @ 0x556afcc3ab80] Using device extension VK_EXT_image_drm_format_modifier
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_external_semaphore_fd
[Vulkan @ 0x556afcc3ab80] Using device extension VK_EXT_external_memory_host
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_queue
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_encode_queue
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_decode_queue
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_encode_h264
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_decode_h264
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_encode_h265
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_decode_h265
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_decode_vp9
[Vulkan @ 0x556afcc3ab80] Using device extension VK_KHR_video_decode_av1
[Vulkan @ 0x556afcc3ab80] Queue families:
[Vulkan @ 0x556afcc3ab80] 0: graphics compute transfer sparse (queues: 1)
[Vulkan @ 0x556afcc3ab80] 1: encode decode (queues: 2)
[Vulkan @ 0x556afcc3ab80] Using device: Intel(R) Arc(tm) A750 Graphics (DG2)
[Vulkan @ 0x556afcc3ab80] Alignments:
[Vulkan @ 0x556afcc3ab80] optimalBufferCopyRowPitchAlignment: 128
[Vulkan @ 0x556afcc3ab80] minMemoryMapAlignment: 4096
[Vulkan @ 0x556afcc3ab80] nonCoherentAtomSize: 64
[Vulkan @ 0x556afcc3ab80] minImportedHostPointerAlignment: 4096
[Vulkan @ 0x556afcc3ab80] Using queue family 0 (queues: 1) for graphics compute transfers
[Vulkan @ 0x556afcc3ab80] Using queue family 1 (queues: 2) for encode decode
Universal media converter
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
I tried to add “-profile main” on Intel HD530, because the h264.mp4 output file was auto-encoded with High profile, and became not smaller (rather a little bit larger) than the mpeg2video input file with Main profile.
With No rate control settings specified, it uses fixed QP = 18
------
Tried -profile main, -profile:v main, -vprofile main and w/o profile, and ffmpeg error out on DG2 with
[h264_vulkan @ 0x5639fcd9ed80] Unable to perform query: VK_ERROR_DEVICE_LOST!psed=0:00:07.00
[h264_vulkan @ 0x5639fcd9ed80] Output failed: -542398533.
[vost#0:0/h264_vulkan @ 0x5639fcd9eb00] [enc:h264_vulkan @ 0x5639fcd493c0] Error submitting video frame to the encoder
[vost#0:0/h264_vulkan @ 0x5639fcd9eb00] [enc:h264_vulkan @ 0x5639fcd493c0] Error encoding a frame: Generic error in an external library
[vost#0:0/h264_vulkan @ 0x5639fcd9eb00] Task finished with error code: -542398533 (Generic error in an external library)
[vost#0:0/h264_vulkan @ 0x5639fcd9eb00] Terminating thread with return code -542398533 (Generic error in an external library)
Unable to submit command buffer: VK_ERROR_DEVICE_LOST
[hwupload @ 0x7f4f64004580] Failed to upload frame: -542398533.
[vf#0:0 @ 0x5639fcdda740] Error while filtering: Generic error in an external library
[vf#0:0 @ 0x5639fcdda740] Task finished with error code: -542398533 (Generic error in an external library)
[vf#0:0 @ 0x5639fcdda740] Terminating thread with return code -542398533 (Generic error in an external library)
[out#0/mp4 @ 0x5639fcd48e80] video:0KiB audio:21KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 5.062934%
frame= 0 fps=0.0 q=0.0 Lsize= 22KiB time=N/A bitrate=N/A speed=N/A elapsed=0:00:07.15
[aac @ 0x5639fcddbb00] Qavg: 181.433
Conversion failed!
==========