Tuesday, April 20, 2010

Fixing high pitched audio in youtube video

An hour ago, I was trying to watch a couple of google IO videos on youtube.com, but they are all about an hour long, which means it takes about 1.5 hrs to download on my "broadband" connection. So I decided that the best way would be to download them and save to disk. (Google seems to have enabled a download option on youtube, but it is available only for US... wtf?)

Anyway, I used the Download Helper plugin of firefox to download the video. But when I tried to play it with mplayer, the guy giving the lecture sounded like a chipmunk. I was unable to understand what he was saying since the voice was very high pitched and was like a tape being forwarded, but when I played it on youtube, it sounded fine.

So after checking out a number of other players at my disposal (which was none :), I decided to google to figure out what the problem was. A guy on the mplayer forums had the perfect solution - use the opensource project scaletempo's audiofilter like below

mplayer -af scaletempo

This worked like a charm, and the videos are playing great now.

Saturday, April 10, 2010

Google DNS server

Now-a-days my airtel DSL connection's DNS servers fail to resolve some DNS addresses. I dont have an idea about what the problem is, but frequently I see many domains unable to be resolved and sometimes pretty slow too. So I decided to move to using the Google Open DNS Server. The IP is also a beautifully easy to remember - 8.8.8.8 . 8.8.4.4 is another DNS server of google which can be used as an alternate.

To keep this IP from being overwritten on my Fedora 12 Box, I figured out that the best way to do it would be to write a new file in /etc/NetworkManager/dispatcher.d/ which I names as 25-setdns with the following contents

#!/bin/sh
if [ "$2" = "up" ]; then
cp -f /etc/resolv.conf /etc/resolv.conf.BAK
echo nameserver 8.8.8.8 > /etc/resolv.conf
echo nameserver 8.8.4.4 >> /etc/resolv.conf
fi

This will ensure that the Google DNS will always be used to resolve my domain names.

Do note that I took a very crude, but simple approach here since I dont use any VPNs. If you do use VPN software, then you should make sure that the google DNS is the next entry. since your VPN's local DNS will resolve your VPN internal domains, which are unknown to outside world!

For the paranoid, this is yet more information you are pushing to google! :D