Play music on command line

January 19, 2011 at 12:53 am (Audio / Video, console based, linux apps, Linux codecs) (, , , , , , )

There are many popular audio players for linux; to name a few they would be XMMS, audacious, amarock . But all of these players are GUI-based; and they does not feel like ‘home’ when you are so addicted to using the command line. So i did some searching on possible options, and i found many. I’m only listing two of the best here, mplayer and Music On Console (Player) or MOC. The command line players have the advantage of less crashes, less usage of resources, playability in CUI only OS’s, remote logging to play sound files on a remote machine. The MPD (music player daemon) server can stream audio using any sound output server to a remote machine.


Music on Console (MOC or MOCP) (homepage)

moc player

MOC 2.44 running on my fedora 14 (64 bit)

The MOC has a decent UI for a CLI program. Consists of two panes, one displaying the music files in the current directory and the other showing the current playlist. Play stats and tag info are displayed in the bottom, with the progress bar. Navigation within playlist and song can be done using keyboard. It’s updated support for pulse, OSS and alsa output.

Installation

for debian based sytems use, sudo apt-get install moc

for rpm based systems, it is unlikely that moc would be on the repository. Try yum install moc and see. If that’s the case, we need to compile from source which can be downloaded from this link. You would need following packages

for mp3 support: yum install libmad-devel libid3tag-devel

for wma,mp4,aac,ra support: yum install ffmpeg-devel (This caused a compile error due to ffmpeg-devel relocating its .h files .. so please don’t do this if you know how to use linking). To activate support for other codecs, see README.

then decompress the file, go to the folder and type usual

./configure && make && install as root to compile and install. See my article on compiling from source for more information.

After installation to run, type

mocp <filename>

press q and type mocp -x to end program. Otherwise the server will still be running 🙂

Mplayer

mplayer

Mplayer running on console

This doesn’t need much introduction; which is as my perception is the best multimedia player ever, which can play videos too. Apart from the gmplayer (or mplayer-gui), the mplayer command can be used to play music on command line, with showing in depth info. Mplayer can play any audio file, it’s heavily stable and takes less resources. You can see my previous post on mplayer.

to install,

sudo apt-get install gmplayer (for debian based systems)

yum install mplayer-gui (for rpm based systems)

Advertisements

Permalink Leave a Comment

Gnash – The FOSS Shockwave flash player

May 3, 2009 at 10:18 am (Linux codecs, Other multimedia) (, , , , , , , , , )

When I say “shockwave flash” people usually do not understand it. This is not the flash movies you find on youtube (.flv); these are .SWF files which works as animations, programs (ex: some games & programs you play in net). As Macromedia (now owned by Adobe) has 100% successful players for these, they are not open source! And i’m afraid they can’t play standalone flash programs (.exe) created for Windows in Linux ! (and Gnash can)

Gnash 0.8.3 playing torpedojoe.exe on FC9

Gnash 0.8.3 playing torpedojoe.exe on FC9

Gnash player evolved from the GameSWF, and now is the only active FOSS flash player project.

Gnash features (Version 0.8.3 which I have),

  • Plays SWF up to version 7

  • Plays .exe standalone SWF up to V7

  • Has plugins for Firefox and Konqueror

  • Plays some .flv files

And many exporting functions which i’m not used to that much. Click here to go to their homepage.

Installing

Gnash has .rpm packages for Fedora,Mandriva, Suse. It can be simply installed by (when you’re root)

yum install gnash

I have seen some .deb packages in the net, so ubuntu,mint,debian users can have a try

sudo apt-get gnash

For installing from the source, you can download the source for version 0.8.5 here. After untaring the file, typing

./configure

make

make install will do the job, for more information on how to compile from source click here.

After installing, you can use command

gnash <filename> to run a file

just typing gnash only will give you the command -flags help, which is very helpful for using powerful gnash command line functions. I’m not going to fill the space up here with them.

Platforms

Gnash can render SWF on 3 different libraries. Default is the agg, which has the best quality and bug free output — but this may make it little bit slow, and requires some dependencies. (as the agg itself). Anyway, if you have a good VGA card and 100% working drivers, you may go for opengl. Just use

–enable-renderer=opengl when configuring (ex: ./configure –enable-renderer=opengl)

Same manner cairo can be used –enable-renderer=cairo

By default, gnash uses Gstreamer framework (Click about on Totem to see what you have) which is the most efficient. But you can use

–enable-media=ffmpeg

if you have ffmpeg and SDL libraries installed. (This is not recommended).

Permalink 4 Comments