Jan 26 2011

Extracting music from flash videos using mencoder and mplayer

Category: Linux,Sound,Video ProcessingMike Lovell @ 2:30 pm

If you’ve ever downloaded music videos from a website (for example via “youtube-dl”) you may have been in the position of wanting to extract the music in “MP3″ format from the “FLV” (flash video) file, here’s how you can do this:

#mencoder source.flv -ovc frameno -oac mp3lame -lameopts br=128 -noskip -o resampled.avi
#mplayer -dumpaudio -dumpfile final.mp3 resampled.avi

Both “mencoder” and  “mplayer” can be used on both Windows and Linux (in the latest version of Ubuntu both are available via the package manager).


Jan 26 2011

X11 Forwarding of Pidgin with Sound using PulseAudio

Category: Linux,Pidgin,PulseAudio,SSHMike Lovell @ 1:41 pm

With the aid of PulseAudio it’s possible to remotely host applications such as Pidgin and still have sound enabled (something that’s very handy with an IM client for notification purposes).

First, on the client and server, you’ll need to make sure PulseAudio is installed (it should be there by default in Ubuntu 10.10 if that’s your client), for the client you can install all you need like this:

#apt-get install pulseaudio pulseaudio-utils paprefs

And for the server:

#apt-get install pulseaudio pulseaudio-utils

Then on the client allow network access to the local sound devices (you can open the preferences by typing “papref” at console or going to “System | Preferences | PulseAudio Preferences”):

"paprefs" Dialog

(Security Note: The port being used (TCP/4713) is blocked by the firewall on this machine to anything but LocalHost, you should do the same)

Then, when we connect to the server, we want to enable X11 forwarding and setup a reverse tunnel to allow us to send sounds to the client, we do this like so:

#ssh -X R 4713:127.0.0.1:4713

Start up Pidgin:

#pidgin &

Then change the sound preferences to use “paplay” to play the sounds down the reverse tunnel:

Pidgin Sound Dialog

And there we go, job done.

I like to have Pidgin running on a virtual machine at home to prevent any monitoring of my IM communications when at work, on-site or using an untrusted network.