Gstreamer warning (does not support this file type). no element 'appsrc'

I am trying to open videowriter with gstreamer like so:"appsrc ! videoconvert ! x264enc ! rtspclientsink location=<rtsp server stream>", cv::CAP_GSTREAMER, 0, fps, (width, height), true);

However, during execution I get the following:

cv::CvVideoWriter_GStreamer::open OpenCV | GStreamer warning: OpenCV backend does not support this file type (extension): appsrc ! videoconvert ! x264enc ! rtspclientsink location=<rtsp server stream>

Does this mean it is treating the first parameter as a filename?

I checked the codebase for cap_gstreamer.cpp and somehow it seems it was not able to understand the pipeline entered.

encodebin.attach(gst_parse_launch(filename.c_str(), err.getRef()));
manualpipeline = (bool)encodebin;

manualpipeline is false causing it to evaluate the first parameter as a file.

Further digging, it seems appsrc is not a recognized element.
gst_parse_launch_full gives "no element \"appsrc\""

OpenCV 4.5.5
Video I/O:
DC1394: NO
FFMPEG: YES (find_package)
avcodec: YES (58.134.100)
avformat: YES (58.76.100)
avutil: YES (56.70.100)
swscale: YES (5.9.100)
avresample: NO
GStreamer: YES (1.19.2)
DirectShow: YES
Media Foundation: YES

Any idea why this is happening and how to fix this?