Delivering Video via the Web
Video delivery is dominated by a few formats, including Quicktime, Real Media, and Windows Media. These encoding strategies are linked to schemes of market domination that ought to be of interest to creative professionals. Of the three major varieties mentioned above, only Apple's Quicktime offers the possibility of using cooperative international standards for encoding video, along the lines of what we have now for the JPEG image format. Instead, both Real and Microsoft would like to own the rights to the video formats that their software uses. This could mean that royalties would be owed to them for decades if their format emerges as a real winner. Probably the most dangerous is Microsoft, because they have so much industrial leverage and legal oversight of their activities has proven to be ineffective.

Consequently, in a very real sense, the decisions made by artists and creative professionals have an impact on the future of video delivered via the Web. The appeal of a ISO standard format, such as MP4 with codec XviD, that does not require any royalties for encoding or delivery, is obvious. Third party software developers would have access to the planning stages for improvements and extensions to the format. Distributing the XviD codec is also free for software developers. The main obstacle to the adoption of MP4/XviD has been that it isn't as simple to develop a video format as it was to develop JPEG. The superior functionality of alternatives has led to tentative adoption of the other formats, despite distribution software licensing fees and limited compatibility. Even Quicktime is not innocent of the problems cited here, because its most popular codecs were developed by Sorenson, a for-profit company with an interest in enforcing their patent rights. The main appeal of the Quicktime plugin is simply that, theoretically, it is capable of using video codecs that use emerging international standards for MP4 encoding that are largely free of patent entanglements (even JPEG is fighting off patent lawsuits).


Flash has made some progress in the delivery of video with the version 7 plugin. It allows for a video file, encoded in the .flv format to be streamed via HTTP or Flash Communications Server. The .flv format can also be generated on the fly by a program available on Linux called ffmpeg.
# frame 1
var nc = new NetConnection();
nc.connect(null);
var ns = new NetStream(nc);
video.attachVideo(ns);
ns.play('gopvideo.flv');
The process of preparing a Flash document to receive the .flv file involves some poorly documented steps.
  1. In the Library panel (you must add this from the Window menu), choose the little menu on the upper-right. Select "New Video".
  2. Drag the video item from the Library to the stage
  3. Highlight the video object on the stage and, using the Properties window, give it a name like "video" (see ActionScript above for reference to "video").
  4. Now place both the .swf file and the .flv file in the same folder on your web server.
The .swf file should be quite small, because the video data is arriving from the .flv file. This works in much the same way as MP3 audio that is streamed to the Flash plugin, except that .flv is not as widely used as MP3.
Codecs
The Sorenson company provides the codec used in the .flv format, which it calls "Spark". Although Macromedia brags in its promotional literature that they're using international standards such as H.263, the .flv format is not really compliant with that standard.

Almost all of the alternatives to Flash and .flv do not afford the Web programmer much control of playback. Efforts by Sun to produce a useful Media API that would not carry a licensing burden have failed. They even dropped support for MP3 files in their API because of legal issues. This means that Java applets that would deliver video need to use software that is not part of the default Java Plugin: a major disincentive to using Java as a rich media delivery mechanism.

Therefore, where Web-based video is concerned, as of 2004, the choices are fairly stark. Either you accept that video is linear and single-channel oriented, like television, or you deal with Flash's proprietary codec.

Audio
While it is possible to embed a background sound in a web page, which requires no plugin, this method doesn't offer much control over playback. Flash offers multiple channels (up to 8) and lets you either pre-load sounds ("Event sounds") or stream them (encoded as MP3 files). This means you can mix, pan, and fade among the channels, and you can stream data to reduce the initial download time of the .swf file.
s = new Sound();
s.loadSound( "sound.mp3", streaming ); // streaming being a boolean, true or false
s.setVolume(50); // half volume
s.start();

In the following example, the onSoundComplete callback function is triggered as soon as
the sound has finished playing.

m = "sound1";
createEmptyMovieClip( m, 1 );
s = new Sound( eval(m) );
s.attachSound( "libsound1" );
s.onSoundComplete = function() {
trace( "sound completed." );
};
s.start( 0, 1 ); // offset: 0, loops: 1

Encoding for Streaming
In order to stream with any format, it is necessary to encode the video first. With Flash, the .flv format can be encoded with Squeeze, or if the Sorenson codecs are installed, through other applications like Final Cut. As mentioned, the freeware utility ffmpeg can also be used. Some editions of the Flash MX application can convert to .flv from video formats such as AVI, MPEG, DV, or MOV.

Real and Quicktime encoding
Mike Barron writes: "Basically there is a QTServer that can be accessed via any SFTP client. Anyone who has a Mac account should have a QTServer account. If they don't, they need only see me to get one. Live streaming can now be done using QuickTime Broadcaster from virtually any Mac in the lab. And live, multi-camera shoots are even possible by checking out a couple cameras, the switcher and a Digital-to-Analog Converter.

There are also tutorials on our "stuff" site. The live streaming one is outdated and needs to be redone, but the main one is still fairly accurate. Here's the link if you want to point students to it: http://www2.sva.edu/stuff/home/workshops/QTSS_DEMO/INTRO.html"

Other resources