This article aims to help users who have installed Ubuntu Server 24.04 on a Mini PC with a J4125 CPU and are experiencing issues while trying to run VLC through the command line to display an RTSP stream on an HDMI port.
Introduction
VLC (VideoLAN Client) is a popular, open-source, and free media player that supports a wide range of multimedia file formats, protocols, and streaming protocols like RTSP (Real Time Streaming Protocol). This guide focuses on resolving an issue where VLC fails to display an RTSP stream on an HDMI port when running on Ubuntu Server 24.04 installed on a Mini PC with an Intel J4125 CPU.
Prerequisites
To follow this guide, ensure you have the following:
- Ubuntu Server 24.04 installed on a Mini PC with an Intel J4125 CPU.
- VLC media player installed.
- An RTSP stream to display.
Issue: CVLC Not Working on Ubuntu Server 24.04 Mini PC J4125 CPU
When attempting to run VLC through the command line to display an RTSP stream on the HDMI port, the following command may be used:
cvlc rtsp:// --no-xlib --qt-fullscreen &
However, the above command may not work as expected, and no video output is shown on the HDMI monitor.
Understanding the Issue
The issue arises due to the environment in which Ubuntu Server is installed. Unlike standard Ubuntu Desktop distributions, Ubuntu Server does not come with a GUI. Thus, when running VLC through the command line, it may not correctly detect and configure the HDMI output.
Solution: Forcing HDMI Output
To resolve this issue, you can force VLC to use the HDMI output by specifying the appropriate ALSA (Advanced Linux Sound Architecture) audio device and X11 video device.
Finding the ALSA Audio Device
To identify the correct ALSA audio device, run the following command:
aplay -l
This command will list all the audio devices available on your system. Look for the card and device index associated with the HDMI output. In this example, we assume the ALSA audio device is hw:CARD=PCH,DEV=0.
Finding the X11 Video Device
Ubuntu Server does not come with X11 installed. You must install X11 and a dummy video driver to create a fake video device. Run the following commands to install the necessary packages:
sudo apt update
sudo apt install xorg xserver-xorg-video-dummy
After installation, create a new X11 configuration file:
sudo nano /etc/X11/xorg.conf
Paste the following configuration:
Section "Device"
Identifier "dummy"
Driver "dummy"
EndSection
Section "Monitor"
Identifier "dummy"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
Modeline "1280x720" 108.0 1280 1390 1432 1648 720 732 752 795 -HSync +Vsync
EndSection
Section "Screen"
Identifier "dummy"
Device "dummy"
Monitor "dummy"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x720"
EndSubSection
EndSection
Save the file and exit. Now, start the X11 server:
sudo startx
You should not see a graphical interface. Still, an X11 server is now running with a virtual video device, and you can find its ID by running the following command:
xdotool search --name dummy
In this example, we assume the X11 video device ID is 32.
Running VLC with HDMI Output
Now, you can run VLC through the command line with the correct audio and video devices configured:
cvlc rtsp:// :alsa:hw:CARD=PCH,DEV=0 :display=:0.0 :xlib-sync=1 :xlib-core=1 :xlib-mouse=disabled :xlib-grab-keyboard=disabled --no-xlib --qt-fullscreen &
VLC should now display the RTSP stream on the HDMI-connected monitor.
- Ubuntu Server 24.04 installed on a Mini PC with a J4125 CPU does not come with a GUI and may cause issues when attempting to display RTSP streams on an HDMI port using VLC.
- To solve the issue, find the ALSA audio and X11 video devices for your HDMI output and configure VLC accordingly.