Play audio and video

The easiest way to play audio and video on a Raspberry Pi is to use the preinstalled VLC application;

The VLC program uses hardware acceleration and can play many popular audio and video file formats.

Graphical interface

Select the file you want to play, right-click and select "VLC Media Player"

image-20231218194341641

Command Line

Note: To play audio or video from the command line, you need to enter the directory where the file is located.

Play video

Example: Play Test.mp4 file

Example: After playing the Test.mp4 file, exit the application

Example: Play the Test.mp4 file in full screen, exit the application after playing

Example: Play the Test.mp4 file without displaying the VLC graphical interface

Replace and <video_name> content

Example: Video output via HDMI1

Get a list of all DRM devices on the Raspberry Pi: kmsprint | grep Connector

DRM DeviceDescription
HDMI-A-1 connectorHDMI output on Raspberry Pi Zero or Raspberry Pi Model 1, 2, or 3; ** or ** HDMI400 output on Raspberry Pi 0 or 4
HDMI-A-2 connectorHDMI400 output on Raspberry Pi 1 or 4
DSI-1 typeRaspberry Pi touch display

Play audio

The Raspberry Pi 5 can be used normally only when an audio device is connected.

The only difference between the play audio command and the play video command is the file name: Play Test.mp3 file

Replace and <video_name> content

Example: Output audio via HDMI

Get the Raspberry Pi ALSA device: aplay -L | grep sysdefault

ALSA EquipmentDescription
System default: CARD=vc4hdmi0HDMI400 output on Raspberry Pi 0 or 4
System default: CARD=vc4hdmi1HDMI400 output on Raspberry Pi 1 or 4