Specifying Colorimetry

I’m having trouble finding any documents on how to set colorimetry for a video pipeline. I’m getting warnings that it needs to be specified for I420 and A420 files but whatever I have tried is not stopping the warnings. Also, the warnings indicate that it is being set to default colorimetry - can I let the pipeline be as-is if defaults are being set by GStreamer?

what’s the pipeline?

This is the part of the pipeline that’s generating warnings. This is one of many versions I have tried but always getting warnings. The file in question is encoded ffv1, yuv422p10le

data.p1 = create_pipeline_with_base_path(
"filesrc location=%s%s ! decodebin3 name=dec "
"dec. ! queue ! videoconvert ! capsfilter caps="video/x-raw,format=(string)YUV9,matrix=(string)bt601,colorimetry=(string)bt601" ! "
"videoconvert ! video/x-raw,format=(string)BGRA,colorimetry=(string)sRGB ! intervideosink channel=background "
“dec. ! queue ! audioconvert ! audioresample ! volume name=base_volume ! autoaudiosink”,
“Spiral.avi”, &error);

Maybe unrelated, but why are you chaining 2 videoconvert ? If you know the final format, use a single videconvert, I don’t see what a double conversion would bring, apart from potentially increased CPU usage.

You’re right, I have tried that, too, no different re: warnings. Does it cause issues to let videoconvert choose default settings? Why the warnings?

Can you share those warning messages?

0x7d4c34001780 WARN video-info video-info.c:200:validate_colorimetry: Need to specify a color matrix when using YUV format (I420) 0:00:00.058308423 617766 0x7d4c34001780 WARN video-info video-info.c:516:gst_video_info_from_caps: invalid colorimetry, using default 0:00:00.058297884 617766 0x7d4c340015c0 WARN video-info video-info.c:200:validate_colorimetry: Need to specify a color matrix when using YUV format (I420) 0:00:00.058330704 617766 0x7d4c340015c0 WARN video-info video-info.c:516:gst_video_info_from_caps: invalid colorimetry, using default 0:00:00.059436667 617766 0x7d4c34000b70 WARN aggregator gstaggregator.c:2283:gst_aggregator_query_latency_unlocked: Latency query failed 0:00:00.060107968 617766 0x7d4c340015c0 WARN video-info video-info.c:200:validate_colorimetry: Need to specify a color matrix when using YUV format (A420) 0:00:00.060114459 617766 0x7d4c340015c0 WARN video-info video-info.c:516:gst_video_info_from_caps: invalid colorimetry, using default 0:00:00.060120230 617766 0x7d4c340015c0 WARN video-info video-info.c:200:validate_colorimetry: Need to specify a color matrix when using YUV format (A420) 0:00:00.060123596 617766 0x7d4c340015c0 WARN video-info video-info.c:516:gst_video_info_from_caps: invalid colorimetry, using default 0:00:00.060157637 617766 0x7d4c34000b70 WARN video-info video-info.c:200:validate_colorimetry: Need to specify a color matrix when using YUV format (A420) 0:00:00.060167335 617766 0x7d4c34000b70 WARN video-info video-info.c:516:gst_video_info_from_caps: invalid colorimetry, using default 0:00:00.060178304 617766 0x7d4c34000b70 WARN video-info video-info.c:200:validate_colorimetry: Need to specify a color matrix when using YUV format (I420) 0:00:00.060183714 617766 0x7d4c34000b70 WARN video-info video-info.c:516:gst_video_info_from_caps: invalid colorimetry, using default 0:00:00.060247499 617766 0x7d4c34000b70 WARN video-info video-info.c:200:validate_colorimetry: Need to specify a color matrix when using YUV format (I420) 0:00:00.060256896 617766 0x7d4c34000b70 WARN video-info video-info.c:516:gst_video_info_from_caps: invalid colorimetry, using default

Can you share a GST_DEBUG=video-info:5 log?

it’s at https://pastebin.com/WhMMAj62

You’ll see that the pipeline has 2 different formats of videos, the .webm VP9 file is an overlay with alpha. I’d like to set correctly for both. This static pipeline doesn’t use intervideosrc, but my application has a dynamic pipeline and does use it. If that’s important, I can share further logs. I’m trying to give a simple example of where I am seeing the colorimetry warnings that are consistent in different pipelines.

Here is the pipeline that generated that debug log:

gst-launch-1.0 compositor name=comp sink_u0::xpos=0 sink_0::ypos=0 sink_1::xpos=0 sink_1::ypos=0 ! videoconvert ! autovideosink filesrc location=/home/ken/Desktop/Spiral/SpiralData/Spiral.avi ! decodebin ! videoconvert ! comp. filesrc location=/home/ken/Desktop/Spiral/SpiralData/spots.webm ! decodebin ! videoconvert ! comp.

Is this the simplest pipeline show-casing the issue?

Likely this is https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3479

Thanks. So can I allow those warnings with no consequences?

GST_DEBUG=2 gst-launch-1.0 filesrc location=/home/ken/Desktop/Spiral/SpiralData/spots.webm ! decodebin3 ! videoconvert ! autovideo
sink

It does seem that it’s just the VP9 files causing the warnings

A default colorimetry is set depending on the video format, it’s not 100% ideal but I suppose you can live with that :slight_smile:

1 Like

Thanks for the insights!