Monthly Archives: October 2007

Quick tip – how to extract audio from youtube videos

Here is a quick tip for extracting audio from youtube videos. I assume you have a reasonably recent linux distribution. (Things might work on other operating systems as well as all the applications that I mention below are ported to other operating systems)

Step 1: Download the flash video file from youtube. Either use greasemonkey script or a python script to extract it. (I use the python script way BTW) You can also use the online site VideoDL.org to show you the download link.
Step 2: Use ffmpeg or mplayer to extract audio from the flv file that you just downloaded:
ffmpeg -i f7v9NhmF3SY.flv johny.mp3
OR
mplayer -dumpaudio f7v9NhmF3SY.flv -dumpfile johny.mp3

Enjoy!

Some excel functions

I keep forgetting some of the functions in excel and it is embarrassing to search for the same things every time.

PERMUT(n, r) = nPr = n! / (n - r)!
COMBIN(n, r) = nCr = n!/((n-r)!r!)
FACT(n) = n! = 1*2*3*...*n
BINOMDIST(s, n, p, cumul) Probability that there will be exactly s successes in n trials, each trial having a success probability of p (cumul = FALSE). If cumul is true it returns the probability that there will be at most s successes in n trials.