简体   繁体   中英

Play RTSP through VLC in VS2010 on 64bit machine

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?

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();

I did a lot of research and found out that this is the best solution for playing RTSP streams on windows 64 bit machine through VS2010 - VLCDotNet

I am still looking for something similar in C++.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM