neurofuzzy, flash game development, rich internet applications, free source code - *alt.neurotica.fuzzy*

neurofuzzy, flash game development, rich internet applications, free source code - *alt.neurotica.fuzzy*

4/11/2006

Quicktime, SMIL, and Binary Image Data

Filed under: General, Flash — geoff @ 6:15 pm

I’ve been wanting to be able to create slideshows in Quicktime format on Slideroll for a long time. It isn’t easy because it would involve creating Quicktime files dynamically with a server-side script. I was looking around for a human-readable format that Quicktime understands when I encountered SMIL.

SMIL stands for Synchronized Multimedia Integration Language, and it is a format for describing time-based audiovisual presentations. The specification is up to version 2.1, but has very very limited support. Realplayer has SMIL 2.0 support, and Quicktime has had SMIL 1.0 support since version 4.1, released in early 2000. Strangely, Quicktime has never offered any further upgrades to its SMIL support.

Quicktime accepts SMIL files that you create as plain text XML files that are renamed to .mov files. The only change you need to make is to add the header text “SMILtext” to the beginning of your XML file. I have had some success creating SMIL 1.0 compliant slideshows using PHP. One of my objectives was to create completely encapsulated Movies, instead of linking to external images. This way, movies can easily be saved, copied, and e-mailed without losing any external dependencies.

This took a little trickery. SMIL supports data placed directly in a source tag using this format:

<text region="aregion" dur="1:30"
src="data:text/plain,Copyright Apple Computer, 2000" />

This example shows plain text, but it can work for binary data as well, according to Apple’s site:

Note: The data: protocol identifier is followed immediately by the data format descriptor and a comma, then the actual data, with no blank spaces (except those that are part of the data). Because the SMIL file is a plain text file, binary data such as images must be encoded in a 7-bit ASCII format, such as Base64.

They don’t show an example of this, but I was able to enclose JPEG data in the XML tag by using the following format:

<img region="aregion" dur="1:30"
src="data:image/jpeg;base64,jpegdata" />

Where “jpegdata” is the base64 encoded binary JPEG data. SMIL readers will automatically unencode this data and display your images when the presentation is played. The only drawback to this method is that using base64 encoding increased your file size by 30%.

Once I had created my script, I was able to automatically download these files as MOVs and play them in Quicktime. These are plain vanilla SMIL files, so renaming them from .mov to .smil will allow you to play them in RealPlayer. RealPlayer doesn’t seem to mind the SMILtext header.

Since I could play my slideshows in Quicktime, I was hoping it would be a simple task to burn them to DVD. I tried importing the slideshow into iMovie, and got disappointing results. The images were shifted and they played about 10 times too fast. I’m not sure if the reason is buggy SMIL support, or perhaps iMovie prefers a particular resolution, fps, and timecode format. I also tried importing my Slideshows into Adobe After Effects on the PC, and it worked perfectly. Sony’s Vegas only displayed blank movies.

Bringing the movies into iTunes worked well, but trying to convert the movies using the “Convert Selection for iPod” tool resulted in a movie with a proper duration but showing only the first image. This was very disappointing since I felt like I was 90% of the way there, and it would have been nice to be able to syndicate content that could be played on an iPod Photo or Nano.

So, it seems that SMIL support is spotty and inconsistent. The original spec came out in 1998, with the most recent 2.1 out in September 2005. Apple hasn’t updated their SMIL support in years, and they seem to be moving away in favor of their own formats.

That leads me to my big question, and I doubt that anyone from Apple reads my blog, so I’m just throwing this out there. Is SMIL dead? Is there any other standard out there? I feel like the demand for adopting either SMIL or another standard will increase as we seek new ways to syndicate our audiovisual content. Since SMIL has been around for so long, I wonder why it hasn’t been adopted by the big players.

As far as my big experiment with SMIL and Quicktime, I’ve hit a wall. It really can’t go further due to limited support. My only other choice, if I want to be able to add things like transitions, zooms, pans, looping soundtracks, is to create Quicktime movies at the Atomic level. Attempting this in PHP makes my brain hurt even thinking about it.

3 Comments »

  1. hey nice title fonts! (what this comment is too short for you….?)

    Comment by felix — 4/12/2006 @ 9:25 am

  2. Thanks! I just installed sIFR. It’s pretty nifty… east to install, too. Although,I had problems when I tried to modify the line-height for wrapping headlines. The text would scale in odd ways. So, I had to make the text small enough so my longest headline fit on one line.

    Comment by geoff — 4/12/2006 @ 12:12 pm

  3. SMIL support in QuickTime never really went very far as you mention it was a little spotty and inconsistent - and more importantly was never updated (ditto for SWF support in QT).

    There’s an open source reference implementation called Ambulant that’s been fairly active - http://www.cwi.nl/projects/Ambulant/distPlayer.html - and might be of interest.

    Comment by Bryan Rieger — 11/28/2006 @ 1:47 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

 

Powered by WordPress