Testing new IP camera, need information on gstreamer pipeline for webrtc

I am trying to test the new Cockpit control station. One of my first tasks is to test my camera stream to the webRTC interface. WebRTC is new to me. I was hoping someone would be able to show me an example gstreamer pipeline that would take v4l video and pipe it via webRTC to Cockpit.
I have to bypass the BlueOS system, as I must perform actions on the video before it is sent to the topside.

Thanks for all help with this issue

Mark Kozikowski

Hi @mark !
Creating a webRTC stream is not necessary - BlueOS can handle all that! If by “perform actions” on the video you mean output the video from your own software, you just need to get the feed into mavlink camera manager. You can checkout this OakD stereo USB camera extension as an example of how an RTSP stream is created. This stream would have your modified video, and could be restreamed to Cockpit via the Video Streams configuration page. The stream must be H264 to work!

I’m curious, what actions do you modify the video stream with? Both Cockpit and QGC make overlaying telemetry data from the vehicle super easy!

Our system uses the video for alternate purposes as well as viewing. We modify frames with overlays, video enhancing, blurs … etc. We need to perform all of these actions prior to sending to the topside display.

I will check out the link you provided. Perhaps there is something there that I can apply.

Thanks,

Mark

@mark hey mark working on something similar. What you are looking for is the mavlink-camera-manager. That is the management interface for cameras that Cockpit will use to display with WebRTC.

Unfortunately, at this time, you cannot stream a directed packetize stream towards this service to be recognized and picked up to display. It only understands Video4Linux devices, and a “Redirect” source that works with RTSP streams. It will utilize the “typefinder” in gstreamer to pick up the caps information from your stream. I may open up a feature ticket in the future to allow you to specify the caps information in the http request when you go to register the stream. But for now, redirect from an RTSP stream is the best option.

2 Likes

Noting that MAVLink Camera Manager has had some initial ONVIF support since t3.16.1 (in October last year), so depending on how the IP camera presents itself it may actually be detected.

@joaoantoniocardoso may have more insight into what features are and aren’t available currently.

Hello @EliotBR

Can you give an example of how to add an IP camera to MCM via onvif?

Best regards

Hi @Andres,

João is away at the moment, and I unfortunately haven’t yet had a chance to play with the feature so don’t know a lot about it. The little I remember from internal discussions was that it should auto-detect the camera and list it in the BlueOS Video Streams page, where it should be possible to set up a redirect for it :slight_smile:

In the absence of proper documentation it may help to look through the relevant pull requests that added the functionality, but otherwise you’ll likely need to wait until João returns, unless @patrickelectric is able to provide some extra information already.

We are still working on a better integration of the onvif support on the camera manager and in BlueOS, at the moment, if you are running the latest beta version (1.4.0-beta.10) you’ll be able to see available onvif cameras under http://192.168.2.2:6020/onvif/devices.
The idea is to show the options under video streams in BlueOS and allow the creation of such streams automatically. But we are still figuring out some things related to RTSP authentication and more. Work is still necessary but the base is already available.
The idea in the future is that camera controls and camera discovery for IP cameras will work as well as video4linux interface for the user in mavlink camera manager.

2 Likes

Thanks for the reply @EliotBR and @patrickelectric

I was able to connect the camera via onvif via rtsp in MCM, by removing the credentials. Now I can access http://localhost:6020/onvif/divices

Two automatic connections open in MCM, but I don’t know what to do with them. Is it supposed to be possible to control the IP cameras with their configuration functions automatically as is done in other CCTV software (zoom, Focus, etc)? Or will I have to create additional routes for this?

best regards