≡ Menu

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
Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:



{ 3 comments… add one }
  • Derrich December 22, 2010, 4:19 am

    Use mplayer -playlist playlist-filename.m3u

  • Derrich December 22, 2010, 4:24 am

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

  • ~m January 14, 2013, 7:42 pm

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

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , , , , , , , , , , , , , , , , , , , , , , , , ,