The simplest and most foolproof way to share a video with your web site visitors is still to link to your MPEG Level 1 (.mpeg), MPEG Level 2 (also .mpeg), Quicktime (.mov), or AVI (.avi) video file using an ordinary anchor tag, like this: < a href="mymovie.mp2" >Watch My Movie< /a>
Embedding the video directly in the page itself is a bit trickier. Old and new browsers expect different HTML elements to be used for this purpose, and not every web browser is necessarily configured to display embedded videos at all. The best practice is to use both the modern < object > element and the old < embed > element; newer browsers are smart enough to ignore the latter when it is wrapped inside the former, like this: < object
width="320"
height="260"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
>
< param name="src" value="mymovie.mp2" >
< param name="controller" value="true" >
< param name="autoplay" value="true" >
< !-- Backwards Compatibility -- >
< embed
src="mymovie.mp2"
width="320"
height="260"
autoplay="true"
controller="true"
pluginspage="http://www.apple.com/quicktime/download/" >
< /embed >
< /object >
< a href="mymovie.mp2" >Can't see the video above? Click
here to download our video file, then launch it from your desktop.< / >
< a href="http://www.apple.com/quicktime/download/" >Still can't
see the video? Install Apple's free QuickTime player.< / >
The width and height attributes should match the size of the video, plus roughly 16-20 extra pixels of height to accommodate the player controls, if you have chosen to set controller to true. I recommend doing so because it allows your users to easily restart the video if it does not play well on the first try or they simply wish to see it again. The autoplay attribute determines whether the video will begin playing immediately when the page loads; I have set it to true in this example, which is probably best if you are attempting to make the process as simple as possible for inexperienced users. The ordinary link to the movie provided after the embedding elements offers users with browsers that are not configured to embed videos an alternative way to obtain your movie, and the link to Apple's QuickTime player provides a way to get player software if the user currently has none. QuickTime Player is a reasonable choice on both Windows and MacOS for QuickTime and also for most MPEG and AVI videos. Linux users will typically have MPlayer, which can view all major video formats excerpt for certain proprietary formats such as RealVideo and Microsoft Windows Media.
File Format Choices
For small, short videos without sound, MPEG Level 1 (.mpeg) is a good choice because of its universal compatibility. Larger videos and videos with sound can use the MPEG Level 2 (also .mpeg) format. Most video-creation software has the option of saving as MPEG Level 1 or 2.
For longer videos and those with larger resolutions, the new MPEG4 format is enormously superior because of its excellent compression. While this format will not be supported by some older computers and software, its advantages for large videos are too great to ignore, and players are available for MacOS X, Windows, and Linux. This includes direct support in the standard players from Apple and Microsoft. However, those who must support older computers that cannot run recent versions of Windows or MacOS may wish to consider using Apple's QuickTime format (.mov).
Tools For Creating MPEG Videos
If you are using Microsoft Windows Movie Maker, which can only save in DV-AVI and the proprietary Windows Media Video (.wmv) format, there are conversion utilities available which can convert to MPEG formats for you. The well-reviewed Windows program FX-MPEG-Writer will convert DV-AVI to MPEG Level 1 for free, and offers full conversion between Windows Media Video and MPEG Level 2 for under $20. To convert to the new MPEG4 format under Windows, consider the reasonably priced mpegable X4 live software.
MacOS X users can use Apple's iMovie software to produce complete videos, including the conversion steps. The latest versions support creating MPEG4 files. Linux users will want to check out Kino. Linux-based conversion to MPEG4 can be accomplished with the mencoder utility, which is part of the MPlayer package.
File Size Issues
Video files are big. Very big. Enormous. We cannot overemphasize this. If you are paying for your web space and your video becomes popular, you will exceed your bandwidth allocation and be billed extra. If you are not paying for your web space, then your file will probably get removed from the site of your free hosting provider, or performance will be unacceptable for your users. You can help to prevent these problems by keeping your videos short, keeping your video resolution (the width and height of the actual video) small, and playing videos only when users actually ask you to do so by clicking on a link. Also consider hosting your videos with Streamload or a similar free or low-price service that is oriented around video. If you have control over your web server and a reasonable degree of system administration ability consider distributing your videos in a peer-to-peer fashion via BitTorrent.
Alternatives To True Video
Video is best used when nothing else will do. If your goal is to add dynamic elements to your web page design, consider using the highly space-efficient Macromedia Flash format instead of video. And, of course, there is always the option of creating a simple animated GIF file. Animated GIFs are supported by nearly all graphics creation programs and will play in virtually any browser, with the first frame appearing in rare environments that do not support animation.