ofxGstreamer Esp32-cam / RPi cam

Hi all,

Using OF 10.1.

Going through all the threads for ofxGstreamer solutions and still a bit lost as to how to figure out the commands and arguments for client and server side on different IP cameras. I managed to make it work with the pi4 and the HQ cam:

on the RasPi side using the command line:

raspivid -n -h 972 -w 1296 -b 10000000 -fps 30 -vf -hf -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=CLIENT_IP port=5001

on the OF side using ofGstVideoUtils gst;

gst.setPipeline("udpsrc port=5001 ! application/x-rtp,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! videoconvert", OF_PIXELS_RGB, **true**);

I am trying to do the same with the esp32-cam but I’m unsure about which arguments to use on both the Arduino IDE and OF to create the pipeline:
this is what the serial monitor in Arduino shows when the stream connects to VLC:
Stream Link: rtsp://
Creating TSP streamer
Created streamer width=800, height=600
Creating RTSP session
RTSP received SETUP
RTSP received PLAY

from looking at other people’s posts I think the gst.setPipeline would look something like this:

gst.setPipeline("rtspsrc location=rtsp://admin:admin@192.168.178:8554/cam/realmonitor?channel=1&subtype=1 latency=0 ! rtpjpegdepay ! jpegdec ! queue ! decodebin ! videoconvert", OF_PIXELS_MONO, **true**, w, h);

but even though it compiles there is no stream and I get this error:

**[notice ] ofGstUtils: setPipelineWithSink(): gstreamer pipeline: rtspsrc location=rtsp://admin:admin@ latency=0 ! rtpjpegdepay ! jpegdec ! queue ! decodebin ! videoconvert ! appsink name=ofappsink enable-last-sample=0 caps="video/x-raw, format=GRAY8, width=800, height=600"**

**[ error ] ofGstUtils: gstHandleMessage(): embedded video playback halted for plugin, module rtspsrc0 reported: Could not read from resource.**

Any clues as to how I can make the pipeline work?

are you using a custom firmware on esp32-cam? can you access it via browser?

Hi thanks for the prompt reply,

I’m using the example sketch for the esp32-cam CameraWebServer and it works perfectly with the browser.

Since I last posted, I realised that @jvcleave’s ofxIpVideoGrabber is more suitable for mjpg streams, which is what the esp32-cam sends. The example sketch definitely works with other IP cams on the internet. It looks like there is a timeout issue in OF after it connects to the esp32-cam (see the debug window). You can see the stream is working in this image as well as the mjpg files being sent in the serial monitor of the Arduino ide:

I think it could be something to do with the arguments in the line grabber.setURI(). I have tried different resolutions but I’m still getting the Timeout message.

Solved it by using a different arduino sketch that didn’t open the stream in the browser. There seems to be limits for how many clients you can use with the esp-32 cam.