Page 1 of 1

Multiple AxVLCPlugin2 in C#

Posted: 06 Sep 2012 01:07
by markmoran87
Hi,

I am fairly new to writting code so appologies if i am missing something silly.

I am trying to create an application using the AxVLCPlugin2 using Visual Studio C# 2010. I have managed to get one video stream (rtsp) working nicely, however i need to have multiple streams at once. I have added multiple "AxVLCPlugin2" from the toolbox however when i try to play more than one i lose another, for example if i set "Video 1" to play it works ok, if i then set "Video 2" to play i lose "Video 1" but "Video 2" is ok.

Heres the code i am using to start 3 streams when a button is clicked:

VideoIcon1.playlist.items.clear();
string Options1 = ":rtsp-caching=250"; //Cache in mS
int StreamNo1 = VideoIcon1.playlist.add("rtsp://192.168.1.153/stream1.sdp", "VideoIcon1", Options1);
VideoIcon1.playlist.playItem(StreamNo1);

VideoIcon2.playlist.items.clear();
string Options2 = ":rtsp-caching=250"; //Cache in mS
int StreamNo2 = VideoIcon2.playlist.add("rtsp://192.168.1.157/stream1.sdp", "VideoIcon2", Options2);
VideoIcon2.playlist.playItem(StreamNo2);

VideoIcon3.playlist.items.clear();
string Options3 = ":rtsp-caching=250"; //Cache in mS
int StreamNo3 = VideoIcon3.playlist.add("rtsp://192.168.1.158/stream1.sdp", "VideoIcon3", Options3);
VideoIcon3.playlist.playItem(StreamNo3);

Does anyone have any ideas where i could be going wrong? Any help would be much appreciated.

Thanks,

Mark

Re: Multiple AxVLCPlugin2 in C#

Posted: 06 Sep 2012 02:40
by markmoran87
I have just noticed that it may not be a problem with my code. I have just tried to play the same network streams using multiple instances "VLC Media Player" and i get the same problem, when i play a video from another IP address the first one stops (even though its playing on another instance of VLC Media Player). The video streams i am looking at come from 4 Input IP encoders and i have just found that if i look at a different stream on each one it works.

For example if i want to see stream number 1 of each encoder this doesn't work, the urls are:

=rtsp://192.168.1.153/stream1.sdp //Encoder 1 - Stream 1
=rtsp://192.168.1.157/stream1.sdp //Encoder 2 - Stream 1
=rtsp://192.168.1.158/stream1.sdp //Encoder 3 - Stream 1

Even though the IP addresses are different it doesn't like the "stream1.sdp" being the same?

If i set up to look at one different video from each encoder it works fine and i can see 3 video's, the urls are now:

=rtsp://192.168.1.153/stream1.sdp //Encoder 1 -Stream 1
=rtsp://192.168.1.157/stream2.sdp //Encoder 2 -Stream 2
=rtsp://192.168.1.158/stream3.sdp //Encoder 3 -Stream 3

However this is no good for me as i need to see all four streams of each encoder, so 12 streams:

=rtsp://192.168.1.153/stream1.sdp
=rtsp://192.168.1.153/stream2.sdp
=rtsp://192.168.1.153/stream3.sdp
=rtsp://192.168.1.157/stream1.sdp
=rtsp://192.168.1.157/stream2.sdp
=rtsp://192.168.1.157/stream3.sdp
=rtsp://192.168.1.158/stream1.sdp
=rtsp://192.168.1.158/stream2.sdp
=rtsp://192.168.1.158/stream3.sdp

Anyone got any suggestions on how to get around this?

Thanks,

Mark

Re: Multiple AxVLCPlugin2 in C#

Posted: 06 Sep 2012 08:22
by Alexolut
Hello, Mark.
Are you using multicast or unicast connection?
May be problem is in same network port number.
What differs in settings between =rtsp://192.168.1.157/stream1.sdp and =rtsp://192.168.1.157/stream2.sdp besides name ofcourse?

Re: Multiple AxVLCPlugin2 in C#

Posted: 07 Sep 2012 01:26
by markmoran87
I am using an rtsp unicast connection.

The only other thing that differs is the port number, which is port 10000 for stream1.sdp 20000 for stream2.sdp etc.

I have tried setting the port numbers all different though, i.e. 10000 for stream1.sdp on encoder 1 and 10001 for stream1.sdp on encoder 2, but still didn't work.

Thanks,

Mark

Re: Multiple AxVLCPlugin2 in C#

Posted: 25 Sep 2012 12:11
by Alexolut
Try another video source and play simultaneously in different vlc instances (same source for all instances). Do you have initial problem in this case?