Guangyu Sun
34bff02984
avcodec/libvpxenc: fix sRGB colorspace for non-RGB pixel formats
...
When encoding VP9 with a YUV pixel format (e.g. yuv420p) and
AVCOL_SPC_RGB colorspace metadata, libvpxenc unconditionally set
VPX_CS_SRGB. This produced a spec-violating bitstream: Profile 0
(4:2:0) with sRGB colorspace, which is only valid for Profile 1/3
(4:4:4). The resulting file is undecodable.
Fix this by setting ctx->vpx_cs to VPX_CS_SRGB in set_pix_fmt()
for 4:4:4 YUV formats when AVCOL_SPC_RGB is set, matching the
existing GBRP path. This covers the legitimate case of RGB data in
YUV444 containers (e.g. H.264 High 4:4:4 with identity matrix).
With this change, any AVCOL_SPC_RGB that reaches the switch in
set_colorspace() is guaranteed to be a subsampled format where
sRGB is invalid. Return an error so the user can fix their
pipeline rather than silently producing incorrect output.
To reproduce:
ffmpeg -f lavfi -i testsrc=s=64x64:d=1:r=1 \
-c:v libvpx-vp9 -pix_fmt yuv420p -colorspace rgb bad.webm
ffprobe bad.webm
# -> "vp9 (Profile 0), none(pc, gbr/...), 64x64"
ffmpeg -i bad.webm -f null -
# -> 0 frames decoded, error
See also:
https://issues.webmproject.org/487307225
Signed-off-by: Guangyu Sun <gsun@roblox.com >
Signed-off-by: James Zern <jzern@google.com >
2026-03-17 13:39:59 -07:00
..
2026-03-14 21:23:53 +01:00
2026-03-17 20:37:53 +00:00
2026-01-25 22:53:25 +01:00
2026-03-15 19:27:07 -03:00
2026-02-18 13:57:28 +00:00
2026-01-25 22:53:25 +01:00
2026-01-25 22:53:25 +01:00
2026-03-16 11:51:49 +01:00
2026-01-25 22:53:25 +01:00
2026-03-17 16:40:05 +00:00
2026-03-05 14:02:39 +00:00
2026-02-25 12:08:33 +01:00
2026-03-14 19:31:45 +01:00
2026-02-11 12:07:35 +01:00
2026-02-23 07:57:57 +01:00
2026-02-14 20:14:47 +01:00
2026-01-23 14:40:52 +01:00
2026-03-03 01:10:09 +01:00
2026-02-12 10:34:19 +01:00
2026-02-11 12:07:35 +01:00
2026-03-07 19:21:38 -03:00
2026-03-11 10:23:35 +01:00
2026-03-11 10:23:35 +01:00
2026-03-11 10:23:35 +01:00
2026-03-11 10:23:35 +01:00
2026-03-11 10:23:35 +01:00
2026-03-11 10:23:35 +01:00
2026-02-11 12:07:35 +01:00
2026-02-11 12:07:35 +01:00
2026-03-13 04:39:52 +01:00
2026-02-11 12:07:35 +01:00
2026-02-11 12:07:35 +01:00
2026-03-14 19:31:44 +01:00
2026-03-14 19:31:45 +01:00
2025-12-18 01:24:35 +00:00
2026-02-11 12:07:35 +01:00
2026-02-11 12:07:35 +01:00
2026-03-03 13:52:58 -03:00
2026-03-06 23:18:35 -03:00
2026-02-12 09:59:54 -03:00
2026-03-07 20:14:36 +01:00
2026-02-28 16:14:40 -03:00
2026-02-15 20:09:54 +01:00
2026-02-11 12:07:35 +01:00
2026-01-10 18:56:26 +00:00
2026-03-15 19:27:07 -03:00
2025-12-24 12:21:39 -03:00
2026-03-10 13:52:18 +01:00
2026-02-24 10:32:20 -03:00
2026-02-24 10:32:20 -03:00
2026-02-24 10:32:20 -03:00
2026-03-14 21:23:17 +01:00
2026-02-24 10:32:20 -03:00
2026-03-15 19:20:06 -03:00
2026-03-15 19:20:06 -03:00
2026-02-28 16:12:33 -03:00
2026-02-28 16:12:33 -03:00
2026-03-13 09:18:42 -03:00
2026-02-28 16:12:33 -03:00
2026-02-24 10:32:20 -03:00
2026-02-24 10:32:20 -03:00
2026-02-24 10:32:20 -03:00
2026-03-10 13:52:18 +01:00
2026-02-18 23:45:28 +00:00
2026-02-18 23:45:28 +00:00
2026-02-18 23:45:28 +00:00
2026-02-11 12:07:35 +01:00
2026-03-07 19:22:14 -03:00
2026-03-07 19:21:38 -03:00
2026-02-11 12:07:35 +01:00
2026-02-25 08:47:14 +00:00
2026-03-04 14:25:00 +00:00
2026-02-25 08:47:14 +00:00
2026-02-25 08:47:14 +00:00
2026-02-25 08:47:14 +00:00
2026-02-05 18:12:46 +01:00
2026-02-11 12:07:35 +01:00
2026-03-13 09:18:42 -03:00
2026-02-11 12:07:35 +01:00
2026-01-07 13:14:11 +00:00
2026-01-07 13:14:11 +00:00
2026-02-12 11:06:33 +01:00
2026-02-11 12:07:35 +01:00
2026-02-11 12:07:35 +01:00
2026-03-10 13:52:18 +01:00
2026-02-05 16:29:08 +01:00
2026-03-10 13:52:19 +01:00
2026-03-02 12:01:15 +01:00
2026-02-17 20:17:23 -03:00
2026-03-03 13:07:46 +01:00
2026-03-03 13:07:46 +01:00
2026-02-14 18:52:43 +00:00
2026-03-14 23:24:11 +01:00
2026-02-11 12:07:35 +01:00
2026-02-19 19:42:34 +01:00
2026-02-19 19:42:34 +01:00
2026-02-19 19:42:31 +01:00
2026-03-10 19:31:00 +01:00
2026-02-19 19:42:30 +01:00
2026-02-10 19:44:46 +01:00
2026-02-23 22:59:44 +01:00
2026-03-10 13:52:19 +01:00
2025-12-23 14:34:13 +00:00
2026-02-20 11:59:37 +01:00
2026-03-02 18:41:13 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-03-07 20:14:36 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-25 22:53:25 +01:00
2026-01-25 22:53:25 +01:00
2026-01-25 22:53:25 +01:00
2026-03-02 17:51:45 +01:00
2026-03-14 16:52:58 +00:00
2026-03-03 13:07:46 +01:00
2026-01-25 22:53:25 +01:00
2026-01-25 22:53:25 +01:00
2026-03-15 19:20:06 -03:00
2026-03-15 19:20:06 -03:00
2026-03-15 17:25:12 -03:00
2026-02-26 11:40:09 +08:00
2026-02-11 12:07:35 +01:00
2026-02-23 23:28:09 +01:00
2026-03-10 13:52:19 +01:00
2026-03-04 22:31:19 +00:00
2026-03-04 22:31:19 +00:00
2026-03-01 12:04:14 +01:00
2026-03-01 11:58:16 +01:00
2026-03-01 11:58:16 +01:00
2026-02-11 12:07:35 +01:00
2026-02-23 23:58:11 +01:00
2026-02-23 23:50:49 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-03-15 17:25:12 -03:00
2026-03-03 00:35:21 +01:00
2026-03-02 18:12:40 +01:00
2026-02-20 16:32:10 +01:00
2026-02-20 16:32:10 +01:00
2026-02-20 16:32:10 +01:00
2025-12-30 17:30:45 +00:00
2025-12-16 10:38:56 -03:00
2026-03-09 18:39:33 -03:00
2026-03-13 09:18:42 -03:00
2026-02-28 16:12:33 -03:00
2026-03-13 09:18:42 -03:00
2026-03-13 09:18:42 -03:00
2026-03-13 16:09:40 +00:00
2026-03-13 16:09:40 +00:00
2026-03-13 02:49:59 +01:00
2025-12-28 15:31:13 -03:00
2025-12-22 07:05:58 +01:00
2026-02-11 12:07:38 +01:00
2025-12-28 15:32:57 -03:00
2026-02-17 20:17:23 -03:00
2025-12-24 02:43:50 +00:00
2026-02-12 09:59:54 -03:00
2026-01-29 14:08:15 +01:00
2026-02-17 20:17:23 -03:00
2026-02-12 09:59:54 -03:00
2026-02-17 20:17:23 -03:00
2026-02-25 16:43:53 +01:00
2025-12-14 18:22:04 -03:00
2025-12-14 17:34:57 -03:00
2026-02-21 22:43:41 +00:00
2026-02-18 23:38:16 +00:00
2026-02-17 20:17:23 -03:00
2026-02-15 20:28:31 +01:00
2026-03-17 13:39:59 -07:00
2026-01-25 13:09:30 +08:00
2025-12-14 10:16:25 +01:00
2026-02-05 16:29:08 +01:00
2026-02-11 12:07:35 +01:00
2026-03-06 23:25:29 +01:00
2026-03-14 20:50:21 -03:00
2025-12-19 19:56:13 +02:00
2026-02-23 22:54:38 +01:00
2026-02-11 12:07:35 +01:00
2026-01-17 12:02:31 -03:00
2026-02-11 12:07:35 +01:00
2025-12-30 17:30:45 +00:00
2026-02-20 16:32:10 +01:00
2026-03-12 14:47:01 +01:00
2026-03-12 14:47:01 +01:00
2026-03-07 20:14:36 +01:00
2026-01-22 17:44:46 -03:00
2026-01-20 00:38:35 +00:00
2026-03-10 13:52:19 +01:00
2026-02-11 12:07:35 +01:00
2026-02-11 12:07:35 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-03-07 20:14:36 +01:00
2026-03-07 20:14:36 +01:00
2026-03-03 13:07:46 +01:00
2026-03-04 10:40:12 +00:00
2026-03-10 13:52:18 +01:00
2026-03-07 20:14:36 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-02-13 09:21:33 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-02-20 16:32:10 +01:00
2026-02-11 12:07:35 +01:00
2026-01-05 13:30:38 +00:00
2026-03-16 18:18:12 +00:00
2026-02-17 16:36:51 +00:00
2026-03-10 15:08:16 +00:00
2026-01-27 12:58:46 +00:00
2026-01-27 12:58:46 +00:00
2026-01-19 20:47:22 +00:00
2026-02-11 12:07:35 +01:00
2026-03-07 20:14:36 +01:00
2026-02-11 12:07:35 +01:00
2026-03-07 19:21:44 -03:00
2026-03-07 19:22:40 -03:00
2026-02-11 12:07:35 +01:00
2026-02-11 12:07:35 +01:00
2026-01-10 22:47:22 +01:00
2026-01-10 22:47:22 +01:00
2026-02-04 12:05:35 +08:00
2026-02-04 12:05:35 +08:00
2026-01-11 00:47:17 +00:00
2026-03-06 02:33:59 +01:00
2026-02-14 18:53:08 +00:00
2026-03-05 14:02:39 +00:00
2026-03-05 14:02:39 +00:00
2026-03-05 14:02:39 +00:00
2026-03-05 14:02:39 +00:00
2026-02-11 20:35:20 +00:00
2026-03-13 09:18:42 -03:00
2026-02-03 18:17:32 +00:00
2026-02-11 12:07:35 +01:00
2025-12-31 08:06:48 +00:00
2026-02-11 12:07:35 +01:00
2026-02-09 17:36:40 +00:00
2026-02-13 09:21:33 +01:00
2026-03-10 13:52:19 +01:00
2026-03-07 20:14:36 +01:00
2026-03-07 20:14:36 +01:00
2026-03-07 20:14:36 +01:00
2026-02-19 22:39:35 +00:00
2026-01-20 09:47:47 +00:00
2026-02-11 12:07:31 +01:00
2026-02-11 12:07:35 +01:00
2026-03-02 19:01:46 +01:00
2026-02-22 22:05:16 +01:00
2026-03-02 19:01:46 +01:00
2026-03-05 01:23:40 +01:00
2026-01-25 22:53:25 +01:00
2026-02-11 12:07:35 +01:00
2026-02-23 23:26:20 +01:00
2026-02-11 12:07:35 +01:00
2026-03-06 23:08:03 +01:00
2026-03-10 13:52:18 +01:00
2026-01-02 18:39:48 +01:00
2026-01-17 17:56:06 -03:00
2026-03-12 14:47:01 +01:00
2026-03-17 13:39:59 -07:00
2026-02-11 12:07:35 +01:00
2026-03-03 02:41:05 +01:00
2026-03-10 13:52:19 +01:00
2026-03-03 02:13:58 +00:00
2026-01-21 10:42:02 +00:00
2026-01-19 16:37:16 +01:00
2026-02-19 19:42:31 +01:00
2025-12-31 15:00:46 +01:00
2026-03-07 15:14:25 +01:00
2026-02-19 19:42:31 +01:00
2026-02-19 19:42:26 +01:00
2025-12-30 14:39:08 -05:00
2025-12-30 14:39:08 -05:00
2026-02-23 15:29:27 +00:00
2026-03-10 13:52:18 +01:00
2026-02-11 12:07:35 +01:00
2026-02-11 12:07:35 +01:00
2026-01-02 18:39:48 +01:00
2026-03-13 23:22:54 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-01-02 18:39:48 +01:00
2026-03-16 10:24:33 +00:00