Forcing RGB caps on avdec_h264

Tim-Philipp Müller t.i.m at zen.co.uk
Fri Sep 3 14:50:04 UTC 2021


Hi,

> When I set an RGB capsfilter after avdec_h264 I always get a
> negotiation failed error once I start receiving the h264 stream. I'm
> not sure why this happens as the sink caps do include RGB.
> 
> How do I get around this?

You can't.

These decoder elements are created dynamically on the fly based on what
ffmpeg provides, and the possible source caps advertised are basically
all the possible caps that any decoder might output. The actual H.264
decoder will likely only support a very small range of those caps, and
they will depend on the input stream.

You can add a videoconvert element after the decoder to convert to RGB
if that's what you need.

Cheers
 Tim



More information about the gstreamer-devel mailing list