Linux / UNIX: mplayer Play mp3s From a Playlist File

I‘m an extreme newbie to the Linux world, but any time I try to get play files according to a playlist file using mplayer command line it turns up this error:

$ mplayer playlist.m3u
MPlayer SVN-r1.0~rc3+svn20090426-4.4.3 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing playlist.m3u.
Cache fill: 0.00% (44 bytes)

Exiting… (End of file)

How do I fix this and play music without using GUI tools?

mplayer is a movie player for Linux and UNIX like operating systems (it may also runs on many other platforms). It plays most MPEG/VOB, AVI, ASF/WMA/WMV, RM, QT/MOV/MP4, Ogg/OGM, MKV, VIVO, FLI, NuppelVideo, yuv4mpeg, FILM and RoQ files, supported by many native and binary codecs. You can watch VCD, SVCD, DVD, 3ivx, DivX 3/4/5, WMV and even H.264 movies, too.

mplayer: Playing Music Using a Playlist File

First, make sure your playlist in ASX, Winamp, SMIL, or one-file-per-line format. Next, you need to use the following syntax to play any media file from playlist. Open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command:

mplayer -playlist {yourlist.input.file}
mplayer -playlist playlist.m3u

A Sample One-file-per-line Playlist Format

$ cat playlist.m3u
Sample output (tracks):

track1.mp3
track2.mp3
track3.mp3
track4.mp3

You can create a playlist called mylist.txt as follows by searching all .mp3s in /home/vivek/music directory:

find /home/vivek/music/ -type f -iname "*.mp3" > mylist.txt

To play mp3 from a playlist, enter:

mplayer -playlist mylist.txt

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • Derrich Dec 22, 2010 @ 4:19

    Use mplayer -playlist playlist-filename.m3u

  • Derrich Dec 22, 2010 @ 4:24

    Which is what I’d submit if the question hadn’t already been answered in full. Oh my.

  • ~m Jan 14, 2013 @ 19:42

    Hello, mplayer is full movie player. For simple mp3 you can use simple tool such as mpg123 or mpg321. Regards ~m.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum