Live view multiple RTSP streams efficiently

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Quaker56
New Cone
New Cone
Posts: 4
Joined: 12 Dec 2016 14:58

Live view multiple RTSP streams efficiently

Postby Quaker56 » 15 Dec 2020 01:06

I have two IP cameras that I like to monitor so I can be aware when customers are arriving. Watching one via RTSP stream straight up in VLC uses 1% CPU which is great. So, when I'm at work I fire up two VLC instances and move them into the corner of one of my monitors where they sit the rest of the day and only sip a measly 2%. The video doesn't lag, it's great compared to watching in the camera system's browser interface which used 20% and lagged hard.

Wanting to make things easier on myself I figured I would spin up a 'mosaic' with VLC so the two cams open with a single click and are bonded into one VLC instance. Well, that works nice but it uses 6% CPU as compared to 2%, probably because it's transcoding the two videos into a new one on the fly. Fair enough because I guess that's what I asked for... but between the choices I'll stick with the 2% dual instances and 10 seconds of manual daily positioning.

But... before I throw in the towel I figured it best to ask if there are any other suggestions for showing two streams side by side while retaining the better resource efficiency. The two RTSP streams are from identical cameras, same resolution (low 640x360), same framerate(15), and I don't want any audio. I would also be happy scripting the two separate VLC instances to launch at specified screen positions just to save the manual handling each day but I don't seem to be able to get the --video-x and --video-y settings to work, but that's a different topic... I just wanted to mention that it has been though of.

Thank you.

Quaker56
New Cone
New Cone
Posts: 4
Joined: 12 Dec 2016 14:58

Re: Live view multiple RTSP streams efficiently

Postby Quaker56 » 15 Dec 2020 14:20

Additional thoughts... I could offload the mosaic creation and transcoding from my computer to the camera system computer and have it spit out a new 'ready to view' RTSP stream. In-fact, other people in the office could then tap it too. Below is the output line from my conf-vlm file that works to display the mosaic locally. What do I need to add to for it to output an RTSP stream?

setup mosaic output #transcode{sfilter=mosaic,vcodec=mp4v,vb=8500,acodec=none,fps=15,scale=1}:display

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Live view multiple RTSP streams efficiently

Postby Rémi Denis-Courmont » 15 Dec 2020 15:37

There are no ways to merge two encoded videos. You need to decode both, stitch and encode back the result. And then the client will decode again. So yes, it's going to be much slower.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Quaker56
New Cone
New Cone
Posts: 4
Joined: 12 Dec 2016 14:58

Re: Live view multiple RTSP streams efficiently

Postby Quaker56 » 15 Dec 2020 17:33

Thanks for the reply. Are you able to tell me how to have the mosaic output as a new RTSP stream? (I'm on Linux with VLC 3.0.9.x if that matters)

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Live view multiple RTSP streams efficiently

Postby Rémi Denis-Courmont » 15 Dec 2020 17:42

Not on top of my head. See the documentation.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Quaker56
New Cone
New Cone
Posts: 4
Joined: 12 Dec 2016 14:58

Re: Live view multiple RTSP streams efficiently

Postby Quaker56 » 15 Dec 2020 17:56

I did, and made several attempts, but I will revisit it and try again. Thanks.

acffilterece
Blank Cone
Blank Cone
Posts: 15
Joined: 01 Dec 2020 15:48
Operating System: Linux

Re: Live view multiple RTSP streams efficiently

Postby acffilterece » 15 Dec 2020 19:33

...and have it spit out a new RTSP stream...
Suggestion: use FFmpeg with the h-, vstack filters, then use ffserver to stream the encoded content. Note that, depending on codec, number of stacked streams, computer power, and eventual post-processing done, the encoded stream is either too big for your network to handle, or encoding is slow enough to not be realtime. Try libtheora, libvpx/-vp9, libxvid, mpeg1/2video (all free encoders, most in libavcodec, if your ffmpeg doesn't have it, get one of john van sickle's builds).


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 18 guests