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)

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

Installing linux players on fedora.

November 2, 2008 at 1:50 pm (Audio / Video, linux apps, Linux codecs, Linux installation) (, , , , , , )

This article is about using redhat package manager (RPM) to install Mplayer, xmms player, real player etc… on Fedora and redhat. I hope same techniques can be used for Suse and Mandriva.

For each of the given names of packages  below visit www.rpmfind.net or rpmsearch, and copy and paste the package name.

===============================================================================================

edit on 19/01/2010

Now it is much easier to install programs using yum and apt-get than from installing from the source. If you have set your repositaries correctly, following should work.

for  installing both mplayer and vlc player

p { margin-bottom: 0.08in; }

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

yum install mplayer-gui vlc (for rpm based systems)

The information below were written two years ago and pretty much deprecated by now. 🙂

================================================================================================

Indentify your architecture (for pentium, dual core, C2D, athlon XP it’s i386 (x86); for 64-bit it’s x86_64. Learn more about RPM’s on my “Managing RPM’s” blog on linux installation category (This post may be pending). For example, you have p4, fedora9 and you want xmms, you choose

xmms-1.2.11-1.20071117cvs.1.fc9.i386.rpm note fc9 tag and i386 (if no tag is there, or noarch is there, you can choose for any architecture/fedora version).Package name with FC9 i386 compitable link as example.

1.Mplayer

mplayer-1.0-0.44.rc2.fc9.i386.rpm

2.Realplayer

http://www.real.com/realcom/R?href=http://forms.real.com/real/player/download.html?f=unix/RealPlayer11GOLD.rpm (for all fedora dist, any arch)

3.Helixplayer

HelixPlayer-1.0.9-2.fc9.i386.rpm

4.xmms player, for this you need

xmms

xmms-1.2.11-1.20071117cvs.1.fc9.i386.rpm

xmms-mp3

xmms-mp3-1.2.10-16.fc7.i386.rpm

continue with xmms-wma, xmms-skins if necessary xmms-libs

5. Gstreamer-ffmpeg

gstreamer-ffmpeg-0.10.5-1.fc9.i386.rpm

for mp3 for gstreamer use fluendo codec (google this to find a downloadable link)

for installing RPM’s, type in command line

su –

passwd:(Enter your pasword here)

rpm -ivh (rpm file) example:

rpm -ivh /home/malshan/HelixPlayer-1.0.9-2.fc9.i386.rpm

if no dependency errors found, now you’ve got program installed. Right clicking on a file on your explorer and saying to open with this program automatically sets that type of file with the program.

enjoy!

If any errors found, please reply.

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

yum install mplayer-gui (for rpm based systems)

Permalink Leave a Comment

Adding A/V support for linux: Install Mplayer

November 1, 2008 at 6:14 pm (Audio / Video, Linux codecs) (, , , , , )

This is for Mplayer installing: x86 based PC on Linux

mplayer running on FC9, gnome

mplayer

Many people are talking about cannot getting videos or sounds to play on linux. (except for ubuntu new)
Even if you have installed codecs, you should really go for this player: It can even play with win32 codecs; just need to drop in to folder!

go to http://www.mplayerhq.hu/design7/dload.html to check it out

download from
http://www.mplayerhq.hu/MPlayer/rele…1.0rc2.tar.bz2
untar it using your archeive manager (open- and drag and drop where you want to copy)
go in to the folder in command line (termina/console) and type

./configure –enable-gui

if no errors found (if you get dependency errors you’ve to install them first — look the list down)
then type

make

this takes about an hour ——- wait and hope for good luck — program is being compiled from the source code………
then if it’s completed without errors, then go admin in command line
su –
passwd: (enter your admin passwd here)
(NOTE: you can always type “root” as username and passwd at linux login screen to be admin from the start-if you are not familiar with command line-so you can use normal GUI to copy files without permission problems.)
type:

make install

will install mplayer to every user but, without codecs
download codecs at
http://www.mplayerhq.hu/MPlayer/rele…071007.tar.bz2
untar it as i said before, and copy the codec files (not the folder) in to
/usr/local/lib/codecs, if no codecs folder exist, create one. (hope you know to use cp and mkdir commands)

now goto the codecs path and type (as admin/root)

chmod ugo+rwx *.*

now you can type

mplayer filename

to play anyfile!
ex: mplayer *.* will play all files in directory.

for the gui; use gmplayer instead
in order to GUI to work, you need skins, download this:
http://www.mplayerhq.hu/MPlayer/skins/Blue-1.7.tar.bz2
untar it,
and paste the whole folder
/home/(your user name)/.mplayer/skins
or
~/.mplayer/skins (as normal user, not admin)
go inside the folder and use chmod as before (as admin)
enjoy!
If need more help, please reply.
I’m using fedora 9 (and not windows)

dependencies:
If configure says your machine not having something — you can just ignore them if they are optional
or else goto www.rpmfind.net search and type it there to find what you want (for Suse, mandriva and fedora only)

Check for my “Compiling Linux apps from source” page for more help. 

Permalink 5 Comments