Automatic Creation, Upload, and Annotation Of Online Videos

In: Portfolio

23 Jun 2009

Above: Embedded sample videos. You can find the complete video collection at the Century 21 Alliance channel and my channel.

Overview: To increase exposure for agents’ listings and create compelling marketing materials for their clients, I created the following system.

Workflow: A real estate professional uploads multiple photos at once through a Flash interface to the company internal content management system running on Joomla. Nightly, a cron job runs a application written in PHP. The PHP application takes the photos calculates their dimensions, scales them to the appropiate size, and optionally adds padding if necessary to fit the required dimensions. This is accomplished with the GD and image functions.

Then depending on the requested duration per photo and the selected frame rate creates all of the inbetweens for the final video. The  application automatically creates the visually appealling affects of panning out to wider angles and adjusting the opacity to fade between photos.  It also “paints” the appropiate credits on to the end of the videos to comply with copyright requirements.

After several thousand frames have been created, the application passes the frames to FFmpeg.  Before final processing by FFmpeg, the soundtrack must be created to combine with the movie timeline. First, the total length of the video is calculated from the frame rate, number of photos, and requested time between transitions. The application the passes an ogg file to SoX for processing most notably looping music for longer videos and fading out the sound track as the end approaches, thus avoiding a sudden, harsh stop.

With the photos and soundtrack now ready, FFmpeg can combine the visual and audio inputs to produce the final output an MPEG-4 encoded video. This video is then automatically uploaded to YouTube’s servers using the Google Data API provided in the Zend Framework. The videos are then programmatically given a 5-star rating and completed with relevant information about the listing.

About this blog

This portifolio represents a brief sampling of my work. More thorough demonstrations and walk-thrus of my latest and greatest work are available via remote virtual session on DimDim, a free flash based web conferencing tool.

Also note that I recently joined StackOverflow where you will find me asking and answering many web development questions.