[FFmpeg-devel] [PATCH 6/6] ffv1enc_vulkan: switch to receive_packet

Jerome Martinez jerome at mediaarea.net
Sun Nov 24 00:10:15 EET 2024


Le 23/11/2024 à 20:58, Lynne via ffmpeg-devel a écrit :
> This allows the encoder to fully saturate all queues the GPU
> has, giving a good 10% in certain cases and resolutions.


Using a RTX 4070:
+50% (!!!) with 2K 10-bit content.
+17% with 4K 16-bit content.
Also the speed with 2K content is now 4x the speed of 4K content which 
is similar to the SW encoder (with similar count of slices) and which is 
the expected result, it seems that a bottleneck with smaller resolutions 
is removed.


Unfortunatly, it has a drawback, a 6K5K content which was well handled 
without this patch is now having an immediate error:
[vost#0:0/ffv1_vulkan @ 0x10467840] [enc:ffv1_vulkan @ 0x12c011c0] Error 
submitting video frame to the encoder
[vost#0:0/ffv1_vulkan @ 0x10467840] [enc:ffv1_vulkan @ 0x12c011c0] Error 
encoding a frame: Cannot allocate memory
[vost#0:0/ffv1_vulkan @ 0x10467840] Task finished with error code: -12 
(Cannot allocate memory)
[vost#0:0/ffv1_vulkan @ 0x10467840] Terminating thread with return code 
-12 (Cannot allocate memory)

Which is a problem, the handling of 6K5K being good on the RTX 4070 (3x 
faster than a CPU at the same price) before this patch.
Is it possible to keep the handling of bigger resolutions on such card 
while keeping the performance boost of this patch?


> This also improves error resilience if an allocation fails,
> and properly cleans up after itself if it does.

Looks like that this part does not work, still a freeze if an allocation 
fails.


More information about the ffmpeg-devel mailing list