Home Blog Blogs How to play streams in vlc media player?

How to play streams in vlc media player?

19.09.2023
How to play streams in vlc media player?

How to play streams in VLC media player?

Table of Contents

1. How to play UDP stream in VLC?

2. How to play RTSP stream in VLC?

3. How to play the SRT stream in VLC?

4. How to play HTTP stream in VLC?

5. Why does VLC not play YouTube videos?

    5.1 How to play YouTube live stream in VLC?

    5.2 Why does VLC not play YouTube videos?

          5.2.1 How to download and run YouTube-DL?

          5.2.2 how to install YouTube-DL?

VLC Media Player is a popular and versatile media player that supports a wide range of platforms and formats. It is a free, open-source software created by the VideoLAN organization and can be used to play both audio and video content.

One of the main advantages of VLC is its ability to play various types of streams, including UDP, RTSP, SRT, multicast, and even YouTube live streams. This makes the media player an excellent choice for users who want to enjoy content from different sources with ease.

Let's take a look at how VLC player plays various streams.

1. How to play UDP stream in VLC?

We use the stream from Encoder.

To play an IP stream with UDP protocol by a VLC media player, please according to steps below:

Step1) Connect PC to NMS port of encoder directly, open its IP output by using multicast address(e.g. 224.2.2.2:1001)

encoder ip output with multicast address.jpg

Step 2) Move the NMS cable from the NMS port to the Data port on the encoder;

Encoder data port and nms port.png

Step 3) Open the VLC media player to play the multicast stream

First, open the VLC media player, open the "Media" tab at the top left corner, and click on "Open Network Stream". 

open network stream in VLC.jpg

Then, we can enter the playing address here.

play udp streaming in vlc.jpg

Please kindly note keep the URL in VLC is the same as the Encoder IP output.

play the multicast stream in VLC.jpg.jpg

We can get the stream playing in VLC.


If you can’t get video from step 3, please download Wireshark by Google and set it, then 

use it to monitor the Data port of the encoder to see if there is an IP packet(see picture below).

Wireshark can be downloaded from http://www.wireshark.org/download.html

2. How to play RTSP stream in VLC?

To play an RTSP (Real-Time Messaging Protocol) stream in the VLC media player, simply follow these steps:

(Let us continue to use the encoder as the signal source)

2.1 set the RTSP stream output of the encoder

Setting IP output address:

  setting ip output address in Encoder web management.jpg

Setting the streaming IP output port:

play RTSP stream in VLC.jpg

Get the RTSP stream output address, like rtsp://192.168.1.168:554/hdmi

how to play rtsp in vlc.jpg

2.2 Setting VLC simply follow the steps:

a. Open the VLC media player on your computer.

b.In the top menu, click on Media > Open Network Stream or press the key combination Ctrl+N.

c. In the Open Network Stream window, enter the RTSP stream URL into the text box. 

The URL scheme should begin with "rtsp://" followed by the IP address, port number, and other relevant parameters. For example: rtsp://192.168.1.2:554/streamname.

 

open rtsp streaming in vlc.jpg

d. Click the Play button or press Enter to start streaming the video.

play RTSP stream output in vlc player.jpg

 By default, VLC media player successfully handles the connection details and buffering required for RTSP streams. In some cases, you may need to configure additional settings to achieve the desired playback quality.To optimize the playback experience, you can adjust the VLC settings for network caching and buffer size. Access the Tools > Preferences > Input/Codecs > Network Caching option to modify these settings.

3. How to play the SRT stream in VLC?

The first 2 steps are the same as the operations of RTSP streaming.

Step3.Enter the SRT stream URL in the text box labeled "Please enter a network URL." Ensure the URL starts with "srt://" to indicate the SRT protocol.

Step4.Double-check the entered URL to ensure correctness, and click the Play button at the bottom of the window.

VLC media player will now connect to the SRT stream and begin playing the video content. If there is an issue with the streaming source or VLC's configuration, users may see an error message specifying the problem. In this case, users should double-check the SRT stream URL and ensure they have a stable internet connection.

Adjust playback settings, such as subtitles, audio tracks, and video aspect ratio, using VLC's built-in tools if necessary. These can be found in the Video, Audio, and Subtitle menus in the top navigation bar of VLC.

Keep in mind that playing an SRT stream requires a reliable internet connection to ensure smooth, uninterrupted playback. If the user experiences buffering or connection issues, it may be helpful to lower the video quality or connect to a faster network.

4. How to play HTTP stream in VLC?

Copy the valid http live stream URL in the below bar

 How to play HTTP stream in VLC.png

Then play it

play HTTP stream in VLC.png


5. Can we use VLC to play YouTube videos?

5.1 Let's check the steps about how to play YouTube live stream in VLC:

Step1:Find the live stream URL: Navigate to the YouTube live stream you want to watch. Right-click on the video and select "Copy video URL".

Step2:Open VLC media player, and add the live stream: In VLC, click on "Media" in the menu bar and select "Open Network Stream" or press Ctrl + N. In the "Network" tab, paste the YouTube live stream URL you copied earlier.(The same operation as the above streams)

Step3: Convert the URL

 Before playing the live stream, the URL needs to be converted. To do this, click on the "Show More Options" checkbox, and then click on "Edit Options". In the "Edit Options" textbox, add the following text at the beginning of the URL: youtube-dl -g -f best. The final text in the box should look like this: youtube-dl -g -f best https://www.youtube.com/watch?v=LiveStreamURL.

Can we use VLC to play YouTube videos?.png

Play the live stream: Click "Play" to start watching the YouTube live stream in VLC.

5.2 Why does VLC not play YouTube videos?

We are often told that VLC can play YouTube videos, but why can't we play them?

In addition to the fact that the VLC version we used isn't updated in time, the most important thing is that we haven't run YouTube-DL.

We can see from the above steps that YouTube-DL needs to be used during the conversion URL.

So let's see how to install and install youtube-dl.

5.2.1 How to download and run YouTube-DL?

Click the installation package link: youtube-dl.org

We can't get it via their official site.

YouTube-dl link.jpg

That's the reason why we don't recommend using VLC to play YouTube. Even If we have gotten the package from other methods, we need to install and run youtube-dl. That's also not simple.

5.2.2 Let's see how to install youtube-dl.

Step1: Enable Windows optional functions——Windows subsystem can be used for Linux

Execute in the run window: "optionalfeatures" to find it

how to install youtube-dl..png

how to install youtube-dl..png

Step2. Install Ubuntu in the Windows App Store

Step3. Create an account based on the page

Step4. Install

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

If it cannot be installed, some errors may be encountered.

For example, (youtube-dl --version) indicates that the Python environment is not installed

/usr/bin/env: ‘python’: No such file or directory

Update:

sudo apt -y update && upgrade
sudo apt install python3

If still does not work, try it

sudo ln -s python3 /usr/bin/python

If you are not professional in this, it will take a lot of your time. Using VLC to play YouTube is not a wise choice.