Uploading MP3s to Youtube, cloud-wise

Update: Some of my numbers were out by an order of magnitude, I’ve fixed them below, striking out the old ones and adding in the new ones. It’s a factor of 10 better than I thought it was, w00t!

Update 2: I’ve started talking technical details, starting with the Job Processing Engine, on EmlynTech, my tech blog.

I’ve been wanting to upload some mp3 files to youtube for a while, starting with pretty much everything from my website. I want to be able to put music on youtube because it’s a more easily shareable format; you can embed a youtube video, you can share youtube vids on facebook easily, etc. Plain audio formats aren’t shareable in quite as frictionless a way.

It turns out that this is a bit tricky to do. Youtube is for videos, not for music files per se. To be able to upload music you need to make a video file out of them, which means you need to have some visuals to go with the audio, and some software to combine them.

Now what to use as a visual can be simple or complex. The simplest is a single image shown throughout the entire video, no effects, nothing. Of course the most complex is some giant music video with synchronised dancers, claymation, and transforming robots, but I’m not trying to go there. Other options are multiple full screen still images, swapped in at various intervals, and possibly including effects and such (like spinning or sliding onto the screen, etc etc).

If we rule out giant killer robot bollywood and just stick with the still image approach (quite popular for music on youtube), the way to achieve this is to grab some video editting software. Windows Movie Maker on windows is fine, I’m ignorant of macs but know they have some really good software. Linux is a bit painful for this (it’s what I use), lots of alternatives but all a bit difficult or buggy, I got some mileage out of avidemux. Modern phones even seem to have some limited video editting software, which might work, or be a world of hurt.

What I actually managed to make work on Ubuntu for this specific task was a command line utility called mencoder. I recorded the audio and mastered is with Audacity, made a title page image using the Gimp, created the movie (mpeg) file using mencoder, and uploaded the result to youtube. If you allow for handwaving around the proprietary mp3 format, and youtube itself, then it was free software all the way. Lovely! Here’s the result.

But you know, the whole thing is still a bit too hard, even with decent gui video editing software. Why? Because what you want to do is take an mp3, an image, stick them together, and put it on youtube. What you actually have to do is open a video editor, import your images and audio in, author the video probably using a timeline, export the video in a format appropriate for youtube to your hard drive somewhere, find and upload that video to youtube, and either delete the file from your harddrive or leave it lying around as one more piece of kruft weighing down a life already weighed down with a surfeit of digital crap.

I’m thinking what I’d like to see is a web site for doing this. It would be specifically targeted at uploading audio files to youtube. It would allow you to choose the audio file, choose an image(s), and probably it would need to know your youtube login details. It would then upload the audio and image files, create the movie file for you, and upload it to youtube, all without your intervention, and without you needing to know a lot of detail about file formats and file sizes and whatnot.

I figure that if you were to do this at any reasonable scale, you’d need a master website, but you’d also need video processing machines to do the work. Very simply, a linux box with mencoder to do the work would fill this role nicely. Add a daemon to notice video processing jobs that need doing, invoke mencoder, upload the results to youtube, inform the master website as it goes. Add a webservice for the master website to use to create jobs and monitor their progress.

For the master website, anything with some server side processing and some kind of data store would do nicely.

A feasible cheap implementation would use Google App Engine for the master website, and Amazon Elastic Compute cloud to run the linux boxes. I did some calcs on this, I think the basic linux boxes (“small” in ECC terms) would cost a bit less than US$600 per year to run 24×7, including enough traffic to handle say 20,000 200000 jobs (the maximum that I estimate one “small” linux box would manage in a year, at 60o jobs / day). In fact I think it’s processing bound, and going to a “medium” high-cpu box would give 5x the performance, so you’d get to 100,000 1,000,000 jobs per year, at a bit over double the cost. Note that traffic is negligible in these calculations; transfering 100,000 mp3s, assuming 5mb average size, being transferred in from the user’s machine, and out to youtube, would cost $135, and 1,000,000 jobs is $1,350! Also note the storage here is transitory, so we only need working space, it doesn’t grow with total number of jobs (although it does grow with concurrent load).

So 200,000 jobs running on the “small” machine would cost about $600. 1,000,000 jobs running on the high cpu “medium” box would cost roughly $2000.

What really blew me away about these calcs is that I can probably afford to run one server like this and just fund it gratis (ie: my gift to the world). We are talking say $US1200 $US2000, or in the vicinity of $1500 $2500 Aussie dollars per year for 100,000 1,000,000 jobs. I probably spend near that on lunch at work each year, and I often take a packed lunch.

More sensibly, there’s a freemium model in there somewhere that’d work. From google adsense, to paid user accounts with some extra features, to a paypal begging bowl or stickers for sale, it’s just not a lot of cost to recoup.

I’m feeling quite post-abundance anarchistic these days. If there’s a mission for my life at the moment, it’s this:

  • Find something, even if it’s trivial. Make it free for everyone forever. Repeat.

This is one of those. It’s trivial, but I could make it exist and make it free. It’s low hanging fruit (it’s just not hard), and I’d learn a heap from doing it. So, it’s on!

Other ideas to add later: You could allow more complex tools for video creation, including a general timeline approach. You could allow pure audio editing, allowing people to compose an audio track out of other pieces, including effects etc. You could allow people to download results in whatever format they desire (ie: do conversions for them). You could provide a long upload service for youtube, automating chopping long videos into 10 minute lengths and uploading them all appropriately. etc.

Advertisements
Uploading MP3s to Youtube, cloud-wise

One thought on “Uploading MP3s to Youtube, cloud-wise

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s