Multimedia Dynamite
What should the Linux movie player of your dreams do? It should play any movie/video that you throw at it. No questions asked—just play. It should allow seeking and volume control with the keyboard and mouse. It should work with an infrared remote controller and also play television. It should play DVDs and VCDs too. MPlayer can do all of this and much, much more.
MPlayer also is an award-winning, mature, open-source program that still is actively in development. Perhaps one day in the not-too-distant future, support for DVD menus, color subtitles, picture in picture video, MIDI and audio effects plugins like the ones for SoX will be added.
MPlayer is admirably stable for the job it does. However, it does crash under certain circumstances, such as with certain video drivers.
It is a mature application that has no parallel. MEncoder, its companion video encoder program, does a much better job than FFMPEG in transcoding videos, although it is a bit difficult to use and learn.
Now, let's take a look at MPlayer's magic. The following command plays a stream URL after resampling it to 48,000Hz and combining channels into left-right stereo:
$ mplayer -af lavcresample=48000,hrtf ↪'http://mp3.streampower.be/radio1-mid.mp3'
The following command grabs the same URL stream and dumps it to a file named stream.aac:
$ mplayer -dumpstream -dumpfile stream.aac ↪-softvol -softvol-max 2000 -af ↪lavcresample=48000,volnorm=2:0.5 ↪'http://mp3.streampower.be/radio1-mid.mp3'
You can open the stream file from another terminal window with this command:
$ mplayer stream.aac
Then what happens? The first instance of MPlayer continues to dump the network stream to a file and the second plays it for you—time-shifted Internet radio. Cool, eh?
Most of the switches are not necessary to accomplish this, but they show MPlayer's ability to use the Linux command line so elegantly. The -softvol and -softvol-max switches invoke the software volume control feature of MPlayer. It reduces the signal-to-noise ratio, but it can amplify the signal to very high levels.
The volnorm=2:0.5 filter invokes the volume normalization audio filter. The first argument, 2, specifies that several samples are to be used to smooth the volume variations. The 0.5 sets the maximum amplitude to which you want the volume normalized. As you can see, MPlayer provides a high level of customization.
The other options on the command line should not be difficult to decipher.
The following is a command similar to the first one above. In this case, however, you specify a playlist URL. Unlike the above command, this one may not work for you, depending on whether the file happens to be available from the SHOUTcast site when you try it:
$ mplayer -af lavcresample=48000,hrtf -playlist ↪'http://www.shoutcast.com/sbin/shoutcast-playlist.pls?rn ↪=1025&file=filename.pls'
The -playlist option is used only with stream URLs that have a .pls extension in the stream.
You can create your own playlists in a variety of ways. Here is one way to do it with the find command:
$ find /home/girish/music -name "*mp3 ↪-or -name "*ogg" > ~/playlist.txt
Now, fire up MPlayer with:
$ mplayer -playlist ~/playlist.txt
The following variant shuffles the list and plays songs in random order without repeating songs:
$ mplayer -shuffle -playlist ~/playlist.txt
Naturally, MPlayer is a media player. You don't have to limit yourself to audio files. You could add any MPlayer-playable media file into the mix, including videos, movies, television, radio and, of course, Internet streams.
In addition to this simple line-based playlist format, MPlayer also has excellent support for ASX, M3U and other popular playlist formats.
There is good support for audio effects, and the karaoke effect especially gets interesting with certain songs. It is not perfect, but you can attenuate the voice in a song a great deal. Use the following command to activate karaoke mode:
$ mplayer -af karaoke song.mp3
MPlayer also has a ten-octave band equalizer. The following command ignores the middle frequency bands and amplifies the frequencies around 31.25Hz by 7dB, 62.5Hz by 8dB, 125Hz by 5dB and all of the frequencies around 4, 8 and 16Hz are attenuated by 2dB:
$ mplayer -af equalizer=7:8:5:0:0:0:-2:-2:-2 video.mpg
The following command gives a live effect to playback. Try it with songs that sound monotonous:
$ mplayer -af extrastereo song.mp3
You can issue a command like the following to play the third song five times:
$ mplayer song1.mp3 song2.ogg file.wav -loop 5
If you want to repeat the whole list five times, type the following instead:
$ mplayer { song1.mp3 song2.ogg file.wav } -loop 5
You also can use -loop 0 to play something over and over again.
Additionally, there are many audio effect plugins designed especially for multichannel and 3-D audio. If you want some really advanced audio effects, try the SoX Swiss Army knife. It is another command-line application that excels in professional audio effects.
You can specify multiple audio filters on the command line and they are applied one after another in a chain.

Figure 1. MPlayer Audio/Video Filter Chaining
What if you like a certain audio filter chain and you want to save the resulting audio to a file? The following command saves the output of filtering to the file named filtered.wav rather than playing it:
$ mplayer -ao pcm:file=filtered.wav -channels 4 -af lavcresample=48000,hrtf,pan=2:1:0:0:0.3:0.5:0.5:0:12 audio.ogg
The lavcresample filter resamples the frequency of audio.ogg to 48,000Hz.
The pan filter is a very powerful and sophisticated filter. It mixes the input audio channels into the specified output channels in various amplitudes.
In this example, we use the -channels switch to specify four input channels. The first argument to pan is 2 to specify two output channels. In the first pair of arguments after that, the 1:0 specifies the amplitude of the first input channel that is fed into the two output channels. It goes into the left channel with an amplification factor of 1. The second input channel goes into the right channel with an amplification factor of 0.3 (0:0.3), and the third input channel is divided equally into both output channels (0.5:0.5). The fourth channel goes into the right channel with an amplification factor of 12.
You can use the following command to re-encode the WAV file to Ogg:
$ oggenc -q 9 filtered.wav
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- RSS Feeds
- What's the tweeting protocol?
- New Products
- Trying to Tame the Tablet
- Dart: a New Web Programming Experience
- Reply to comment | Linux Journal
15 hours 40 min ago - Reply to comment | Linux Journal
18 hours 13 min ago - Reply to comment | Linux Journal
19 hours 30 min ago - great post
20 hours 5 min ago - Google Docs
20 hours 27 min ago - Reply to comment | Linux Journal
1 day 1 hour ago - Reply to comment | Linux Journal
1 day 2 hours ago - Web Hosting IQ
1 day 3 hours ago - Thanks for taking the time to
1 day 5 hours ago - Linux is good
1 day 7 hours ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.




Comments
There is good support for
There is good support for audio effects
Alaçatı konaklama
thank you for all
good content
thanks admin
hi. thanks for sharing
hi. thanks for sharing
new
thanks admin
no
thanks admin
hello
thanks
hi. thanks for sharing. my
hi. thanks for sharing. my friend
is that true?
see... mplayer can't fully display substation alpha subtitles, it messed up the whole karaoke effects
There is good support for
There is good support for audio effects, and the karaoke effect especially gets interesting with certain songs.