Convert WMA to OGG

Posted on September 14th, 2006

by jesse

Screw those evil M$ formats!

(You’ll need (media-sound/)vorbis-tools for this to work).

- Download clean version (wordpress screws some chars) -

One way to use it is to store the file in /usr/bin, then chmod +x it to allow it to be executed.
Then go to a directory with wma files and type

for i in *; do wma2ogg “$i”; done

Code:

#!/bin/sh
# Convert a .wma to an .ogg using mplayer and oggenc.
#
# Public Domain
set -e
IN=$1
echo $IN
shift
if [ -z “${IN}” ]; then
IN=-
WAV=audio.wav
else
WAV=$(basename “${IN}” .wma).wav
fi
mplayer -vc dummy -vo null -ao pcm:waveheader:file=”${WAV}” “${IN}”
FILEDAT=$(file “${WAV}”)
BITS=$(echo ${FILEDAT} | sed -e ’s/.*\(8\|16\|32\) bit.*/\1/’)
if echo ${FILEDAT} | grep -q mono; then
CHANS=1
else
CHANS=2
fi
oggenc -R 44100 -B ${BITS} -C ${CHANS} “${WAV}” >/dev/null
rm -f “${WAV}”

How to store and convert YouTube movies

Posted on August 31st, 2006

by jesse

YouTube.comEver wondered if you could burn YouTube movies on a cd to give them away? No problem with linux :)

All you need is (media-video/)ffmpeg and VideoDownloader for firefox and you’re ready to go!

Just download the .flv of a youtube (or whatever) movie via the firefox extension (new icon in the statusbar). Then open a term and type

$ ffmpeg -i sourcevid.flv -ar 48000 -ac 2 target.avi

Wohoo, that’s it :) Now you can use, e.g. (app-cdr/)k3b, to burn it on a cd or just store it somewhere for later use.

By the way, if you’re not into firefox, you may want to take a look at youtube-dl, a small command-line program to download videos from YouTube.com (requires the Python interpreter, version 2.4 or later, and it’s not platform specific). youtube-dl is actually quite nice! check out pornotube-dl also ;D

Find untagged mp3s

Posted on August 29th, 2006

by jesse

Amarok LogoThis oneliner finds any mp3 without id3v2 tag and automatically adds it to the Amarok playlist. You’ll need the (media-sound/)id3v2 package installed. there are prolly better ways to do this but heck, it works :)

#!/bin/bash
# finds untagged mp3s in the active dir + subdirs
# dedicated to http://geekosphere.org

find . -iname “*.mp3″ -exec sh -c ‘id3v2 -l “$0″ | xargs -0 echo -en $PWD/ | grep “No ID3 tag” | cut -f1 -d”:” | sed -e s/” .\/”// -e s/$/\”/ -e s/^/”dcop amarok playlist addMedia \”"/’ {} {} \; | while read line; do eval ${line}; done

Umm, Wordpress screws the quotes… download here.

Have fun!

Simple triggers that make your linux-based life easier

Posted on August 27th, 2006

by jesse

Just read about shutting down the pc after a specific amout of time in Hijacker’s blog. It’s quite simple considering that there’s no way to do something like this with windows (without addons).

If you spin this further, you can do a lot of useful things.

Imagine, for example, you want to listen to one song and shutdown the pc afterwards:

$ play sandmännchen.mp3 ; shutdown -hP now

Or maybe you want to be informed with a sound after some time consuming command finished:

$ tar cvfz /daten/backup.tar.gz /home ; play /media/beep.mp3

Das sind so simple Sachen die das (Linux-)Leben schöner machen =)
Yet another reason why life with linux is so wonderful


design: makequick.com | modificashuns and bugfixes by jesse
bottom