<div dir="ltr"><div class="gmail_default" style="font-size:small">Terje, thank you for this comprehensive list of vaapi supported encodings.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 31, 2024 at 5:38 PM Terje J. Hanssen via Cin <<a href="mailto:cin@lists.cinelerra-gg.org">cin@lists.cinelerra-gg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
In hope it may be of some use for Cingg next, I make a summary and
supplement to the guide in
<a href="https://trac.ffmpeg.org/wiki/Hardware/VAAPI#Encoding" target="_blank">https://trac.ffmpeg.org/wiki/Hardware/VAAPI#Encoding</a> <br>
And instead of adding a tail to already too long recent threads, I
start a new thread here. <br>
<br>
<font face="Courier New, Courier, monospace">Two additional
references are used<br>
Developer Reference: Media Capabilities Supported by Intel
Hardware<br>
<a href="https://www.intel.com/content/www/us/en/docs/onevpl/developer-reference-media-intel-hardware/1-1/features-and-formats.html" target="_blank">https://www.intel.com/content/www/us/en/docs/onevpl/developer-reference-media-intel-hardware/1-1/features-and-formats.html</a><br>
Supported Encoding Input Format and Max Resolution<br>
<a href="https://github.com/intel/media-driver/blob/master/docs/media_features.md#supported-encoding-input-format-and-max-resolution" target="_blank">https://github.com/intel/media-driver/blob/master/docs/media_features.md#supported-encoding-input-format-and-max-resolution</a><br>
<br>
to clarify the Encode Features for my own Intel Arc A-series
Discrete Graphics<br>
<br>
HEVC (fixed-function hardware + shader-based)<br>
8-bit, 4:2:0 (NV12)<br>
10-bit, 4:2:0 (P010)<br>
8-bit, 4:2:2 (YUY2, Windows only)<br>
10-bit, 4:2:2 (Y210)<br>
<br>
AV1<br>
8-bit, 4:2:0 (NV12)<br>
10-bit, 4:2:0 (P010)<br>
<br>
<br>
A short reminder:<br>
8-bit vs 10-bit color depths is 256 vs 1024 color levels of each
RGB color, or 16.7 mill. vs 1.0 bill colors.<br>
4:2:0 vs 4:2:2 color sub-sampling is keeping 1/4 vs 1/2 of all
4:4:4 colors or the precision of color compression. <br>
<a href="https://fujifilm-x.com/en-us/series/the-filmmakers-handbook/8-bit-or-10-bit-video-color-explained/" target="_blank">https://fujifilm-x.com/en-us/series/the-filmmakers-handbook/8-bit-or-10-bit-video-color-explained/</a>
<br>
<br>
<br>
An important point to notice is that the VAAPI encoding 'formats'
are based on those in the parentheses () above.<br>
<br>
Three simplified ffmpeg code lines with default bit-rates and
without audio are used in the following three examples.<br>
Resulting fps encoding counts or speeds are the same in all cases;
I don't know why.<br>
<br>
<br>
The input file used:<br>
<br>
ffprobe -hide_banner cfhd01.mkv<br>
Input #0, matroska,webm, from 'cfhd01.mkv':<br>
Metadata:<br>
ENCODER : Lavf61.1.100<br>
Duration: 00:01:11.24, start: 0.000000, bitrate: 393480 kb/s<br>
Stream #0:0(eng): Video: cfhd (CFHD / 0x44484643),
yuv422p10le(tv, bt709, top coded first (swapped)), 1920x1080, SAR
1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn (default)<br>
Metadata:<br>
HANDLER_NAME : Apple Video Media Handler<br>
VENDOR_ID : appl<br>
ENCODER : Lavc61.3.100 cfhd<br>
DURATION : 00:01:11.240000000<br>
<br>
<br>
1)<br>
8-bit yuv420p hevc vaapi encoding using -vf 'format=nv12,hwupload'<br>
------------------------------------------------------------------<br>
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i
cfhd01.mkv -vf 'format=nv12,hwupload' -c:v av1_vaapi
cfhd01_av1_vaapi_format_nv12.mp4<br>
............<br>
frame= 1781 fps= 46 q=-0.0 Lsize= 104132KiB time=00:01:11.24
bitrate=11974.3kbits/s speed=1.83x <br>
<br>
<br>
ffprobe -hide_banner cfhd01_av1_vaapi_format_nv12.mp4<br>
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'cfhd01_av1_vaapi_format_nv12.mp4':<br>
Metadata:<br>
major_brand : isom<br>
minor_version : 512<br>
compatible_brands: isomav01iso2mp41<br>
encoder : Lavf61.7.100<br>
Duration: 00:01:11.24, start: 0.000000, bitrate: 11974 kb/s<br>
Stream #0:0[0x1](eng): Video: av1 (libdav1d) (Main) (av01 /
0x31307661), yuv420p(tv, bt709, progressive), 1920x1080, 11973
kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn (default)<br>
Metadata:<br>
handler_name : Apple Video Media Handler<br>
vendor_id : [0][0][0][0]<br>
encoder : Lavc61.19.100 av1_vaapi<br>
<br>
<br>
2)<br>
10-bit yuv420p10le hevc vaapi encoding using -vf
'format=p010,hwupload'<br>
-----------------------------------------------------------------------<br>
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i
cfhd01.mkv -vf 'format=p010,hwupload' -c:v av1_vaapi
cfhd01_av1_vaapi_format_p010.mp4<br>
.............<br>
frame= 1781 fps= 46 q=-0.0 Lsize= 111924KiB time=00:01:11.24
bitrate=12870.3kbits/s speed=1.82x <br>
<br>
<br>
ffprobe -hide_banner cfhd01_av1_vaapi_format_p010.mp4<br>
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'cfhd01_av1_vaapi_format_p010.mp4':<br>
Metadata:<br>
major_brand : isom<br>
minor_version : 512<br>
compatible_brands: isomav01iso2mp41<br>
encoder : Lavf61.7.100<br>
Duration: 00:01:11.24, start: 0.000000, bitrate: 12870 kb/s<br>
Stream #0:0[0x1](eng): Video: av1 (libdav1d) (Main) (av01 /
0x31307661), yuv420p10le(tv, bt709, progressive), 1920x1080, 12869
kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 12800 tbn (default)<br>
Metadata:<br>
handler_name : Apple Video Media Handler<br>
vendor_id : [0][0][0][0]<br>
encoder : Lavc61.19.100 av1_vaapi<br>
<br>
3)<br>
10-bit yuv422p10le hevc_vaapi encoding using -vf
'format=y210,hwupload'<br>
-----------------------------------------------------------------------<br>
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i
cfhd01.mkv -vf 'format=y210,hwupload' -c:v hevc_vaapi
cfhd01_hevc_vaapi_format_y210.mp4<br>
frame= 1781 fps= 46 q=-0.0 Lsize= 105482KiB time=00:01:11.20
bitrate=12136.3kbits/s speed=1.83x <br>
<br>
<br>
ffprobe -hide_banner cfhd01_hevc_vaapi_format_y210.mp4<br>
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'cfhd01_hevc_vaapi_format_y210.mp4':<br>
Metadata:<br>
major_brand : isom<br>
minor_version : 512<br>
compatible_brands: isomiso2mp41<br>
encoder : Lavf61.7.100<br>
Duration: 00:01:11.24, start: 0.000000, bitrate: 12129 kb/s<br>
Stream #0:0[0x1](eng): Video: hevc (Rext) (hev1 / 0x31766568),
yuv422p10le(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9],
12127 kb/s, 25 fps, 25 tbr, 12800 tbn (default)<br>
Metadata:<br>
handler_name : Apple Video Media Handler<br>
vendor_id : [0][0][0][0]<br>
encoder : Lavc61.19.100 hevc_vaapi <br>
<br>
<br>
<br>
</font>
</div>
-- <br>
Cin mailing list<br>
<a href="mailto:Cin@lists.cinelerra-gg.org" target="_blank">Cin@lists.cinelerra-gg.org</a><br>
<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" rel="noreferrer" target="_blank">https://lists.cinelerra-gg.org/mailman/listinfo/cin</a><br>
</blockquote></div>