Unable to Link videotestsrc to textoverlay Due to Unsupported Caps

Description:

When attempting to create a GStreamer pipeline using the following command:

gst-launch-1.0 -e -v videotestsrc pattern=black is-live=true ! video/x-raw(memory:GBM),width=1920,height=1080,framerate=30/1 ! textoverlay text="Errors" ! fakesink

I encountered a warning indicating the pipeline was erroneous and couldn’t link videotestsrc to textoverlay. The specific error message was:

WARNING: erroneous pipeline: could not link videotestsrc0 to textoverlay0, videotestsrc0 can't handle caps video/x-raw(memory:GBM), width=(int)1920, height=(int)1080, framerate=(fraction)30/1

Expected Behavior:
The videotestsrc element should be able to link to the textoverlay element without encountering any errors, allowing the overlay of text on the video feed.

Actual Behavior:
The pipeline fails to link videotestsrc to textoverlay due to incompatible caps. The warning suggests that videotestsrc0 cannot handle the specified caps, particularly the format with memory type “GBM” and the resolution of 1920x1080 at a framerate of 30 frames per second.

Steps to Reproduce:

  1. Run the following command in a GStreamer environment:
    gst-launch-1.0 -e -v videotestsrc pattern=black is-live=true ! video/x-raw(memory:GBM),width=1920,height=1080,framerate=30/1 ! textoverlay text="Errors" ! fakesink
    

Additional Information:

  • Operating Environment:

NAME=“Ubuntu”
VERSION=“18.04.6 LTS (Bionic Beaver)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 18.04.6 LTS”
VERSION_ID=“18.04”
HOME_URL=“https://www.ubuntu.com/
SUPPORT_URL=“https://help.ubuntu.com/
BUG_REPORT_URL=“Bugs : Ubuntu
PRIVACY_POLICY_URL=“Data privacy | Ubuntu
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

  • GStreamer Version

gst-launch-1.0 version 1.14.5
GStreamer 1.14.5

You may use :

# Look at SRC caps, does it provide type video/x-raw(memory:GBM) ?
gst-inspect-1.0 videotestsrc

# Look at SINK (input) caps, does it accept type video/x-raw(memory:GBM) ?
gst-inspect-1.0 textoverlay

If specified caps don’t match both src and sink pads of elements around, then it is expected that the pipeline cannot be created and have the error messages you see.

Also note that depending on your shell, the parenthesis may be interpreted by the shell. In such case you may use single quotes for the caps such as: 'video/x-raw(memory:GBM),...'

If just using system memory (video/x-raw), does it work ?

gst-launch-1.0 -e -v videotestsrc pattern=black is-live=true ! video/x-raw,width=1920,height=1080,framerate=30/1 ! textoverlay text="Errors" ! fakesink