<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
Usually 8-bit color depth is refered to 420 pixel formats and 10-bit
to the higher color quality 422 pixel formats,<br>
which sub-sampled keeps respectively 25% and 50% color information,
compared with a full 444 format.<br>
<br>
But what about the "opposite" cases, 10-bit 420 and 8-bit 422 pixel
formats?<br>
What and when are they used and good for (applications)?<br>
For example frame grabbers like my HDMI->USB3 mini capture card,
looks to support 'YUY2',' a 8-bit 422 pixel format. <br>
<br>
And among 8-bit and 10-bit depths, there are 'yuv', 'nv', 'y' and
'p' prefixed pixel formats as well.<br>
<br>
Querying my system ffmpeg, the following list of 8-bit and 10-bit
pixel formats are available:<br>
<br>
<blockquote><font face="monospace">ffmpeg -hide_banner -pix_fmts |
grep -E
'yuv42.*8-8-8|yuv42.*10-10-10|nv.*8-8-8|nv.*10-10-10|210' | sort
-r -k 5</font><br>
<font face="monospace">-----</font><br>
<font face="monospace">Pixel formats:</font><br>
<font face="monospace">I.... = Supported Input format for
conversion</font><br>
<font face="monospace">.O... = Supported Output format for
conversion</font><br>
<font face="monospace">..H.. = Hardware accelerated format</font><br>
<font face="monospace">...P. = Paletted format</font><br>
<font face="monospace">....B = Bitstream format</font><br>
<font face="monospace">FLAGS NAME NB_COMPONENTS
BITS_PER_PIXEL BIT_DEPTHS</font><br>
<font face="monospace">-----</font><br>
<font face="monospace">IO... yuv422p 3
16 8-8-8</font><br>
<font face="monospace">IO... yuv420p 3
12 8-8-8</font><br>
<font face="monospace">IO... nv42 3
24 8-8-8</font><br>
<font face="monospace">IO... nv24 3
24 8-8-8</font><br>
<font face="monospace">IO... nv21 3
12 8-8-8</font><br>
<font face="monospace">IO... nv16 3
16 8-8-8</font><br>
<font face="monospace">IO... nv12 3
12 8-8-8</font><br>
<font face="monospace">..... y210be 3
20 10-10-10</font><br>
<font face="monospace">..... nv20le 3
20 10-10-10</font><br>
<font face="monospace">..... nv20be 3
20 10-10-10</font><br>
<font face="monospace">IO... yuv422p10le 3
20 10-10-10</font><br>
<font face="monospace">IO... yuv422p10be 3
20 10-10-10</font><br>
<font face="monospace">IO... yuv420p10le 3
15 10-10-10</font><br>
<font face="monospace">IO... yuv420p10be 3
15 10-10-10</font><br>
<font face="monospace">IO... y210le 3
20 10-10-10</font><br>
<font face="monospace">IO... p210le 3
20 10-10-10</font><br>
<font face="monospace">IO... p210be 3
20 10-10-10</font><br>
<br>
</blockquote>
The ffmpeg h264 encoder supports the following pixel formats (all):<br>
<br>
<blockquote><font face="monospace">ffmpeg -hide_banner -h
encoder=h264 | grep Supported</font><br>
<font face="monospace"> Supported pixel formats: yuv420p
yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv16 nv21
yuv420p10le yuv422p10le yuv444p10le nv20le gray gray10le</font><br>
<font face="monospace"> Supported pixel formats: bgr0 bgr24
rgb24</font><br>
<font face="monospace"> Supported pixel formats: yuv420p
yuvj420p</font><br>
<font face="monospace"> Supported pixel formats: nv12 yuv420p</font><br>
<font face="monospace"> Supported hardware devices: cuda cuda </font><br>
<font face="monospace"> Supported pixel formats: yuv420p nv12
p010le yuv444p p016le yuv444p16le bgr0 bgra rgb0 rgba x2rgb10le
x2bgr10le gbrp gbrp16le cuda</font><br>
<font face="monospace"> Supported hardware devices: qsv qsv qsv
</font><br>
<font face="monospace"> Supported pixel formats: nv12 qsv</font><br>
<font face="monospace"> Supported hardware devices: vaapi </font><br>
<font face="monospace"> Supported pixel formats: vaapi</font><br>
<br>
</blockquote>
I have run some rendering tests using some h264 8-bit and 10-bit
pixel formats as follows:<br>
<br>
Cinelerra Infinity - built: Jun 30 2024 08:31:40<br>
Libav version: Lavc61.3.100 <br>
<br>
<blockquote>Input file:<br>
3,3G cfhd01.mkv<br>
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>
<br>
Rendered to h264 8bit and 10bit pixel formats:<br>
<br>
72M h264_8bit_nv12.mp4<br>
** rendered 1780 frames in 46.067 secs, 38.639 fps<br>
Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc,
smpte170m/unknown/unknown, top first), 1920x1080 [SAR 1:1 DAR
16:9], 8462 kb/s<br>
<br>
72M h264_8bit_yuv420p.mp4<br>
** rendered 1780 frames in 48.250 secs, 36.891 fps<br>
Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc,
smpte170m/unknown/unknown, top first), 1920x1080 [SAR 1:1 DAR
16:9], 8462 kb/s<br>
<br>
83M h264_8bit_yuv422p.mp4<br>
** rendered 1780 frames in 41.807 secs, 42.577 fps<br>
Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuvj422p(pc,
smpte170m/unknown/unknown, top first), 1920x1080 [SAR 1:1 DAR
16:9], 9683 kb/s<br>
<br>
70M h264_10bit_yuv420p10le.mp4<br>
** rendered 1780 frames in 42.414 secs, 41.967 fps<br>
Video: h264 (High 10) (avc1 / 0x31637661), yuv420p10le(pc,
smpte170m/unknown/unknown, top first), 1920x1080 [SAR 1:1 DAR
16:9], 8213 kb/s<br>
<br>
80M h264_10bit_yuv422p10le.mp4<br>
** rendered 1780 frames in 42.920 secs, 41.473 fps<br>
Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p10le(pc,
smpte170m/unknown/unknown, top first), 1920x1080 [SAR 1:1 DAR
16:9], 9364 kb/s <br>
</blockquote>
<br>
References:<br>
Chroma Subsampling in ffmpeg<br>
<a class="moz-txt-link-freetext" href="https://trac.ffmpeg.org/wiki/Chroma%20Subsampling#SettingChromaSubsamplinginffmpeg">https://trac.ffmpeg.org/wiki/Chroma%20Subsampling#SettingChromaSubsamplinginffmpeg</a><br>
Preferred YUV Formats (Microsoft Windows, Learn)<br>
<a class="moz-txt-link-freetext" href="https://learn.microsoft.com/en-us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-formats#preferred-yuv-formats">https://learn.microsoft.com/en-us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-formats#preferred-yuv-formats</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>