April 23rd, 2009 Posted in Computing | 1 Comment »
My recent experience in getting a short video hosted on a video sharing site has taught me a couple of lessons that I’d like to share.
The video in question is 11 minutes and 7 seconds long. It’s Theora video and Vorbis audio in an ogg container so the file extension is ogv. This is all open format stuff and at the moment most of the online sharing sites don’t deal well with open formats.
My first port of call was Youtube where I found that they like mp4 formatted videos. I used VLC’s transcoding Wizard to make an mp4 version of my video and I uploaded that. After a long wait for the upload and another long wait for Youtube to process it, I found that I had a few seconds too much video and I would not be able to host it on Youtube.
So I searched for other hosting sites and came across Vimeo who claimed not to have a 10 minute limit. I joined up and tried to upload my video there but some rogue scripting in their interface would lock Firefox solid every time I tried to upload, rendering my browser useless. Scratch Vimeo.
Next cab off the rank was Livevideo.com and I did the same again. Joined up and waited patiently to upload my file. This time all went well until Livevideo declared that it didn’t like my mp4 so I went back to the drawing board to make a new version. This time I searched the web for a while and came up with the fact that these hosting sites like video in h264 format and audio in aac.
This meant a command line transcode with ffmpeg, but that caused problems too. It turns out that the version of ffmpeg packaged for my Kubuntu system doesn’t have support for aac audio coding. So here’s what I did:
I used apt-get to remove ffmpeg:
sudo apt-get remove --purge ffmpeg
I used apt-get to grab ffmpeg’s build dependencies:
sudo apt-get build-dep ffmpeg
I installed a bunch of libraries that ffmpeg might need:
sudo apt-get install liblame-dev libfaad-dev libfaac-dev libxvidcore4-dev liba52-0.7.4 liba52-0.7.4-dev
I grabbed the source package for ffmpeg:
sudo apt-get source ffmpeg
Changed to that directory:
cd ffmpeg-0.cvs20070307/
Ran the configure script with all the options I’d need:
./configure --enable-gpl --enable-pp --enable-libvorbis --enable-libogg --enable-liba52 --enable-libdts --enable-dc1394 --enable-libgsm --disable-debug --enable-libmp3lame --enable-libfaad --enable-libfaac --enable-xvid --enable-pthreads --enable-x264
Compiled:
make
Made a deb package:
sudo checkinstall -D make install
Popped up a directory:
cd ..
And installed it:
sudo dpkg -i ffmpeg_0.cvs20070307-1_i386.deb
Whew. The hard yards done. Next was some fun and games discovering the magic incantation I’d need to turn my ogv into h264 with aac audio in an mp4 container. The full path to ffmpeg used because my PATH environment variable is out of step with the real world:
/usr/local/bin/ffmpeg -i MOV016.ogv -map 0:1 -map 0:2 -acodec aac djvu.mp4
All of which turned my 76 megabyte ogv into a 25 megabyte mp4, which uploaded cleanly to livevideo.com. Here:
http://www.livevideo.com/video/0F9D446BFD44422DA67D5DB8C5C4FF2E/djvu-presentation.aspx