Voxl-Mavcam-Manager Multiple RTSP Stream Setup
-
Hello all,
I am using the RTSP streams from a Starling 2 Max drone, it is unclear to me how
voxl-streamer
andvoxl-mavcam-manager
interplay with the produced RTSP streams. Ideally, I want to be able to automatically setup several streams for different cameras. I already have a setup to intercept the streams and just need to get the aircraft to broadcast the separate streams.- Based on the
voxl-streamer
documentation, it seems that it is the RTSP streams which are what QGC is using to display video. - The
voxl-mavcam-manager
documentation seems to indicate that it is the method by which QGC locates the necessary RTSP streams. - My understanding is that the
voxl-mavcam-manager
is what creates the other, camera components that are visible as mavlink heartbeats and which QGC can query to get the RTSP URI and send commands to. - However, I do not understand why the
voxl-mavcam-manager.conf
includes snapshot, video record pipes, and URI fields. - Is the URI assumed to be the input to
voxl-mavcam-manager
, where it can find the RTSP stream to send to QGC? Or is this the output, i.e. wherevoxl-mavcam-manager
will send the stream. Based on other wording in the doc I would assume the former but am not sure, I have not been able to view 2 streams from QGC. - Since it seems I will need to have 2 instances of
voxl-streamer
running, how can I set this up programmatically such that the 2 instances are started on startup. It does not seem like I can just add another streamer to thevoxl-streamer.conf
file. - If I want to have 2 streams running while not in SoftAP mode, how can I setup the uri? The documentation indicates that using auto ip is only possible when streaming a single RTSP stream.
- How can I manage 2 streams when connected over 4G/5G? Will I need to hardcode in the ip address of the drone?
I have not yet been able to get 2 streams to appear in QGC with the following
voxl-mavcam-manager.conf
:{ "mavcam_inputs": [{ "snapshot_pipe_name": "hires_front_snapshot", "video_record_pipe_name": "hires_front_large_encoded", "default_uri": "rtsp://192.168.8.1:8900/live", "enable_auto_ip": true, "mavlink_sys_id": 1 },{ "snapshot_pipe_name": "hires_down_snapshot", "video_record_pipe_name": "hires_down_large_encoded", "default_uri": "rtsp://192.168.8.1:8901/live", "enable_auto_ip": true, "mavlink_sys_id": 1 }] }
and a second stream started manually with
voxl-streamer -s
on port8901
.Any help is appreciated,
Griffin - Based on the
-
@griffin have you tried viewing the two streams outside of qgc? Like using VLC?
-
@tom yes, I have tried viewing the streams independently and verified that they work using gstreamer and opencv. For some reason VLC errors out but that seems to be a VLC issue
-
@tom regarding your previous response about
/etc/systemd/system/voxl-streamer.service
, I don't see a call to thevoxl-streamer.conf
file in there, only to the.pid
and binary files. Do you know how I can modify the configuration loaded into a secondaryvoxl-streamer
process? -
@griffin Sorry I deleted that response because I misread your question. I don't believe you need a second instance of voxl-streamer going.
I guess I'm a bit confused what isn't working. You're able to view both of the streams at the same time but not via. QGC?
-
@tom they do not appear in qgc when I manually start up the second streamer.
Your original response seemed promising to me, how can I automate starting up a second rtsp stream if not through the voxl-streamer?Additionally, I am not sure about the exact behavior of the different parameters for each mavcam in the
voxl-mavcam-manager.conf
, why exactly do I need to specify the pipes for video and and snapshots? Are they just for if mavlink commands are sent to start recording or capture a screenshot? But why do we need to send a video record command if the GCS is already receiving the video stream?Are the mavcams in the
.conf
file also what create the camera components that are visible as mavlink heartbeats when connected to the drone? Do you know what command I can use to request the RTSP URI via mavlink (as I assume QGC does)?Sorry for the barrage of questions, just trying to understand how to wrangle a mutlicam RTSP setup nicely.
-
@griffin You don't need to send a video record command in order to stream video to QGC but QGC will give you the option to start a recording therefore if you don't have the pipe specified correctly it won't be able to record. Same with the snapshots, it basically gives you the ability to take snapshots and camera recordings from higher res pipes than what you're actually streaming to QGC.
If you want to create a second voxl-streamer systemd service you can do the following:
cp /etc/systemd/system/voxl-streamer.service /etc/systemd/system/voxl-streamer2.service
You can then change the
ExecStart
line in the service file if you want to pass in additional args:
https://gitlab.com/voxl-public/voxl-sdk/services/voxl-streamer/-/blob/master/services/voxl-streamer.service?ref_type=heads#L17This is where the additional args are defined: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-streamer/-/blob/master/src/main.c?ref_type=heads#L373
You can then enable the service to start on boot with
systemctl enable voxl-streamer2
Y
-
@tom thanks! That seems to have allowed me to startup a second (and third) RTSP stream automatically which was my primary goal.
The reason I keep asking about QGC is because I am trying to get it so I can have my GCS automatically find any available RTSP streams, ideally without having to manually pass all of the individual URI. My understanding was that this is what the mavcam manager service is doing: creating mavlink camera objects which can be queried to get the rtsp streams, and that this is how QGC works. Since I do not yet have the querying setup I was trying to use QGC as test case, i.e. if QGC can do it, I should be able to do it with mavlink commands.
At the moment when I startup QGC and look at the camera output I see the following:
with myvoxl-mavcam-manager.conf
as above and my streamers:voxl2:/$ systemctl status voxl-streamer ● voxl-streamer.service - voxl-streamer Loaded: loaded (/usr/bin/voxl-streamer; enabled; vendor preset: enabled) Active: active (running) since Fri 2024-12-06 22:40:09 UTC; 44s ago Process: 1451 ExecStartPre=/bin/sleep 5 (code=exited, status=0/SUCCESS) Main PID: 1942 (voxl-streamer) Tasks: 2 (limit: 4915) CGroup: /system.slice/voxl-streamer.service └─1942 /usr/bin/voxl-streamer
voxl2:/$ systemctl status voxl-streamer2 ● voxl-streamer2.service - voxl-streamer Loaded: loaded (/usr/bin/voxl-streamer; enabled; vendor preset: enabled) Active: active (running) since Fri 2024-12-06 22:40:09 UTC; 53s ago Process: 1450 ExecStartPre=/bin/sleep 5 (code=exited, status=0/SUCCESS) Main PID: 1943 (voxl-streamer) Tasks: 2 (limit: 4915) CGroup: /system.slice/voxl-streamer2.service └─1943 /usr/bin/voxl-streamer -s -p 8901 -i hires_down_small_encoded
-
@griffin yes, voxl-mavcam-manager can inform QGC about the multiple streams and allow you to choose whichever one you want.
-
@Eric-Katzfey @tom unfortunately I don't see them in QGC with the 2 RTSP streams set up (and verified by connecting directly via openCV) and the
voxl-mavcam-manager.conf
as above.Additionally, if I request camera information via mavlink I get result
2
(denied) when I request from the drone and result4
(failed) when I request from the camera component.Even with my mavcam setup as above I only see 1 camera component heartbeat over mavlink, not the 2 that I thought would be started with 2 mavcams inside the
.conf
.