Harshdeep 2.0

January 27, 2009

The Making of Latest in Music – Using Youtube API

Filed under: Latest in Music, Programming, Video — harshdeep @ 2:12 pm

This is the second part of the Making of Latest in Music trilogy (here is part 1). Latest in Music is a Youtube mashup that scrapes the listings of top songs from various websites and shows their music videos by searching for them on Youtube. This is the first time I built a web application and I’m amazed by how quickly one can build something interesting with the available tools.

An important part of LiM is interaction with Youtube. Youtube generously provides an API to access the service. Initially I didn’t feel the need to use it. All I had to do was search for a song. This can be done simply by inserting the query string at the right place in the URL – http://www.youtube.com/results?search_query=<my_query_string> and fetching that page. However, this approach turned out to be insufficient for two reasons.

Firstly, some videos on Youtube cannot be embedded on external pages (like this one). Extending the basic approach to determine whether a video is embeddable would require another http page fetch. With Youtube API however, it is only a matter of setting an additional parameter in the search request (format=5).

Secondly, the initial users complained that there is no way to play all songs one after the other. I figured this could be done by creating a Youtube playlist with those songs. This definitely required the use of the API.

Using the API was pretty straightforward. But I learnt a few things the hard way. This might be a useful read if you are going to use the Youtube API for the first time

  1. Login

    The generic Google login does not work for the Youtube API calls that require authentication. It probably works fine for other Google APIs like the ones for Google Docs. But for Youtube API, you’ll get “Service Forbidden” errors with it. You need to create a login specifically on Youtube.

  2. HTTP version

    Youtube API requires the HTTP version 1.1. If you are using Ruby (version >1.6), the default http version is 1.2 and that causes errors. You need to call Net::HTTP.version_1_1 before sending any requests to make sure the Google servers are happy with you.

  3. API call frequency

    If you make a lot of Youtube API calls in a short time, you would start getting Forbidden errors. I couldn’t think of a better way to handle it than reducing the call frequency artificially by putting a sleep between them.


November 13, 2006

Specialized video codecs

Filed under: Video — harshdeep @ 2:11 pm

Just came to know that Microsoft has a special video codec for screencasts (through Coding Horror). Screencasts are indeed very different from normal videos. Generally they have very low motion, and the UI consists of huge areas of same color. This itself makes these videos highly compressible, but a specific codec for such videos can better exploit these properties for higher compression.

It should give good results with 2D animated movies also, as they have similar properties. And indeed, there is Apple’s Animation codec that works on the same assumption of long horizontal lines of same color. However, for real world footage “it barely compresses at all” according to Wikipedia.

This spurs an interesting train of thought about improving compression for certain types of videos by exploiting their properties, like in TV Sitcoms in which the same set is repeated in various scenes, not necessarily continguous, or the same background image for long shots in sports videos for certain camera angles. Intriguing!

July 7, 2006

New avatar of Abazab

Filed under: Internet, Mobile, Video — harshdeep @ 10:21 pm

Some time back, I talked about Abazab and Umundo – these applications let you upload videos from your mobile (and desktop too) to your blog.

Looks like Abazab has got a face lift – the playbox looks much better now and it’s more functional. One thing that I like is the clip browser on the right hand side.

I’m still using my old blogspot blog to host my abazab playbox.

Sharing of uploaded video clips has also been enhanced. If you happen to like a video in someone’s playbox, just hit the share button while your mouse is hovering over that particular video in the clip browser and enter your friend’s email id. Your friend doesn’t need to go through any registration process to view the video – all he has to do is visit a static link that is mailed to him – pretty straightforward and very usable.

June 16, 2006

Umundo: Abazab’s nemesis

Filed under: Internet, Mobile, Video — harshdeep @ 5:48 am


The similarity between Umundo and Abazab does not end with their difficult-to-spell names. Like Abazab (that I mentioned in my last post), Umundo let’s you upload videos directly from your camera phone. People can view your videos at a webpage that Umundo creates for you, or you can embed a widget on your own webpage just like Abajab. Here is my Umundo page.

MobileCrunch has a comparison between the two.

One annoying thing about Umundo is that once you’ve uploaded a video, you can’t delete it. This is a serious handicap especially when you are dealing with public sharing of personal videos.

Update: Deletion is now possible in Umundo as mentioned by the readers in the comments.

June 13, 2006

Abazab says yo!

Filed under: Internet, Video — harshdeep @ 5:53 am

This is the subject of the beta invite I just got from Abazab. I quickly created an account, shot a little video from my Nokia 6630 and uploaded it (you've to mail the clip to me@zab.bz to upload it – the address is tied to your account through your email address). It's kinda cool actually. It let me customize a widget in which others will be able to play the videos that I upload – they call it the playbox. With my limited aesthetic sense, this is how it looked after some tweaks –

Abazab widget

In case you want to see a very exciting video of my cubicle walls showing off a Geek Quiz Certificate and Best Special Effects trophy (for an amateur commercial that I didn't have anything to do with), please follow the link to my old Blogspot blog as WordPress won't let me insert the HTML clipping for abazab widget.

I think it would be very useful to have community playboxes in Abazab. For example, there could be a common playbox for everyone in my college batch – everyone can post videos, they are all there in the same playbox and anyone can host it on his blog. It'd be a cool way to stay in touch.

Register for Abazab beta here

Create a free website or blog at WordPress.com.