I am developing an app in .net using libvlcsharp VideoView control. I need to pull multicast streams from cameras and so I want to set the command line parameter --rtsp-mcast.
The purpose of the app is to stress test a video system using a large number of camera streams but I have a limited number of cameras so I need multiple streams coming from a few cameras.
e.g. what it would look like using vlc
vlc --rtsp-mcast rtsp://<ip>/axis-media/media.amp
How I test. I run the above once and note the network traffic in task manager and Resouce monitor then I run the same command again and see that the network traffic didn't increase. Also I use:
netstat -aon
I look up the PID of each instance of vlc and find that both are using the same two UDP ports to send and receive data.
However when I use the following code to initialize LibVLC
singleLibVLC = new LibVLC(" --rtsp-mcast " );
and run with two streams from the same camera the network traffic doubles and that there are two different ephemeral TCP ports open for the PID assigned to my test application.
I understand the "--rtsp-mcast" directive is ultimately forwarded to the live555 module. Is this the problem? It's not possible to get there from here. Or... is there a different way to pass this parameter?
Also is there something that needs to be done in the application to allow for the UDP transport to work. It seems that either VLC or the axis camera defaults to TCP if it can't find a way to use the UDP connection.
@mfkl, Removed leading spaces for command line options as in
singleLibVLC = new LibVLC("--verbose=2 --rtsp-mcast");
This gets me using UPD for both copies of stream but each stream is using a different pair of ports.
I modified my command line test as follows:
vlc --verbose=2 --file-logging --logfile="%appdata%\vlc\out.log" --rtsp-mcast rtsp://etc.
Comparing to vlc log in visual studio output window.
singleLibVLC = new LibVLC(" --rtsp-mcast " );
Remove the spaces at the beginning and end of your string.
Share the full logs, add "--verbose=2" to LibVLC ctor.
Or... is there a different way to pass this parameter?
media.AddOption(":rtsp-mcast")
though I doubt it'd work any better.
Also is there something that needs to be done in the application to allow for the UDP transport to work
Using udp://blabla
as a media MRL would be a way.
Compare verbose logging of VLC (where it works) with your libvlc based app (where it doesn't work), this is a good way to troubleshoot what steps might be missing from your app, that the VLC app does automagically.