QMedia v1.5

Using QMedia

Home | Playback | Internet delivery | Grabbing

Preparing for Internet delivery

QuickTime's browser plug-in adds extensive multimedia capabilities to browser windows by allowing QuickTime movies to be delivered over the web.

As you may have noticed while surfing the net, some QT movies start playing before the movie is entirely downloaded, as opposed to others that require that the entire movie file be downloaded before they can start playback. This feature, called http streaming, is particularly necessary on the web given that movie files typically weigh several megabytes.

This kind of streaming is http streaming and does not require any special software on the server side; any http server can do the job. There are other kinds of streaming, like the one involved in live webcasting, that require the presence of a streaming server software, like Entera or Apple's Darwin.

With QMedia you can create and edit movie files that may end up being delivered over the web, e.g. through 4D’s Internet-related features, a custom ITK-based http server, etc. In such cases, you will want your movies to be ready for http streaming so your application has to prepare them accordingly.

Streaming-capable movies fulfill a couple of prerequisites: their data must be in a single fork, they must be self-contained and they must be fast-start.

These requirements are achieved with a process called flattening. When QuickTime flattens a movie, it creates a single-fork, self-contained, fast-start copy. The media data in the flattened movie may be interleaved (good for playback) and the movie atom may be compressed (faster startup on the web).

Information and utilities for web preparation of movies can be found at the QuickTime website at Apple. The QuickTime Player Pro application also allows you to do this. With QMedia, flattening is done in 4D with the following code:



    $movieFile:= "" ` Let user choose source movie file
    $targetFile:= "" ` Display "Save as" dialog
    $flags:= 0 `No options

    $error:= QM_NewMovieFromFile($movieRef;$movieFile)

    If ($error = 0)

    $error:= QM_FlattenMovie($movieRef;$targetFile;$flags)
    $error:= QM_FreeMovie($movieRef)

    End if