In August this year we had a thread "h264 vulkan encoding" initiated by Andrea https://lists.cinelerra-gg.org/pipermail/cin/2024-August/008517.html Mesa 24.3 is released with many Vulkan Driver Improvement, and implementations are expected around the corner in rolling distributions. Some articles about this in Phoronix https://www.phoronix.com/news/Mesa-24.3-Released https://www.phoronix.com/news/Mesa-24.3-rc2 https://www.phoronix.com/news/Mesa-24.3-rc1-Released https://www.phoronix.com/news/Intel-Vulkan-Video-H264-H265 With ffmpeg (7.1) h264/5 vulkan encoder support, I wonder if Cingg is ready to put them into use? ffmpeg -hide_banner -encoders | grep vulkan V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc)
чт, 28 нояб. 2024 г., 01:22 Terje J. Hanssen via Cin < [email protected]>:
In August this year we had a thread "h264 vulkan encoding" initiated by Andrea https://lists.cinelerra-gg.org/pipermail/cin/2024-August/008517.html
Mesa 24.3 is released with many Vulkan Driver Improvement, and implementations are expected around the corner in rolling distributions.
Some articles about this in Phoronix https://www.phoronix.com/news/Mesa-24.3-Released https://www.phoronix.com/news/Mesa-24.3-rc2 https://www.phoronix.com/news/Mesa-24.3-rc1-Released https://www.phoronix.com/news/Intel-Vulkan-Video-H264-H265
With ffmpeg (7.1) h264/5 vulkan encoder support, I wonder if Cingg is ready to put them into use?
ffmpeg -hide_banner -encoders | grep vulkan V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc)
you can try already (on system's ffmpeg), can't you?
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 27.11.2024 23:40, skrev Andrew Randrianasulu:
чт, 28 нояб. 2024 г., 01:22 Terje J. Hanssen via Cin <[email protected]>:
In August this year we had a thread "h264 vulkan encoding" initiated by Andrea https://lists.cinelerra-gg.org/pipermail/cin/2024-August/008517.html
Mesa 24.3 is released with many Vulkan Driver Improvement, and implementations are expected around the corner in rolling distributions.
Some articles about this in Phoronix https://www.phoronix.com/news/Mesa-24.3-Released https://www.phoronix.com/news/Mesa-24.3-rc2 https://www.phoronix.com/news/Mesa-24.3-rc1-Released https://www.phoronix.com/news/Intel-Vulkan-Video-H264-H265
With ffmpeg (7.1) h264/5 vulkan encoder support, I wonder if Cingg is ready to put them into use?
ffmpeg -hide_banner -encoders | grep vulkan V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc)
you can try already (on system's ffmpeg), can't you?
Not Mesa 24.3 and vulkan encoding quite yet: API: OpenGL v: 4.6 vendor: intel mesa v: 24.2.7 renderer: Mesa Intel Arc A750 Graphics (DG2) API: Vulkan v: 1.3.296 drivers: N/A surfaces: xcb,xlib API: EGL Message: EGL data requires eglinfo. Check --recommends. # export ANV_VIDEO_DECODE=1 # vulkaninfo | grep VK_KHR_video VK_KHR_video_decode_h264 : extension revision 9 VK_KHR_video_decode_h265 : extension revision 8 VK_KHR_video_decode_queue : extension revision 8 VK_KHR_video_queue So assume the FFmpeg benchmarks sample was vulkan decoding only, as they work for hdv (mpeg2) input also: ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04.m2t -f null - -benchmark frame= 5963 fps=3503 q=-0.0 Lsize=N/A time=00:03:58.77 bitrate=N/A speed= 140x bench: utime=19.045s stime=0.313s rtime=1.702s ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_h264_qsv.mp4 -f null - -benchmark frame= 5969 fps=988 q=-0.0 Lsize=N/A time=00:03:58.76 bitrate=N/A speed=39.5x bench: utime=1.397s stime=1.390s rtime=6.042s bench: maxrss=164700KiB fmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_hevc_qsv_8b420.mp4 -f null - -benchmark frame= 248 fps=2.0 q=-0.0 size=N/A time=00:00:09.92 bitrate=N/A speed=0.0787x hevc terrible slow !!
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 28.11.2024 00:00, skrev Terje J. Hanssen:
Den 27.11.2024 23:40, skrev Andrew Randrianasulu:
чт, 28 нояб. 2024 г., 01:22 Terje J. Hanssen via Cin <[email protected]>:
In August this year we had a thread "h264 vulkan encoding" initiated by Andrea https://lists.cinelerra-gg.org/pipermail/cin/2024-August/008517.html
Mesa 24.3 is released with many Vulkan Driver Improvement, and implementations are expected around the corner in rolling distributions.
Some articles about this in Phoronix https://www.phoronix.com/news/Mesa-24.3-Released https://www.phoronix.com/news/Mesa-24.3-rc2 https://www.phoronix.com/news/Mesa-24.3-rc1-Released https://www.phoronix.com/news/Intel-Vulkan-Video-H264-H265
With ffmpeg (7.1) h264/5 vulkan encoder support, I wonder if Cingg is ready to put them into use?
ffmpeg -hide_banner -encoders | grep vulkan V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc)
you can try already (on system's ffmpeg), can't you?
Not Mesa 24.3 and vulkan encoding quite yet:
API: OpenGL v: 4.6 vendor: intel mesa v: 24.2.7 renderer: Mesa Intel Arc A750 Graphics (DG2) API: Vulkan v: 1.3.296 drivers: N/A surfaces: xcb,xlib API: EGL Message: EGL data requires eglinfo. Check --recommends.
# export ANV_VIDEO_DECODE=1
# vulkaninfo | grep VK_KHR_video VK_KHR_video_decode_h264 : extension revision 9 VK_KHR_video_decode_h265 : extension revision 8 VK_KHR_video_decode_queue : extension revision 8 VK_KHR_video_queue
So assume the FFmpeg benchmarks sample was vulkan decoding only, as they work for hdv (mpeg2) input also:
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04.m2t -f null - -benchmark frame= 5963 fps=3503 q=-0.0 Lsize=N/A time=00:03:58.77 bitrate=N/A speed= 140x bench: utime=19.045s stime=0.313s rtime=1.702s
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_h264_qsv.mp4 -f null - -benchmark frame= 5969 fps=988 q=-0.0 Lsize=N/A time=00:03:58.76 bitrate=N/A speed=39.5x bench: utime=1.397s stime=1.390s rtime=6.042s bench: maxrss=164700KiB
fmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_hevc_qsv_8b420.mp4 -f null - -benchmark frame= 248 fps=2.0 q=-0.0 size=N/A time=00:00:09.92 bitrate=N/A speed=0.0787x hevc terrible slow !!
And I found a sample encoding on reddit, which failed as assumed for me as follows (similar for h264_vulkan): ffmpeg -init_hw_device vulkan=vkdev:0 -filter_hw_device vkdev -i hdv09_04.m2t -filter:v "format=nv12,hwupload" -c:v h264_vulkan hdv09_04_h264_vulkan_8b420.mp4 ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14 (SUSE Linux) configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --optflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --enable-version3 --enable-libsmbclient --disable-openssl --enable-gnutls --enable-ladspa --enable-libshaderc --enable-vulkan ...................... .......... [hevc_vulkan @ 0x55c32f8df6c0] Device does not support the VK_KHR_video_encode_queue extension! [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 0x55c32f8adcc0] Error sending frames to consumers: Function not implemented [vf#0:0 @ 0x55c32f8adcc0] Task finished with error code: -38 (Function not implemented) [vf#0:0 @ 0x55c32f8adcc0] Terminating thread with return code -38 (Function not implemented) [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Could not open encoder before EOF [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Task finished with error code: -22 (Invalid argument) [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55c32f8b2c80] 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 [aac @ 0x55c32f90c640] Qavg: 441.163 Conversion failed!
Arch upgraded to mesa 24.3.1 and my tests with system ffmpeg 7.1 were successful, but with many problems. Need to initialize the “vulkan” device otherwise it doesn't work. In case of AMD graphics you have to use RADV_PERFTEST=video_decode and/or RADV_PERFTEST=video_encode. This is because the merge in Mesa that will make device enablement automatic will only be in Mesa 25 (which should be the next release). The decoder works (it worked even before Mesa 24.3 came out) but it should be noted that without vulkan you have fps= 2222 while with vulkan you have fps=460 Command used for the decoder: $ RADV_PERFTEST=video_decode ffmpeg -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i battlefield_1080p_120fps_8mbps.mp4 -f null - -benchmark The encoder also works (it did not work before Mesa 24.3): you can see that the file is created (test_vk.mp4) and starts in mpv/VLC; the sound works but the video is completely black. Also, the original video is 35 MB while the video encoded with hevc_vulkan is 1.3 GB! The fps are not bad: 223. Command used for encoder: $ RADV_PERFTEST=video_encode ffmpeg -init_hw_device vulkan=vkdev:0 -filter_hw_device vkdev -i battlefield_1080p_120fps_8mbps.mp4 -filter:v "format=nv12,hwupload" -c:v hevc_vulkan test_vk.mp4 Instead when compiling CinGG I can't to enable the vulkan device. How to do it? i tried to use --enable-vulkan in “configure” but it is not recognized. How could I use the two strings RADV_PERFTEST=video_encode and RADV_PERFTEST=video_decode in CinGG? I attach the test results. Il giorno gio 28 nov 2024 alle ore 01:06 Terje J. Hanssen via Cin <[email protected]> ha scritto:
Den 28.11.2024 00:00, skrev Terje J. Hanssen:
Den 27.11.2024 23:40, skrev Andrew Randrianasulu:
чт, 28 нояб. 2024 г., 01:22 Terje J. Hanssen via Cin <[email protected]>:
In August this year we had a thread "h264 vulkan encoding" initiated by Andrea https://lists.cinelerra-gg.org/pipermail/cin/2024-August/008517.html
Mesa 24.3 is released with many Vulkan Driver Improvement, and implementations are expected around the corner in rolling distributions.
Some articles about this in Phoronix https://www.phoronix.com/news/Mesa-24.3-Released https://www.phoronix.com/news/Mesa-24.3-rc2 https://www.phoronix.com/news/Mesa-24.3-rc1-Released https://www.phoronix.com/news/Intel-Vulkan-Video-H264-H265
With ffmpeg (7.1) h264/5 vulkan encoder support, I wonder if Cingg is ready to put them into use?
ffmpeg -hide_banner -encoders | grep vulkan V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc)
you can try already (on system's ffmpeg), can't you?
Not Mesa 24.3 and vulkan encoding quite yet:
API: OpenGL v: 4.6 vendor: intel mesa v: 24.2.7 renderer: Mesa Intel Arc A750 Graphics (DG2) API: Vulkan v: 1.3.296 drivers: N/A surfaces: xcb,xlib API: EGL Message: EGL data requires eglinfo. Check --recommends.
# export ANV_VIDEO_DECODE=1
# vulkaninfo | grep VK_KHR_video VK_KHR_video_decode_h264 : extension revision 9 VK_KHR_video_decode_h265 : extension revision 8 VK_KHR_video_decode_queue : extension revision 8 VK_KHR_video_queue
So assume the FFmpeg benchmarks sample was vulkan decoding only, as they work for hdv (mpeg2) input also:
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04.m2t -f null - -benchmark frame= 5963 fps=3503 q=-0.0 Lsize=N/A time=00:03:58.77 bitrate=N/A speed= 140x bench: utime=19.045s stime=0.313s rtime=1.702s
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_h264_qsv.mp4 -f null - -benchmark frame= 5969 fps=988 q=-0.0 Lsize=N/A time=00:03:58.76 bitrate=N/A speed=39.5x bench: utime=1.397s stime=1.390s rtime=6.042s bench: maxrss=164700KiB
fmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_hevc_qsv_8b420.mp4 -f null - -benchmark frame= 248 fps=2.0 q=-0.0 size=N/A time=00:00:09.92 bitrate=N/A speed=0.0787x hevc terrible slow !!
And I found a sample encoding on reddit, which failed as assumed for me as follows (similar for h264_vulkan):
ffmpeg -init_hw_device vulkan=vkdev:0 -filter_hw_device vkdev -i hdv09_04.m2t -filter:v "format=nv12,hwupload" -c:v h264_vulkan hdv09_04_h264_vulkan_8b420.mp4
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14 (SUSE Linux) configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --optflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --enable-version3 --enable-libsmbclient --disable-openssl --enable-gnutls --enable-ladspa --enable-libshaderc --enable-vulkan ...................... .......... [hevc_vulkan @ 0x55c32f8df6c0] Device does not support the VK_KHR_video_encode_queue extension! [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 0x55c32f8adcc0] Error sending frames to consumers: Function not implemented [vf#0:0 @ 0x55c32f8adcc0] Task finished with error code: -38 (Function not implemented) [vf#0:0 @ 0x55c32f8adcc0] Terminating thread with return code -38 (Function not implemented) [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Could not open encoder before EOF [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Task finished with error code: -22 (Invalid argument) [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55c32f8b2c80] 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 [aac @ 0x55c32f90c640] Qavg: 441.163 Conversion failed!
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
пт, 6 дек. 2024 г., 13:01 Andrea paz <[email protected]>:
Arch upgraded to mesa 24.3.1 and my tests with system ffmpeg 7.1 were successful, but with many problems. Need to initialize the “vulkan” device otherwise it doesn't work. In case of AMD graphics you have to use RADV_PERFTEST=video_decode and/or RADV_PERFTEST=video_encode. This is because the merge in Mesa that will make device enablement automatic will only be in Mesa 25 (which should be the next release).
The decoder works (it worked even before Mesa 24.3 came out) but it should be noted that without vulkan you have fps= 2222 while with vulkan you have fps=460 Command used for the decoder:
$ RADV_PERFTEST=video_decode ffmpeg -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i battlefield_1080p_120fps_8mbps.mp4 -f null - -benchmark
The encoder also works (it did not work before Mesa 24.3): you can see that the file is created (test_vk.mp4) and starts in mpv/VLC; the sound works but the video is completely black. Also, the original video is 35 MB while the video encoded with hevc_vulkan is 1.3 GB! The fps are not bad: 223. Command used for encoder:
$ RADV_PERFTEST=video_encode ffmpeg -init_hw_device vulkan=vkdev:0 -filter_hw_device vkdev -i battlefield_1080p_120fps_8mbps.mp4 -filter:v "format=nv12,hwupload" -c:v hevc_vulkan test_vk.mp4
Instead when compiling CinGG I can't to enable the vulkan device. How to do it? i tried to use --enable-vulkan in “configure” but it is not recognized. How could I use the two strings RADV_PERFTEST=video_encode and RADV_PERFTEST=video_decode in CinGG?
just set them as export RADV_PERFTEST=video_encode before launching cingg not sure, may be you can add video_decode after "," ? check mesa3d docs ... for vulkan ... does it even makes sense to try with 7.0 ffmpeg? I think many fixes were done in 7.1/git ffmpeg exactly for this case .. may be compile cingg with external/system 7.1 ? it will break some presets and F_scale alternatively just use yuv4moeg pipeline to external ffmpeg running in another terminal, using named fifo (made with mkfifo) as filename to encode on cingg side and filename to decode from on encoding ffmpeg instance. No sound ... Look around may be someone already filled bugreport on too big filesize with hevc_vulcan on radv ? I think if merged ffv1 and some other vulcan-based encoders in ffmpeg git should be more interesting than yet another way to engage same h264/5 encoding hardware ... http://git.ffmpeg.org/gitweb/ffmpeg.git?a=search&h=HEAD&st=commit&s=vulkan yeah, ffv1 vulcan encoder was merged in november thanks for testing anyway!
I attach the test results.
Il giorno gio 28 nov 2024 alle ore 01:06 Terje J. Hanssen via Cin <[email protected]> ha scritto:
Den 28.11.2024 00:00, skrev Terje J. Hanssen:
Den 27.11.2024 23:40, skrev Andrew Randrianasulu:
чт, 28 нояб. 2024 г., 01:22 Terje J. Hanssen via Cin <
In August this year we had a thread "h264 vulkan encoding" initiated by
Andrea
https://lists.cinelerra-gg.org/pipermail/cin/2024-August/008517.html
Mesa 24.3 is released with many Vulkan Driver Improvement, and implementations are expected around the corner in rolling distributions.
Some articles about this in Phoronix https://www.phoronix.com/news/Mesa-24.3-Released https://www.phoronix.com/news/Mesa-24.3-rc2 https://www.phoronix.com/news/Mesa-24.3-rc1-Released https://www.phoronix.com/news/Intel-Vulkan-Video-H264-H265
With ffmpeg (7.1) h264/5 vulkan encoder support, I wonder if Cingg is ready to put them into use?
ffmpeg -hide_banner -encoders | grep vulkan V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc)
you can try already (on system's ffmpeg), can't you?
Not Mesa 24.3 and vulkan encoding quite yet:
API: OpenGL v: 4.6 vendor: intel mesa v: 24.2.7 renderer: Mesa Intel Arc A750 Graphics (DG2) API: Vulkan v: 1.3.296 drivers: N/A surfaces: xcb,xlib API: EGL Message: EGL data requires eglinfo. Check --recommends.
# export ANV_VIDEO_DECODE=1
# vulkaninfo | grep VK_KHR_video VK_KHR_video_decode_h264 : extension revision 9 VK_KHR_video_decode_h265 : extension revision 8 VK_KHR_video_decode_queue : extension revision 8 VK_KHR_video_queue
So assume the FFmpeg benchmarks sample was vulkan decoding only, as they work for hdv (mpeg2) input also:
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04.m2t -f null - -benchmark frame= 5963 fps=3503 q=-0.0 Lsize=N/A time=00:03:58.77 bitrate=N/A speed= 140x bench: utime=19.045s stime=0.313s rtime=1.702s
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_h264_qsv.mp4 -f null - -benchmark frame= 5969 fps=988 q=-0.0 Lsize=N/A time=00:03:58.76 bitrate=N/A speed=39.5x bench: utime=1.397s stime=1.390s rtime=6.042s bench: maxrss=164700KiB
fmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_hevc_qsv_8b420.mp4 -f null - -benchmark frame= 248 fps=2.0 q=-0.0 size=N/A time=00:00:09.92 bitrate=N/A speed=0.0787x hevc terrible slow !!
And I found a sample encoding on reddit, which failed as assumed for me as follows (similar for h264_vulkan):
ffmpeg -init_hw_device vulkan=vkdev:0 -filter_hw_device vkdev -i hdv09_04.m2t -filter:v "format=nv12,hwupload" -c:v h264_vulkan hdv09_04_h264_vulkan_8b420.mp4
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14 (SUSE Linux) configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --optflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --enable-version3 --enable-libsmbclient --disable-openssl --enable-gnutls --enable-ladspa --enable-libshaderc --enable-vulkan ...................... .......... [hevc_vulkan @ 0x55c32f8df6c0] Device does not support the VK_KHR_video_encode_queue extension! [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 0x55c32f8adcc0] Error sending frames to consumers: Function not implemented [vf#0:0 @ 0x55c32f8adcc0] Task finished with error code: -38 (Function not implemented) [vf#0:0 @ 0x55c32f8adcc0] Terminating thread with return code -38 (Function not implemented) [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Could not open encoder before EOF [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Task finished with error code: -22 (Invalid argument) [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55c32f8b2c80] 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 [aac @ 0x55c32f90c640] Qavg: 441.163 Conversion failed!
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Den 28.11.2024 01:06, skrev Terje J. Hanssen:
Den 28.11.2024 00:00, skrev Terje J. Hanssen:
Den 27.11.2024 23:40, skrev Andrew Randrianasulu:
чт, 28 нояб. 2024 г., 01:22 Terje J. Hanssen via Cin <[email protected]>:
In August this year we had a thread "h264 vulkan encoding" initiated by Andrea https://lists.cinelerra-gg.org/pipermail/cin/2024-August/008517.html
Mesa 24.3 is released with many Vulkan Driver Improvement, and implementations are expected around the corner in rolling distributions.
Some articles about this in Phoronix https://www.phoronix.com/news/Mesa-24.3-Released https://www.phoronix.com/news/Mesa-24.3-rc2 https://www.phoronix.com/news/Mesa-24.3-rc1-Released https://www.phoronix.com/news/Intel-Vulkan-Video-H264-H265
With ffmpeg (7.1) h264/5 vulkan encoder support, I wonder if Cingg is ready to put them into use?
ffmpeg -hide_banner -encoders | grep vulkan V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc)
you can try already (on system's ffmpeg), can't you?
Not Mesa 24.3 and vulkan encoding quite yet:
API: OpenGL v: 4.6 vendor: intel mesa v: 24.2.7 renderer: Mesa Intel Arc A750 Graphics (DG2) API: Vulkan v: 1.3.296 drivers: N/A surfaces: xcb,xlib API: EGL Message: EGL data requires eglinfo. Check --recommends.
# export ANV_VIDEO_DECODE=1
# vulkaninfo | grep VK_KHR_video VK_KHR_video_decode_h264 : extension revision 9 VK_KHR_video_decode_h265 : extension revision 8 VK_KHR_video_decode_queue : extension revision 8 VK_KHR_video_queue
So assume the FFmpeg benchmarks sample was vulkan decoding only, as they work for hdv (mpeg2) input also:
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04.m2t -f null - -benchmark frame= 5963 fps=3503 q=-0.0 Lsize=N/A time=00:03:58.77 bitrate=N/A speed= 140x bench: utime=19.045s stime=0.313s rtime=1.702s
ffmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_h264_qsv.mp4 -f null - -benchmark frame= 5969 fps=988 q=-0.0 Lsize=N/A time=00:03:58.76 bitrate=N/A speed=39.5x bench: utime=1.397s stime=1.390s rtime=6.042s bench: maxrss=164700KiB
fmpeg -hide_banner -init_hw_device "vulkan=vk:0" -hwaccel vulkan -hwaccel_output_format vulkan -i hdv09_04_hevc_qsv_8b420.mp4 -f null - -benchmark frame= 248 fps=2.0 q=-0.0 size=N/A time=00:00:09.92 bitrate=N/A speed=0.0787x hevc terrible slow !!
And I found a sample encoding on reddit, which failed as assumed for me as follows (similar for h264_vulkan):
ffmpeg -init_hw_device vulkan=vkdev:0 -filter_hw_device vkdev -i hdv09_04.m2t -filter:v "format=nv12,hwupload" -c:v h264_vulkan hdv09_04_h264_vulkan_8b420.mp4
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14 (SUSE Linux) configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --optflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --enable-version3 --enable-libsmbclient --disable-openssl --enable-gnutls --enable-ladspa --enable-libshaderc --enable-vulkan ...................... .......... [hevc_vulkan @ 0x55c32f8df6c0] Device does not support the VK_KHR_video_encode_queue extension! [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 0x55c32f8adcc0] Error sending frames to consumers: Function not implemented [vf#0:0 @ 0x55c32f8adcc0] Task finished with error code: -38 (Function not implemented) [vf#0:0 @ 0x55c32f8adcc0] Terminating thread with return code -38 (Function not implemented) [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Could not open encoder before EOF [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Task finished with error code: -22 (Invalid argument) [vost#0:0/hevc_vulkan @ 0x55c32fa0cf00] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 0x55c32f8b2c80] 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 [aac @ 0x55c32f90c640] Qavg: 441.163 Conversion failed!
Den 12.12.2024 11:07, skrev Andrea paz:
Try using a h264.mp4 video instead of hdv, to see if there is any difference.
Well, I have tried several input formats, h64 included. While the decoding benchmarks works ok in the range 25-30 fps, encoding still not work for me. It may be my faults, immature/buggy vulkan/ffmpeg video encoding and not at least insufficient or lack of documentation to do this. But hopefully, as also av1 and ffv1 will be available next, more working command examples will come out. https://www.phoronix.com/news/FFmpeg-November-Vulkan-Video ffmpeg -hide_banner -init_hw_device vulkan=vkdev:0 -filter_hw_device vkdev -i h264_8bit_yuv420p.mp4 -filter:v "format=nv12,hwupload" -c:v hevc_vulkan hevc_vulkan_8b420.mp4 ............ Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_vulkan)) .............. Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), vulkan(pc, smpte170m/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc61.19.100 hevc_vulkan [hevc_vulkan @ 0x556581f59b80] Encode failed: -1409282976. [vost#0:0/hevc_vulkan @ 0x556581f6a080] Error submitting video frame to the encoder [vost#0:0/hevc_vulkan @ 0x556581f6a080] Error encoding a frame: Error number -1409282976 occurred [vost#0:0/hevc_vulkan @ 0x556581f6a080] Task finished with error code: -1409282976 (Error number -1409282976 occurred) [vost#0:0/hevc_vulkan @ 0x556581f6a080] Terminating thread with return code -1409282976 (Error number -1409282976 occurred) [out#0/mp4 @ 0x556581f7ec80] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown [out#0/mp4 @ 0x556581f7ec80] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used) frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A Conversion failed!
Den 12.12.2024 20:13, skrev Terje J. Hanssen:
Den 12.12.2024 11:07, skrev Andrea paz:
Try using a h264.mp4 video instead of hdv, to see if there is any difference.
Well, I have tried several input formats, h64 included. While the decoding benchmarks works ok in the range 25-30 fps, encoding still not work for me. It may be my faults, immature/buggy vulkan/ffmpeg video encoding and not at least insufficient or lack of documentation to do this.
But hopefully, as also av1 and ffv1 will be available next, more working command examples will come out. https://www.phoronix.com/news/FFmpeg-November-Vulkan-Video
In reply to my corresponding request on the ffmpeg-user mailiing list: https://ffmpeg.org/pipermail/ffmpeg-user/2024-December/058931.html /My tests even with the NVIDIA drivers are pretty much the same as Intel's./ /Perhaps AMD's RADV performs better in this front?/ /Will retest as soon as I get my hands on one of these AMD GPUs. /
ffmpeg -hide_banner -init_hw_device vulkan=vkdev:0 -filter_hw_device vkdev -i h264_8bit_yuv420p.mp4 -filter:v "format=nv12,hwupload" -c:v hevc_vulkan hevc_vulkan_8b420.mp4 ............ Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_vulkan)) .............. Stream #0:0(und): Video: hevc (Main) (hev1 / 0x31766568), vulkan(pc, smpte170m/unknown/unknown, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 12800 tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] encoder : Lavc61.19.100 hevc_vulkan [hevc_vulkan @ 0x556581f59b80] Encode failed: -1409282976. [vost#0:0/hevc_vulkan @ 0x556581f6a080] Error submitting video frame to the encoder [vost#0:0/hevc_vulkan @ 0x556581f6a080] Error encoding a frame: Error number -1409282976 occurred [vost#0:0/hevc_vulkan @ 0x556581f6a080] Task finished with error code: -1409282976 (Error number -1409282976 occurred) [vost#0:0/hevc_vulkan @ 0x556581f6a080] Terminating thread with return code -1409282976 (Error number -1409282976 occurred) [out#0/mp4 @ 0x556581f7ec80] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown [out#0/mp4 @ 0x556581f7ec80] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used) frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A Conversion failed!
Den 27.11.2024 23:40, skrev Andrew Randrianasulu:
чт, 28 нояб. 2024 г., 01:22 Terje J. Hanssen via Cin <[email protected]>:
In August this year we had a thread "h264 vulkan encoding" initiated by Andrea https://lists.cinelerra-gg.org/pipermail/cin/2024-August/008517.html
Mesa 24.3 is released with many Vulkan Driver Improvement, and implementations are expected around the corner in rolling distributions.
Some articles about this in Phoronix https://www.phoronix.com/news/Mesa-24.3-Released https://www.phoronix.com/news/Mesa-24.3-rc2 https://www.phoronix.com/news/Mesa-24.3-rc1-Released https://www.phoronix.com/news/Intel-Vulkan-Video-H264-H265
With ffmpeg (7.1) h264/5 vulkan encoder support, I wonder if Cingg is ready to put them into use?
ffmpeg -hide_banner -encoders | grep vulkan V....D h264_vulkan H.264/AVC (Vulkan) (codec h264) V....D hevc_vulkan H.265/HEVC (Vulkan) (codec hevc)
you can try already (on system's ffmpeg), can't you?
I have tried ffmpeg 7.1 with Mesa 24.3.0 (Slowroll) and with Mesa 24.3.1 (Tumbleweed), but I have yet to find a command line that work for vulkan endcoding. export ANV_VIDEO_DECODE=1 export ANV_VIDEO_ENCODE=1 vulkaninfo | grep VK_KHR_video VK_KHR_video_decode_h264 : extension revision 9 VK_KHR_video_decode_h265 : extension revision 8 VK_KHR_video_decode_queue : extension revision 8 VK_KHR_video_encode_h264 : extension revision 14 VK_KHR_video_encode_h265 : extension revision 14 VK_KHR_video_encode_queue : extension revision 12 VK_KHR_video_maintenance1 : extension revision 1 VK_KHR_video_queue : extension revision 8 --------------- ffmpeg -hide_banner -init_hw_device vulkan -i hdv09_04.m2t -vf format=nv12,hwupload -c:v hevc_vulkan -y hdv09_04_hevc_vulkan_nv12.mp4 [mpeg2video @ 0x55dc42008980] Invalid frame dimensions 0x0. Last message repeated 3 times [mpegts @ 0x55dc41fff300] PES packet size mismatch [mpegts @ 0x55dc41fff300] Packet corrupt (stream = 1, dts = 258142320). [mpegts @ 0x55dc41fff300] 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 @ 0x55dc41fff300] 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) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn 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 Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> hevc (hevc_vulkan)) Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) Press [q] to stop, [?] for help [hevc_vulkan @ 0x55dc420090c0] No rate control settings specified, using fixed QP = 18 Output #0, mp4, to 'hdv09_04_hevc_vulkan_nv12.mp4': Metadata: encoder : Lavf61.7.100 Stream #0:0: Video: hevc (Main) (hev1 / 0x31766568), vulkan(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc61.19.100 hevc_vulkan Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc61.19.100 aac [hevc_vulkan @ 0x55dc420090c0] Unable to perform query: VK_ERROR_DEVICE_LOST! [hevc_vulkan @ 0x55dc420090c0] Output failed: -542398533. [vost#0:0/hevc_vulkan @ 0x55dc420ee800] Error submitting video frame to the encoder [vost#0:0/hevc_vulkan @ 0x55dc420ee800] Error encoding a frame: Generic error in an external library [vost#0:0/hevc_vulkan @ 0x55dc420ee800] Task finished with error code: -542398533 (Generic error in an external library) Unable to submit command buffer: VK_ERROR_DEVICE_LOST [vost#0:0/hevc_vulkan @ 0x55dc420ee800] Terminating thread with return code -542398533 (Generic error in an external library) [hwupload @ 0x7fd45c004540] Failed to upload frame: -542398533. [vf#0:0 @ 0x55dc41fddc80] Error while filtering: Generic error in an external library [vf#0:0 @ 0x55dc41fddc80] Task finished with error code: -542398533 (Generic error in an external library) [vf#0:0 @ 0x55dc41fddc80] Terminating thread with return code -542398533 (Generic error in an external library) [out#0/mp4 @ 0x55dc41fb8180] video:0KiB audio:494KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 1.327457% frame= 0 fps=0.0 q=0.0 Lsize= 500KiB time=N/A bitrate=N/A speed=N/A [aac @ 0x55dc4201b000] Qavg: 414.312 Conversion failed! -------------------------- ffmpeg -hide_banner -init_hw_device vulkan -i hdv09_04.m2t -vf format=nv12,hwupload -c:v h264_vulkan -y hdv09_04_h264_vulkan_nv12.mp4 [mpeg2video @ 0x559168e71440] Invalid frame dimensions 0x0. Last message repeated 3 times [mpegts @ 0x559168e68200] PES packet size mismatch [mpegts @ 0x559168e68200] Packet corrupt (stream = 1, dts = 258142320). [mpegts @ 0x559168e68200] 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 @ 0x559168e68200] 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) ([2][0][0][0] / 0x0002), yuv420p(tv, bt709, top first), 1440x1080 [SAR 4:3 DAR 16:9], 25000 kb/s, 25 fps, 25 tbr, 90k tbn 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 Stream #0:2[0x815]: Unknown: none ([160][0][0][0] / 0x00A0) Stream #0:3[0x811]: Unknown: none ([161][0][0][0] / 0x00A1) Stream mapping: Stream #0:0 -> #0:0 (mpeg2video (native) -> h264 (h264_vulkan)) Stream #0:1 -> #0:1 (mp2 (native) -> aac (native)) Press [q] to stop, [?] for help [h264_vulkan @ 0x559168e71b80] No rate control settings specified, using fixed QP = 18 Output #0, mp4, to 'hdv09_04_h264_vulkan_nv12.mp4': Metadata: encoder : Lavf61.7.100 Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), vulkan(tv, bt709, top coded first (swapped)), 1440x1080 [SAR 4:3 DAR 16:9], q=2-31, 25 fps, 12800 tbn Metadata: encoder : Lavc61.19.100 h264_vulkan Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc61.19.100 aac [h264_vulkan @ 0x559168e71b80] Unable to perform query: VK_ERROR_DEVICE_LOST! [h264_vulkan @ 0x559168e71b80] Output failed: -542398533. [vost#0:0/h264_vulkan @ 0x559168f84880] Error submitting video frame to the encoder Unable to submit command buffer: VK_ERROR_DEVICE_LOST [vost#0:0/h264_vulkan @ 0x559168f84880] Error encoding a frame: Generic error in an external library [vost#0:0/h264_vulkan @ 0x559168f84880] Task finished with error code: -542398533 (Generic error in an external library) [hwupload @ 0x7f421c004540] Failed to upload frame: -542398533. [vost#0:0/h264_vulkan @ 0x559168f84880] Terminating thread with return code -542398533 (Generic error in an external library) [vf#0:0 @ 0x559168e1fcc0] Error while filtering: Generic error in an external library [vf#0:0 @ 0x559168e1fcc0] Task finished with error code: -542398533 (Generic error in an external library) [vf#0:0 @ 0x559168e1fcc0] Terminating thread with return code -542398533 (Generic error in an external library) [out#0/mp4 @ 0x559168e1c580] video:0KiB audio:54KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 2.695310% frame= 0 fps=0.0 q=0.0 Lsize= 55KiB time=N/A bitrate=N/A speed=N/A [aac @ 0x559168e83e00] Qavg: 186.490 Conversion failed!
participants (3)
-
Andrea paz -
Andrew Randrianasulu -
Terje J. Hanssen