Archive for the ‘mplayer’ Category

Extracting audio from a video can be troublesome…
For me it seems easier to first convert into wav, as follows :

mplayer -ao pcm:fast:file=audio_out.wav -vo null -vc null video.avi

Then amplify, if needed, using Audacity before encoding into mp3 or ogg :

oggenc -q8 audio_out.wav


Read Full Post »

This small script below is a work in progress, still very useful in its present form… It rips from Audio CDs in wav format. If you start from other formats like flac, this will convert them easily to wav.
Then a basic way to encode in mp3 but most important to ogg with a decent information tag.
Finally, my way to remove special characters from file names.
The comment option in oggenc doesn’t work properly (unless you use "=" in the text)… If you want to add a comment, use easytag to do so… This will help creating a playlist.m3u as well.

# from Audio CD :
# cdparanoia -B
# APE/FLAC/AMR/other to WAV :
# for i in *.flac ; do mplayer "$i" -ao pcm:file="${i%.flac}.wav" ; done
# Encode to MP3 :
# for i in *.wav; do lame -b 192 "$i" "${i%.wav}.mp3" ; done
# Encode to OGG :
oggenc -q8 –name-remove " (‘;:,!?+)" –name-replace "_-_–" –names "%n_%t.ogg" \
–artist "HILDEGARD VON BINGEN (1098-1179)" \
–genre "Classical" \
–date "1983" \
–album "A feather on the breath of God" \
–tracknum "01" –title "Columba aspexit" *01*.wav \
–tracknum "02" –title "Ave, generosa" *02*.wav \
–tracknum "03" –title "O ignis spiritus" *03*.wav \
–tracknum "04" –title "O Ierusalem" *04*.wav \
–tracknum "05" –title "O Euchari" *05*.wav \
–tracknum "06" –title "O viridissima virga" *06*.wav \
–tracknum "07" –title "O presul vere civitas" *07*.wav \
–tracknum "08" –title "O Ecclesia" *08*.wav
# Remove special characters :
for i in *.ogg ;
do mv $i `echo $i | sed ‘s/_-_/-/g ; s/_-/-/g ; s/-_/-/g ; \
s/É\|È\|Ê\|Ë/E/g ; s/é\|è\|ê\|ë/e/g ; \
s/Ú\|Ù\|Û\|Ü/U/g ; s/ú\|ù\|û\|ü/u/g ; \
s/Í\|Ì\|Î\|Ï/I/g ; s/í\|ì\|î\|ï/i/g ; \
s/Á\|À\|Â\|Ä\|Å\|Ã/A/g ; s/á\|à\|â\|ä\|å\|ã/a/g ; \
s/Ó\|Ò\|Ô\|Ö\|Ø\|Õ/O/g ; s/ó\|ò\|ô\|ö\|ø\|õ/o/g ; \
s/Ç/c/g ; s/ç/c/g ; \
s/Ñ/N/g ; s/ñ/n/g ; \
s/Ÿ/Y/g ; s/ÿ/y/g’` ;

Read Full Post »

Random Playing in Mplayer

I was looking for a way to play random music on my computer using mplayer and needed to shuffle recursively throughout many mp3/ogg files and directories in order to do so.

mplayer -shuffle `find . -name "*.mp3" -o -name "*.ogg"` does the trick.

Because of the result of my `getconf ARG_MAX`, I can only random through 2097152 files… but it’ll be alright I think…

Of course you can also make an alias out of it, as follows :
alias randomize=’mplayer -shuffle `find . -name "*.mp3" -o -name "*.ogg"`’

And one more thing : no gaps in the file paths. Use underscores "_".

Thank you again mirmo, christophe971 and kik…

Read Full Post »

If by any chance your video card is ATI then you may have come across this message in mplayer :

[VO_XV] It seems there is no Xvideo support for your video card available.
[VO_XV] Run ‘xvinfo’ to verify its Xv support and read
[VO_XV] DOCS/HTML/en/video.html#xv!
[VO_XV] See ‘mplayer -vo help’ for other (non-xv) video out drivers.
[VO_XV] Try -vo x11.
Error opening/initializing the selected video_out (-vo) device.

You need to reboot after the following :
apt-get install firmware-linux firmware-linux-nonfree

It seems the kernel 2.6.32-5 and xorg 1:7.5+6 require the ATI/radeon firmware to work the xv video output right…

Read Full Post »

# Write your default config options here!
#aspect: -aspect 4:3 or 16:9
#remove 18″ from sub file: -subdelay 18
#modify subs framerate: -subfps 25 (or 23.976)
#toggle DVD subtitles : j

Read Full Post »