Search code examples
httpstreamingvlc

How to stream Video using VLC in http to other computer


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.


Solution

  • 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. ping 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. 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 After click on Stream this will open

    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. enter image description here

    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.

    Choose your Streaming Method

    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.

    Giving destination IP and PORT number

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

    Choose stream video and audio codec

    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.