Skip to content

v4l2videodec: copy colorimetry values to output_state caps

Qi Hou requested to merge (removed):transcoding into main

Transcoding using "v4l2h265dec ! v4l2h264enc" will fail with the reason that not-negotiated.

0:00:00.400327000 1714 0xaaaae9f26580 WARN GST_CAPS gstpad.c:3235:gst_pad_query_accept_caps_default:<v4l2h264enc0:sink> caps: video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)23/1 were not compatible with: video/x-raw, format=(string)NV12, width=(int)1920, height=(int)1080, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)23/1, colorimetry=(string){ bt601, smpte240m, bt709, 2:4:5:2, 2:4:5:3, 1:4:7:1, 2:4:7:1, 2:4:12:8, bt2020, 2:0:0:0 }

This is because there is no "colorimetry" in decoder output_state caps. Seungha Yang's commit in base repo set colorimetry as unknown and our v4l2videodec didn't add it back. In order to pass negotiation between v4l2h265dec and v4l2h264enc, it's necessary to copy colorimetry values to output_state caps.

`commit 660b5e4a Author: Seungha Yang seungha@centricular.com Date: Sat Oct 31 03:14:20 2020 +0900

videodecoder: Don't assume GstVideoChromaSite and GstVideoColorimetry

Even if given GstVideoChromaSite and/or GstVideoColorimetry has unknown
value(s), assumption for an unknown value should be done by subclass or
downstream element, not a role of video decoder. And subclass might
want to output unknown value as is.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/910>

`

Merge request reports