The end of summer that is.
Summer is bliss at a school district. The office is quiet. The phone rarely rings. I can devote plenty of time and attention to big projects. What would take days during the school year can be accomplished in a morning during the summer.
Unfortunately, those quiet days will be just a memory on Monday morning. Last week was the calm before the storm.
This is the time of year when chaos reigns at my job. All of my free time is soaked up by a swirling mass of work orders, e-mails, and phone calls. All of my planning, prioritizing, and delegating will soon be for nothing.
Lucky for me, the chaos will end almost as soon as it began. The students return in two weeks, whether we’re ready for them or not. And once they return, the chaos subsides and what’s left is a steady rhythm of work.
Amid the chaos is where the excitement hides. The start of the school year is a time of change. Even more so this year. We’ve made some big changes this summer and there are more to come…
My YouTube clone is coming along nicely so far.
The next step is to set up a database to store information about each video such as a title and description. I’m using MySQL for my application. Here’s a command to create a new database called video:
mysqladmin -u root create video
Note that since this is my development machine, I log in to MySQL as root with no password. Don’t do this in the real world.
Next, we’ll need to add a table to this database. Here’s a bit of SQL to take care of that:
create table videos (
id int not null auto_increment primary key,
upload_date timestamp default now(),
This is all pretty standard stuff. I created a primary key called id that auto increments, and a date field that automatically adds the current date. In a real application, I would probably use a few more fields for things like categories or tags, but this should suffice for now.
The last thing to do is insert some sample data. Here’s another piece of SQL to take care of that:
insert into videos (title, description, filename) values
("Sample Movie", "This is a sample movie", "sample.flv");
Now that the database is ready to go, I can start writing some code. I think I’ll write it first in Perl just to see how it goes.
The first step in building my YouTube clone is making sure all the programs on the server work. If you remember from yesterday, I’m using FFmpeg and JW FLV Player.
Here are some great instructions for installing FFmpeg on a Linux server. Unfortunately my Google-foo was not so strong this morning and I ended up playing around for a while before I found that page. The real trick is making sure you have LAME installed before you compile FFmpeg.
After that, converting a video from QuickTime to FLV is a simple command like this:
ffmpeg -i movie.mov -ar 22050 movie.flv
The -ar option sets the audio rate on the FLV file. Flash movies are very particular about audio bit rate. It must be either 44,100, 22,050, or 11,025. FFmpeg is smart enough to resample the audio track. Depending on the format of your original file, you might also need to specify the audio codec with -acodec mp3.
The JW FLV Player comes with a sample HTML file. It was a simple matter to replace their Flash movie with mine in the HTML and adjust the parameters so it would be the right size on the page.
So far everything has been pretty painless. Tomorrow things will get more interesting when I start trying to fully automate this process.
Yesterday I talked about choosing one framework to use to build web applications. I decided that the best way to evaluate them was to build a simple application. Not long after I wrote that post, the perfect application basically fell in my lap. (Maybe it’s true that the universe delivers what you need when you need it…)
We have several people at the school district that create videos of everything from daily announcements to sporting events. Currently there’s no easy way for parents to see the videos unless they come to the school or someone burns them a DVD. What we need is an easy way to put them on the web.
In other words, something almost exactly like YouTube. Except it needs to run on our server so we can control what gets uploaded and who gets to see it. I did a little research and found some free programs to make building this a little easier.
First, I’ll need to convert the uploaded files to Flash video format. FFmpeg is a command line program to convert videos. I even found a few examples of other people running it on a web server. The other piece I need is a Flash video player. A nice guy named Jeroen Wijering makes a free for noncommercial use FLV player called JW FLV Player.
So that’s my plan, a simple two or three page web application where people can upload videos (in a variety of formats). The server will convert the video to FLV and update a searchable list.Â Finally, I’ll use JW FLV Player to make them viewable on the web. The whole thing will also need to be password protected.
Over the next few days I’ll be building this application in Perl, PHP, Ruby, and Python. After that, I should have a really good idea about which framework works best for me. And then I can finally move on to bigger and better applications.
I’ve focused on tools for way too long. Back when I played guitar, I thought that if I bought a better guitar it would make me a better player. After that, I thought a faster computer would make me a more efficient programmer. Even more recently, I thought I needed a Mac to be a great web designer.
Now I have an expensive guitar, a fast PC, even a MacBook Pro, but my skills haven’t changed at all. I’m a decent guitar player. I can program anything I want, given enough time. I still couldn’t design a beautiful web page to save my life. But, I do feel like I’ve learned a valuable lesson.
I’ve been saying for years now that I was going to start a software business, but so far I’ve gotten no where. My problem is, again, focusing on the tools. My first big web application was written in Perl. Then I heard about PHP and started working with it. Then I moved on to the latest craze – Ruby on Rails. Now I’m looking at Python and Django.
Thankfully, I’ve finally seen the error of my ways. I’m ready now to stop worrying about the tools and just build something. I know enough about each one to make an educated decision and that’s all I need to know.
One last example – the old me would’ve never written this post. It’s late at night and I would’ve had to go into the office and either sit at the PC or get out my laptop. Instead I just grabbed a pen and some paper and I’m scribbling this down while I sit on the bed. How’s that for getting things done.
Using the right tool for the job is important, but it’s more important to focus on getting the job done.
If anybody still needs an invitation to Pownce, I have a few to give away. Leave a comment here and I’ll send you one…
I recently sold the domain EdTechForum.com to a nice guy from New Jersey. I’m not sure if anyone I know was even visiting that site. Just in case, be aware that I don’t own it anymore.
The new owner seems to be doing a great job with it. His design is very nice and it seems to have a lot more features than what I had.
The process of transferring the name to someone else was a little more complicated than I expected it to be. Surely this is something that happens all the time?
What I finally ended up doing was updating the WHOIS information with his name and e-mail address. He was then able to transfer the domain to his registrar. I’m not sure if this was the correct way to do it, but it got the job done.
I’m too busy to write anything right now…