How to stream Video using VLC in http to other computer [closed]

佐手、 提交于 2021-01-27 13:20:51

问题


I want to stream a video from my computer to another computer using http in vlc. I have read the steps of how to do the streaming of the video from here https://wiki.videolan.org/Documentation:Streaming_HowTo_New/ But here they have explain how you can stream from the PC and use the same one to receive the video but I want to stream to the other computer.

Here what steps I have followed till now:

  1. Opening the VLC player
  2. Clicked on stream from media menu.
  3. Selected the file to stream.
  4. Now it is showing me the full path of the video so I clicked on next. 5.Now in the destination setup window I choosed http from drop down menu and click on Add but here the problem is it is only giving me the option to choose the port number and giving some path but not giving the option of entering the IP address of the receiver side.

If I didn't give any IP so how it will know where to stream, If in the above step I just click on next after choosing port number it will show me to choose codec If i choose the codec then in the next screen it will give me the stream string output, Now in this stream string output which is given below

:sout=#transcode{vcodec=hevc,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:duplicate{dst=http{mux=ffmpeg{mux=flv},dst=:8080/},dst=display} :no-sout-all :sout-keep

It is clearly visible that the dst=:8080 but it didn't mention on which IP it should stream. I just want to know how can I add the IP so that destination will look like dst= myReceiverIP:port.


回答1:


You just can't send the packets to any computer in the internet as they won't receive it because the routers will decline the packets coming from unknown resources so even if the VLC application in your system is showing that you are sending the stream properly it doesn't mean that it is reaching to the destination properly.

So then how can you send the stream to the PC available in the internet, First you have to make sure that whatever system you are sending the stream to should be present in the public sub net, It simply means you should be able to ping that system from your system, to check whether are you able to ping a system or not open your terminal in Ubuntu and then run the following command

ping destination_ip_address

if it is receiving the ping successfully that means you can stream your video to that ip. For example, I am showing you by ping to my own system.

As you can see there is 0% packet loss here.

Now after you check that you are able to ping the system now to stream the video follow the below steps:

  1. Open your VLC application.

  2. Now click on the Media from menu and then Stream from the menu list. Now you will see the same dialog as below

  3. Now click on ADD and choose the video which you wanted to stream and click on STREAM button on bottom. Now it will show you the below screen.

  4. Now click Next.

  5. Now here you have to select the streaming method so you choose http as you want but here I will use UDP for my convenience and also tick the display locally button.

  1. Now click on Add and you will be given option to enter the IP address of the system where you wanted to do the streaming and the port numbwe. I am giving my local ip here and the default port number but you need to enter your destination system IP and can choose any port but I will preferred to use the default one.

  1. Now click on next and choose your codecs of streaming I am just going with the default options.

  1. Now click on next and it will show you some string, So now click on Stream and now you are streaming your video to the destination IP

Now After performing the above steps successfully, Now in your Destination system. You need to do the following steps:

  1. Open the VLC application.
  2. Click on Media from the MENU bar and the Open Network Stream.
  3. Now you need to enter the URL to receive the stream. As I used the UDP so I will write it as udp://@:1234 here 1234 is the port number where I want my VLC to listen for the stream. Now click on play and after some seconds you will see your streamed video there. Voila you successfully streamed the video to the another system present on internet.



回答2:


I think you misunderstood what streaming means in this context. What vlc does with its http-stream feature is not "sending" a stream but rather providing a stream to be fetched by the receiver.

So it is totally fine that dst only allows to specify the port, because the IP is always the one of the PC providing the stream.

When you want to watch the stream you need to fetch the stream from the Computer VLC is running on. So on your viewing device, you need to type in http://ip-of-the-provider:8080 in your viewer of choice (eg. a second instance of VLC) It should not matte whether you are watching the stream on the same machine or a different one.

Be careful though: The Windows-Firewall sometimes prevents you from connecting to your stream, so you need to allow the streaming-instance of VLC to circumvent the internal firewall.




回答3:


in vlc media player search for network tab and tick checkbox stream output then tab settings and there you can set your ip address as shown in screenshot then your stream start streaming on provided ip and port

then select the stream and provide ip and port as shown in the screenshot



来源:https://stackoverflow.com/questions/65293175/how-to-stream-video-using-vlc-in-http-to-other-computer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!