MPlayer

From LinuxReviews
Jump to: navigation, search

Mplayer is the best video player available. You need Mplayer.

MPlayer comes with the excellent video convertion tool mencoder.

Contents

[edit] Just a movie player..

Mplayer is just a movie player. Think of it like a back-end.

You can use it standalone, just run mplayer myfile.avi. It also comes with the graphical player gmplayer. gmplayer is not very advanced and it is tempting to call it crap.

There are dozens of excellent video players who use mplayer as a backend available.

Get yourself a nice front-end for mplayer and you are all set to enjoy multimedia on Linux.

[edit] How to convert video files (audio and video tracks)

[edit] How to extract and convert audio

You can copy the audio from any mplayer playable video file to a wav file so you can edit it in an audio editor like audacity by using the audio out option pcm as an option to mplayer (-ao pcm:file=audio.wav):

mplayer -vc dummy -vo null -ao pcm:file=audio.wav videofile.avi

[edit] How to merge a video file with an audio file

Use the mencoder option -audiofile specify that you want to use a separate file for the sound track:

mencoder -audiofile newaudio.wav -oac mp3lame -ovc copy videofile.avi -o new-videofile.avi

-ovc copy instructs that you want to leave the video as it is and simply copy it into the new video file that uses the audio track you specified.

[edit] How to convert a directory full of Apple Quicktime .mov files to avi and mp3

 for fl in *.mov
 do
   mencoder ${fl} -o ${fl/mov/avi} -oac mp3lame -ovc lavc
   mplayer -ao pcm -vo null -vc dummy -dumpaudio -dumpfile ${fl/mov/mp3} ${fl/mov/avi}
   #rm ${fl/mov/avi}
 done

Thanks to Gunnar Wrobel

[edit] dv to mpeg4 and mp3 audio

mencoder foo.dv -mf fps=25 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4 -oac mp3lame

Adding -ss and -endpos and timeframe makes it cut out nicely: -ss 00:00:00 -endpost 00:10:15

[edit] wmv to mpeg

mencoder movie.wmv -o movie.mpg -ovc lavc -oac mp3lame -of mpeg

[edit] WMA to MP3

#!/bin/bash
#
# Dump wma to mp3
for i in *.wma
do
 if [ -f "$i" ]; then
 rm -f "$i.wav"
 mkfifo "$i.wav"
 mplayer -quiet -vo null -vc dummy -af volume=0,resample=44100:0:1 -ao pcm:waveheader:file="$i.wav" "$i" &
 dest=`echo "$i"|sed -e 's/wma$/mp3/'`
 lame -V0 -h -b 160 --vbr-new "$i.wav" "$dest"
 rm -f "$i.wav"
fi
done

[edit] MP3 to WAV

[edit] Using mpg321

mpg321 is a free MP3 player (drop-in replacement for mpg123).

for i in *.mp3; do 
 mpg321 -w `basename $i .mp3`.wav $i
done

[edit] Documentation

Personal tools
hardware tests
Categories
Privacy policy
linux events
ipv6
Networking
IPv6

Search:

linux newz | random page | poetry | free blog