I have a camera which is only able to send raw bitmaps by ethernet. I have a C# web application which receives such frames in a buffer and works with them. I’m able to create a MJEPG stream from such frames, while I need a h264/webRTC stream playable in browser.
I think the easier way to do this is to have my C# application publish the MJPEG stream at a given endpoint, e.g. http:// server-address:server-port/my-mjpeg-stream, and to have openVidu trasnscode it to h264 and publish it by means of webRTC.
So, let’s assume I have the following entities
openVidu deployment
c# web application producing MJPEG stream
Java application instructing openVidu to create a connection and to parse the given MJPEG stream and publish a h264/webRTC stream from it
Browser playing the video stream in a html/javascript page.
I’ve checked the openvidu-ipcameras example but I don’t see a way of taking camera input stream from MJPEG. In particular I see that ConnectionProperties.Builder, has a rtspUri method while it has no mjpegURI or something like that.
Is there a way of feeding openVidu with a MJPEG stream?
if you are just really trying to stream this video into a browser, and not necessarily routing it through OpenVidu, I believe you should just be able to do it directly, as web browsers do have support for MJPEG: Include a MJPEG in a html-Site
You might even be able to skip your C# application; depending on how the camera works, by using the Fetch API to stream directly from the browser.
Thanks for the answer,
I’m afraid that would introduce too many steps (images > MJPEG > RTSP > openvidu) and I fear that would affect latency, which is important for me to stay as low as possible.
Thanks for the answer,
Yep I’m aware I can play MJPEG directly into the browser, that’s what I’m currently doing actually, but I want to avoid it since if I want a decent quality, the bandwitdh used is too much even for a local network deployment.
Hi,
not sure if I should be posting here or opening another thread.
I’ve tried using the REST API to public an IP_CAMERA stream like this (please note I’m using openvidu 2.23.0 inside a Docker by means of wsl) POST http://localhost:4443/openvidu/api/sessions/CUSTOM_SESSION_ID/connection
{
"timestamp": 1666607316719,
"status": 400,
"error": "Bad Request",
"message": "Error in parameter 'rtspUri': RTSP URI does not contain a valid protocol [file, rtsp, rtsps]",
"path": "/openvidu/api/sessions/CUSTOM_SESSION_ID/connection"
}
For the previous commit, I thought just the java client needed to be updated. Since the java client is just a wrapper around the REST API, I thought the REST API would work, but it doesn’t. Could you please help me out?