C# – Play RTSP through VLC in VS2010 on 64bit machine

cpluginsrtspvisual studio 2010vlc

I am trying to play an RTSP stream on a Win form application on a 64 bit windows machine. I have added the VLC player as a COM component. But when i even try to play a stored video file it does not play.

axVLCPlugin1.addTarget("C:\\wildlife.wmv",
                       null,
                       AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo,
                       0);
axVLCPlugin1.play();

Am I missing anything?

Best Answer

Try adding "file:///" before the filepath. That should get it to play from a file.

Once that works, you can use VLC to create an RTSP stream.
1. in VLC, go to Media->stream
2. Under the File tab, click "Add" and select a video you wish to stream.
3. At the bottom, there is a button with a dropdown. Select stream and then click the button.
4. A window will pop up showing the source file path. Click "Next"
5. This window is where you select the output. Change the dropdown from "File" to "RTSP" and click "Add"
6. Choose a port number and a path. I will leave the port as 8554 and set the path to "/Test"
7. Click "Next" then click "Stream" You should see the VLC player start running, but the video will not play.

If you want to test to make sure the stream is working properly you can open another instance of vlc to view the stream.
1. Go to Media->Open Network Stream
2. enter "rtsp://127.0.0.1:8554/Test" as the network url.
3. Click play and it should begin streaming.

After verifying that the stream is running, close the second instance of VLC and in your application, set those two lines of code to be:

axVLCPlugin1.addTarget("rtsp://172.16.10.50:8554/Test", null, VLCPlaylistMode.VLCPlayListReplaceAndGo, 0);
axVLCPlugin1.Play();