Thursday, August 14, 2008

Playing with video

So here are some videos of Jack. Please excuse our voices in the video. :) It is embarrassing.

Jack Sneezing


Waking up!


Just another little video.



What follows is a chronicle of my adventures in finding a good way to post better quality videos online that are not public like on you-tube. I am still working on the solution, but tell me if the videos worked for you. You can ignore this part if you are just interested in looking at the videos.

Basically I wanted a way to have a little more control over posting videos and tried to find some opensource tools to help me. I figured flash video would be the optimum way to post videos since it is so universal and can generally stream high-quality video quickly. It is hard to find a good video player that works on the web.

The first thing I had to figure out was how flash video works on the web and how to embed my own flash video player on my website. Most everyone just embeds you-tube's player or other commercial players into their site, but I wanted a flash player that I could host myself. There are a lot of expensive solutions out there, but I finally stumbled across an opensource flash media player called flowplayer which basically lets you just point a flash application to a .flv (flash video) file and it will give you a player that will play the video. One of the nice things is that the flv format lets you you the player to the file and then the player can buffer it and it will "stream" the video and allow you to play higher quality videos fairly quickly, without having to wait for the whole video to load before you can play it. This is pretty standard these days.

Once I found the flash video player, I had to figure out a way to convert my huge avi video files from the camera into a small flv files that I could store on the web server. The best way to do this is with Adobe's flash software which is super expensive, so I had to look for some opensource solutions. One of the main problems is because I don't know very much about digital video conversion most of the lingo surrounding the software was confusing so I didn't know what I was looking for. The opensource projects all have funny names. So far I have downloaded Kibisis, Jahshaka, Avanti, ffe, and ffmpeg among others. The best free tool I could find was ffmpeg which is a command line program. It took me awhile to find an executable for windows, but it works pretty well. Then because the command line syntax is really complicated I downloaded a rough GUI application that works with ffmpeg. Although I wasn't able to figure out very many of the options, and haven't figured out compressions, I was able to turn my 100 mega-byte video into less than 10 megs with fairly good quality for a small web video. It beats you-tube's quality anyway (maybe you-tube has some advanced settings I don't know about).

Once I converted my videos I uploaded them to my server and had to figure out how to write the html to embed the flash. Flowplayer came with some javascript which I had to play around a little bit with to embed the videos but I got things working.

Now I have a solution that will hopefully work (pending whether I can get the javascript to execute in the embedded html of this post). I am hosting the videos on my own server which should make them less accessible to the public, and I can also store higher quality home videos.

Anyway, I know this is probably pointless to most of you but thought I would describe some of the fun I had. Hopefully I can learn a little more about compression and video streaming and see if I can come up with a better way to store and show high-quality videos.

3 comments:

CatherineWO said...

He is SO big, Becca and Mike--and so alert. Obviously, he has fantastic parents who are taking great care of him. We all stood around and watched the videos several times the other night when you posted them. THANK YOU!!!
Grandma O.

Amy said...

your baby is darling. Seriously so cute. Good to know things are going so well.

Becky R. said...

He's so cute! The videos worked great-I may have to have to come show me how to do it now...