<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
After posting some recent ffmpeg SVT-AV1 vs -hwaccel AV1_QSV
encoding tests, here follows a simple comparison with AV1_VAAPI (and
opus audio default). <br>
Comparable bitrates are used. The higher bitrate is selected on
VAAPI's default bitrate premise. Preset 4 quality setting is used
for QSV encoding, no other tuning or optimization is applied. <br>
The first visual quality is so far reasonable IMO, while there may
be differences at a closer study.<br>
<br>
The ffmpeg command line syntax I got working for AV1_VAAPI is based
on an VP9 encode (only) example at<br>
<a class="moz-txt-link-freetext"
href="https://trac.ffmpeg.org/wiki/Hardware/VAAPI#Encode-only">https://trac.ffmpeg.org/wiki/Hardware/VAAPI#Encode-only</a><br>
<br>
So far I didn't succeed trying to apply the Hardware-only Transcode
examples. So the DV and HDV decode parts have possibly taken place
in the CPU rather than in the GPU(?)<br>
<a class="moz-txt-link-freetext"
href="https://trac.ffmpeg.org/wiki/Hardware/VAAPI#Transcode">https://trac.ffmpeg.org/wiki/Hardware/VAAPI#Transcode</a>
<br>
<br>
<font face="Courier New, Courier, monospace">--------------------------<br>
<br>
576i SD-DV -> AV1_VAAPI at bv1570k VBR<br>
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i
dv01_07.dv -vf 'format=nv12,hwupload' -c:v av1_vaapi -b:v 1570k
dv01_07_av1_vaapi_bv1570k.webm<br>
frame= 2832 fps=1959 q=-0.0 Lsize= 28133KiB time=00:01:53.28
bitrate=2034.5kbits/s speed=78.3x <br>
<br>
576i SD-DV->AV1_QSV at bv1570k<br>
ffmpeg -hide_banner -hwaccel_output_format qsv -qsv_device
/dev/dri/renderD128 -i dv01_07.dv -c:v av1_qsv -preset 4 -b:v
1570k dv01_07_av1_qsv_pr4_bv1570k.webm<br>
frame= 2832 fps=1746 q=-0.0 Lsize= 23852KiB time=00:01:53.24
bitrate=1725.5kbits/s speed=69.8x <br>
..........<br>
<br>
576i SD-DV -> AV1_VAAPI at default VBR<br>
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i
dv01_07.dv -vf 'format=nv12,hwupload' -c:v av1_vaapi
dv01_07_av1_vaapi.webm<br>
frame= 2832 fps=1324 q=-0.0 Lsize= 81317KiB time=00:01:53.28
bitrate=5880.6kbits/s speed= 53x <br>
<br>
576i SD-DV->AV1_QSV at bv5600k<br>
ffmpeg -hide_banner -hwaccel_output_format qsv -qsv_device
/dev/dri/renderD128 -i dv01_07.dv -c:v av1_qsv -preset 4 -b:v
5600k dv01_07_av1_qsv_pr4_bv5600k.webm<br>
frame= 2832 fps=1713 q=-0.0 Lsize= 81600KiB time=00:01:53.24
bitrate=5903.1kbits/s speed=68.5x <br>
.......<br>
<br>
du -sh dv*.dv dv*vaapi*.webm dv*qsv*.webm<br>
389M dv01_07.dv<br>
28M dv01_07_av1_vaapi_bv1570k.webm<br>
80M dv01_07_av1_vaapi.webm<br>
24M dv01_07_av1_qsv_pr4_bv1570k.webm<br>
80M dv01_07_av1_qsv_pr4_bv5600k.webm<br>
<br>
<br>
</font><font face="Courier New, Courier, monospace">In this SD-DV
case, VAAPI encoding is 12% faster than QSV with 15% smaller file
size at bv1570k bitrate, while QSV is 29% faster than VAAPI at
bv5600k bitrate.</font><br>
<font face="Courier New, Courier, monospace"> <br>
<br>
----------------------------<br>
<br>
1080i HDV -> AV1_VAAPI at 3700k VBR<br>
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i
hdv09_04.m2t -vf 'format=nv12,hwupload' -c:v av1_vaapi -b:v 3700k
hdv09_04_av1_vaapi_bv3700k.webm<br>
frame= 5963 fps=631 q=-0.0 Lsize= 153106KiB time=00:03:58.77
bitrate=5252.8kbits/s speed=25.3x <br>
<br>
1080i HDV->AV1_QSV at 3700k<br>
fmpeg -hide_banner -hwaccel_output_format qsv -qsv_device
/dev/dri/renderD128 -extra_hw_frames 16 -i hdv09_04.m2t -c:v
av1_qsv -preset 4 -b:v 3700k hdv09_04_av1_qsv_pr4_bv3700k.webm<br>
frame= 5963 fps=473 q=-0.0 Lsize= 113271KiB time=00:03:58.77
bitrate=3886.1kbits/s speed=18.9x <br>
.......<br>
<br>
1080i HDV -> AV1_VAAPI at default VBR<br>
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i
hdv09_04.m2t -vf 'format=nv12,hwupload' -c:v av1_vaapi
hdv09_04_av1_vaapi.webm<br>
frame= 5963 fps=629 q=-0.0 Lsize= 153106KiB time=00:03:58.77
bitrate=5252.8kbits/s speed=25.2x <br>
<br>
1080i HDV->AV1_QSV at 12600k<br>
ffmpeg -hide_banner -hwaccel_output_format qsv -qsv_device
/dev/dri/renderD128 -extra_hw_frames 16 -i hdv09_04.m2t -c:v
av1_qsv -preset 4 -b:v 12600k hdv09_04_av1_qsv_pr4_bv12600k.webm<br>
frame= 5963 fps=476 q=-0.0 Lsize= 370043KiB time=00:03:58.77
bitrate=12695.6kbits/s speed= 19x <br>
<br>
<br>
du -sh *.m2t hdv*vaapi*.webm hdv*qsv*.webm<br>
745M hdv09_04.m2t<br>
150M hdv09_04_av1_vaapi_bv3700k.webm<br>
375M hdv09_04_av1_vaapi.webm<br>
362M hdv09_04_av1_qsv_pr4_bv12600k.webm<br>
111M hdv09_04_av1_qsv_pr4_bv3700k.webm<br>
<br>
<br>
In this HDV case, VAAPI encoding is about 33% faster than QSV with
25% - 4% smaller file sizes.<br>
<br>
<br>
<br>
Background info:<br>
----------------<br>
<br>
How to Identify & Find Graphics Drivers for Linux<br>
<a class="moz-txt-link-freetext"
href="https://www.intel.com/content/www/us/en/support/articles/000005520/graphics.html?wapkw=intel%20graphics%20installer%20for%20linux">https://www.intel.com/content/www/us/en/support/articles/000005520/graphics.html?wapkw=intel%20graphics%20installer%20for%20linux</a><br>
<br>
lspci -k | grep -EA3 'VGA|3D|Display'<br>
03:00.0 VGA compatible controller: Intel Corporation DG2 [Arc
A750] (rev 08)<br>
Subsystem: ASRock Incorporation Device 6002<br>
Kernel driver in use: i915<br>
Kernel modules: i915, xe<br>
</font> <font face="Courier New, Courier, monospace"><br>
<br>
Vaapi and libva packages installed:<br>
<br>
<br>
S | Name | Type | Version | Arch
| Repository<br>
---+--------------------+---------+----------------------+--------+----------------------<br>
i | intel-vaapi-driver | package | 2.4.1-5.13 | x86_64
| openSUSE-Slowroll-Oss<br>
i | libva-drm2 | package | 2.21.0-1.1 | x86_64
| openSUSE-Slowroll-Oss<br>
i | libva-glx2 | package | 2.21.0-1.1 | x86_64
| openSUSE-Slowroll-Oss<br>
i+ | libva-utils | package | 2.20.1-1.3 | x86_64
| openSUSE-Slowroll-Oss<br>
i | libva-wayland2 | package | 2.21.0-1.1 | x86_64
| openSUSE-Slowroll-Oss<br>
i | libva-x11-2 | package | 2.21.0-1.1 | x86_64
| openSUSE-Slowroll-Oss<br>
i | libva2 | package | 2.21.0-1.1 | x86_64
| openSUSE-Slowroll-Oss<br>
i | Mesa-libva | package | 24.0.8-1699.384.pm.1 | x86_64
| Packman<br>
<br>
<br>
<br>
Information for package intel-vaapi-driver:<br>
-------------------------------------------<br>
Summary : Intel Driver for Video Acceleration (VA) API for
Linux<br>
Description : <br>
Intel Driver for Libva is a library providing the VA API video
acceleration API.<br>
<br>
<br>
Information for package libva-drm2:<br>
-----------------------------------<br>
Summary : DRM backend for the Video Acceleration API<br>
Description : <br>
The libva library implements the Video Acceleration API.<br>
The library loads a hardware dependendent driver.<br>
This is the VA/DRM runtime library.<br>
<br>
<br>
Information for package libva-glx2:<br>
-----------------------------------<br>
Summary : GLX backend for the Video Acceleration API<br>
Description : <br>
The libva library implements the Video Acceleration API.<br>
The library loads a hardware dependendent driver.<br>
<br>
This is the VA/GLX runtime library.<br>
<br>
<br>
Information for package libva-utils:<br>
------------------------------------<br>
Summary : A collection of utilities and examples to
exercise VA-API<br>
Description : <br>
libva-utils is a collection of utilities and examples to
exercise<br>
VA-API in accordance with the libva project.<br>
A driver implementation is necessary to properly operate.<br>
<br>
<br>
Information for package libva-wayland2:<br>
---------------------------------------<br>
Summary : Wayland backend for the Video Acceleration API<br>
Description : <br>
The libva library implements the Video Acceleration API.<br>
The library loads a hardware dependendent driver.<br>
<br>
<br>
Information for package libva-x11-2:<br>
------------------------------------<br>
Summary : X11 backend for the Video Acceleration API<br>
Description : <br>
The libva library implements the Video Acceleration API.<br>
The library loads a hardware dependendent driver.<br>
This is the VA/X11 runtime library.<br>
<br>
<br>
Information for package libva2:<br>
-------------------------------<br>
Summary : Video Acceleration API<br>
Description : <br>
The libva library implements the Video Acceleration API.<br>
The library loads a hardware dependendent driver.<br>
This is the core runtime library.<br>
<br>
<br>
Information for package Mesa-libva:<br>
-----------------------------------<br>
Summary : Mesa VA-API implementation<br>
Description : <br>
This package contains the Mesa VA-API implementation provided
through gallium.<br>
<br>
<br>
vainfo<br>
Trying display: wayland<br>
error: XDG_RUNTIME_DIR is invalid or not set in the environment.<br>
Trying display: x11<br>
libva info: VA-API version 1.21.0<br>
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so<br>
libva info: Found init function __vaDriverInit_1_20<br>
libva info: va_openDriver() returns 0<br>
vainfo: VA-API version: 1.21 (libva 2.20.1)<br>
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics
- 24.1.3 ()<br>
vainfo: Supported profile and entrypoints<br>
VAProfileNone : VAEntrypointVideoProc<br>
VAProfileNone : VAEntrypointStats<br>
VAProfileMPEG2Simple : VAEntrypointVLD<br>
VAProfileMPEG2Main : VAEntrypointVLD<br>
VAProfileH264Main : VAEntrypointVLD<br>
VAProfileH264Main : VAEntrypointEncSliceLP<br>
VAProfileH264High : VAEntrypointVLD<br>
VAProfileH264High : VAEntrypointEncSliceLP<br>
VAProfileJPEGBaseline : VAEntrypointVLD<br>
VAProfileJPEGBaseline : VAEntrypointEncPicture<br>
VAProfileH264ConstrainedBaseline: VAEntrypointVLD<br>
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP<br>
VAProfileHEVCMain : VAEntrypointVLD<br>
VAProfileHEVCMain : VAEntrypointEncSliceLP<br>
VAProfileHEVCMain10 : VAEntrypointVLD<br>
VAProfileHEVCMain10 : VAEntrypointEncSliceLP<br>
VAProfileVP9Profile0 : VAEntrypointVLD<br>
VAProfileVP9Profile0 : VAEntrypointEncSliceLP<br>
VAProfileVP9Profile1 : VAEntrypointVLD<br>
VAProfileVP9Profile1 : VAEntrypointEncSliceLP<br>
VAProfileVP9Profile2 : VAEntrypointVLD<br>
VAProfileVP9Profile2 : VAEntrypointEncSliceLP<br>
VAProfileVP9Profile3 : VAEntrypointVLD<br>
VAProfileVP9Profile3 : VAEntrypointEncSliceLP<br>
VAProfileHEVCMain12 : VAEntrypointVLD<br>
VAProfileHEVCMain422_10 : VAEntrypointVLD<br>
VAProfileHEVCMain422_10 : VAEntrypointEncSliceLP<br>
VAProfileHEVCMain422_12 : VAEntrypointVLD<br>
VAProfileHEVCMain444 : VAEntrypointVLD<br>
VAProfileHEVCMain444 : VAEntrypointEncSliceLP<br>
VAProfileHEVCMain444_10 : VAEntrypointVLD<br>
VAProfileHEVCMain444_10 : VAEntrypointEncSliceLP<br>
VAProfileHEVCMain444_12 : VAEntrypointVLD<br>
VAProfileHEVCSccMain : VAEntrypointVLD<br>
VAProfileHEVCSccMain : VAEntrypointEncSliceLP<br>
VAProfileHEVCSccMain10 : VAEntrypointVLD<br>
VAProfileHEVCSccMain10 : VAEntrypointEncSliceLP<br>
VAProfileHEVCSccMain444 : VAEntrypointVLD<br>
VAProfileHEVCSccMain444 : VAEntrypointEncSliceLP<br>
VAProfileAV1Profile0 : VAEntrypointVLD<br>
VAProfileAV1Profile0 : VAEntrypointEncSliceLP<br>
VAProfileHEVCSccMain444_10 : VAEntrypointVLD<br>
VAProfileHEVCSccMain444_10 : VAEntrypointEncSliceLP<br>
</font><br>
<font face="Courier New, Courier, monospace"><br>
FFmpeg <br>
-------<br>
<br>
ffmpeg -hide_banner -buildconf | grep vaapi<br>
--enable-vaapi<br>
<br>
<br>
ffmpeg -hide_banner -encoders | grep av1<br>
V....D libaom-av1 libaom AV1 (codec av1)<br>
V....D librav1e librav1e AV1 (codec av1)<br>
V..... libsvtav1 SVT-AV1(Scalable Video Technology for
AV1) encoder (codec av1)<br>
V....D av1_nvenc NVIDIA NVENC av1 encoder (codec av1)<br>
V..... av1_qsv AV1 (Intel Quick Sync Video
acceleration) (codec av1)<br>
V....D av1_amf AMD AMF AV1 encoder (codec av1)<br>
V....D av1_vaapi AV1 (VAAPI) (codec av1)<br>
A....D wmav1 Windows Media Audio 1<br>
<br>
<br>
ffmpeg -hide_banner -h encoder=av1_vaapi<br>
Encoder av1_vaapi [AV1 (VAAPI)]:<br>
General capabilities: dr1 delay hardware <br>
Threading capabilities: none<br>
Supported hardware devices: vaapi <br>
Supported pixel formats: vaapi<br>
av1_vaapi AVOptions:<br>
-low_power <boolean> E..V....... Use low-power
encoding mode (only available on some platforms; may not support
all encoding features) (default false)<br>
-idr_interval <int> E..V....... Distance (in
I-frames) between IDR frames (from 0 to INT_MAX) (default 0)<br>
-b_depth <int> E..V....... Maximum
B-frame reference depth (from 1 to INT_MAX) (default 1)<br>
-async_depth <int> E..V....... Maximum
processing parallelism. Increase this to improve single channel
performance. This option doesn't work if driver doesn't implement
vaSyncBuffer function. (from 1 to 64) (default 2)<br>
-max_frame_size <int> E..V....... Maximum frame
size (in bytes) (from 0 to INT_MAX) (default 0)<br>
-rc_mode <int> E..V....... Set rate
control mode (from 0 to 6) (default auto)<br>
auto 0 E..V....... Choose mode
automatically based on other parameters<br>
CQP 1 E..V....... Constant-quality<br>
CBR 2 E..V....... Constant-bitrate<br>
VBR 3 E..V....... Variable-bitrate<br>
ICQ 4 E..V....... Intelligent
constant-quality<br>
QVBR 5 E..V....... Quality-defined
variable-bitrate<br>
AVBR 6 E..V....... Average
variable-bitrate<br>
-blbrc <boolean> E..V....... Block level
based bitrate control (default false)<br>
-profile <int> E..V....... Set profile
(seq_profile) (from -99 to 255) (default -99)<br>
main 0 E..V.......<br>
high 1 E..V.......<br>
professional 2 E..V.......<br>
-tier <int> E..V....... Set tier
(seq_tier) (from 0 to 1) (default main)<br>
main 0 E..V.......<br>
high 1 E..V.......<br>
-level <int> E..V....... Set level
(seq_level_idx) (from -99 to 31) (default -99)<br>
2.0 0 E..V.......<br>
2.1 1 E..V.......<br>
3.0 4 E..V.......<br>
3.1 5 E..V.......<br>
4.0 8 E..V.......<br>
4.1 9 E..V.......<br>
5.0 12 E..V.......<br>
5.1 13 E..V.......<br>
5.2 14 E..V.......<br>
5.3 15 E..V.......<br>
6.0 16 E..V.......<br>
6.1 17 E..V.......<br>
6.2 18 E..V.......<br>
6.3 19 E..V.......<br>
-tiles <image_size> E..V....... Tile columns x
rows (Use minimal tile column/row number automatically by default)<br>
-tile_groups <int> E..V....... Number of tile
groups for encoding (from 1 to 4096) (default 1)</font><br>
</body>
</html>