videoconvert to GRAY8 is very slow compared to BGR
I have this RTSP pipeline in my code:
rtspsrc protocols=tcp tcp-timeout=5000000 retry=5 location="rtsp://192.168.42.10:554/user=admin&password=&channel=1&stream=0.sdp/" ! rtph264depay ! h264parse ! avdec_h264 ! videoconvert ! video/x-raw,format=GRAY8 ! appsink max-buffers=25 drop=true sync=1 name=appsink
It's running on a RPi4 with Bookworm and GStreamer 1.22.0. The server is a IP camera that is sending I420 YUV video.
When I set video/x-raw,format=BGR
, the pipeline has no problems keeping up with 1080p @ 25fps, however when setting to video/x-raw,format=GRAY8
, the pipeline slows down significantly and I can only stream to 720p @ 15fps.
As a workaround, I keep video/x-raw,format=BGR
and convert to grayscale in python.
I'm wondering why the conversion to gray in GStreamer is so much slower.