post 'good coders code, great reuse' to del.icio.us post 'good coders code, great reuse' to digg post 'good coders code, great reuse' to reddit subscribe to 'good coders code, great reuse' posts via feed
good coders code, great reuse

There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.

C.A.R. Hoare

Nothing delights me more than great books.
If you like my blog, I'd be thankful for a gift from my Amazon book wishlist. :)

ToolsHowto 19 Jul 2007 06:40 pm
1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 5 out of 5)
Loading ... Loading ...

ffmpeg video converterIn the few previous posts we have been downloading YouTube videos with Awk and Perl. What we ended up with were .flv (Flash Media Video) files which do not play with the usual video players like Windows Media Player which comes with Windows out-of-the-box.

To play these .flv’s we either need a special video player which supports this video file format such as VLC Media Player or FLV Player, or get a good video codec pack (which I do not recommend since it eventually messes the whole multimedia subsystem up, not gonna even link to it), or get a ffdshow all-in-one video codec (I recommend it).

The ffdshow solution is pretty good and that is what I use myself together with the excellent Media Player Classic video player which replaces the horrific Windows Media Player once and forever.

Now suppose you wanted to send the video file to your friend who didn’t know about all these video codecs and players and didn’t want to have them installed. What would you do?

Or suppose you wanted to put the video on your brand new iPhone or video iPod, or your cellphone.

Let’s learn how to convert the video to a better format such as windows media video (.wmv), .avi, mpeg or divx, or mobile phone’s 3gp format (or even others).

The tool we are going to use is called ffmpeg. ffmpeg is a command line tool to convert one video and audio file format to another.

Continue reading 'Converting YouTube FLVs (Flash Videos) to a Better Format with ffmpeg' Continue reading ‘Converting YouTube FLVs (Flash Videos) to a Better Format with ffmpeg’

Comments (13) Comments | Email Post Email 'Converting YouTube FLVs (Flash Videos) to a Better Format with ffmpeg' to a friend | Print Post Print 'Converting YouTube FLVs (Flash Videos) to a Better Format with ffmpeg' | Permalink Permalink to 'Converting YouTube FLVs (Flash Videos) to a Better Format with ffmpeg' | Trackback Trackback to 'Converting YouTube FLVs (Flash Videos) to a Better Format with ffmpeg'
(Popularity: 24%) 39,426 Views

Did you like this page? Subscribe to my posts!

Nothing delights me more than great books.
If you like my blog, I'd be thankful for a gift from my Amazon book wishlist. :)

ProgrammingHowtoHacker's Approach 15 Jul 2007 04:20 am
1 Star2 Stars3 Stars4 Stars5 Stars (7 votes, average: 5 out of 5)
Loading ... Loading ...

purl purl, youtube perl one liner downloader Last time I explained how YouTube videos can be downloaded with gawk programming language by getting the YouTube page where the video is displayed and finding out how the flash video player retrieves the FLV (flash video) media file.

This time I’ll use Perl programming language which is my favorite language at the moment and write a one-liner which downloads a YouTube video.

Instead of parsing the YouTube video page, let’s look how an embedded YouTube video player on a 3rd party website gets the video.

Let’s go to this cool video and look at the embed html code:

html code for embedded youtube video

For this video it looks as following:

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/qg1ckCkm8YI"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/qg1ckCkm8YI" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

95% of this code is boring, the only interesting part is this URL:

http://www.youtube.com/v/qg1ckCkm8YI

Continue reading 'Downloading YouTube Videos with a Perl One-Liner' Continue reading ‘Downloading YouTube Videos with a Perl One-Liner’

Comments (52) Comments | Email Post Email 'Downloading YouTube Videos with a Perl One-Liner' to a friend | Print Post Print 'Downloading YouTube Videos with a Perl One-Liner' | Permalink Permalink to 'Downloading YouTube Videos with a Perl One-Liner' | Trackback Trackback to 'Downloading YouTube Videos with a Perl One-Liner'
(Popularity: 32%) 67,315 Views

Did you like this page? Subscribe to my posts!

Nothing delights me more than great books.
If you like my blog, I'd be thankful for a gift from my Amazon book wishlist. :)

ProgrammingHowtoHacker's Approach 10 Jul 2007 02:00 am
1 Star2 Stars3 Stars4 Stars5 Stars (14 votes, average: 4.5 out of 5)
Loading ... Loading ...

awk programming and youtubeAlright. Let’s get things going on this blog. This is the first post and I am still getting the design right so bear with me.

As I mentioned in the lengthy ‘About this blog‘ post, one of the things I love to do is figuring out how to get something done with the wrong set of tools. I love it because it teaches me the “dark corners” of those tools.

This will be a tutorial on how to download YouTube videos. I just love watching YouTube videos. One of the latest videos I watched was this brilliant commercial. Also I love programming and one of the languages I learned recently was the awk (the name awk comes from the initials of its designers: Alfred V. Aho, Peter J. Weinberger and Brian W. Kernighan) programming language. Would it be possible to download YouTube videos with awk?!

I do not want to go into the language details since that is not my goal today. If you want to learn this cool language check out this tutorial or these books.

The awk language originally does not have networking support so without using some networking tools which would create a network connection for us to pipe contents from YouTube to awk we would be out of luck. Also awk is not quite suited for handling binary data, so we will have to figure out how to read large amounts of binary data from the net in an efficient manner.

Let’s find out what Google has to say about awk and networking. Quick search for ‘awk + networking‘ gives us an interesting result - “TCP/IP Internetworking With `gawk’“. Hey, wow! Just what we were looking for! Networking support for awk in GNU’s awk implementation through special files!

Continue reading 'Downloading YouTube Videos with GNU Awk' Continue reading ‘Downloading YouTube Videos with GNU Awk’

Comments (41) Comments | Email Post Email 'Downloading YouTube Videos with GNU Awk' to a friend | Print Post Print 'Downloading YouTube Videos with GNU Awk' | Permalink Permalink to 'Downloading YouTube Videos with GNU Awk' | Trackback Trackback to 'Downloading YouTube Videos with GNU Awk'
(Popularity: 17%) 33,334 Views

Did you like this page? Subscribe to my posts!

Page 2 of 2«12