Section 11 of 14 - Prev - Next
All sections - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14
When playing or viewing an AVI with a number of Microsoft Windows
applications, you will see a "phantom" final frame. The "phantom" frame
may appear as a blank frame or a duplicate of the last frame depending
on the Windows application.
For example, if you have a one second AVI file with 30 frames and
you view this AVI file with Microsoft VidEdit 1.1, VidEdit will
display positions that it numbers 0-30. The 30 position will appear as
a blank frame. Note that 0-30 means 31 total positions; there is a
"phantom" final frame.
If you view the 30 frame AVI file with Microsoft Media Player, there
will also be positions 0-30. In this case, position 30 is a duplicate
of frame 29.
What is this?
The MCIAVI driver has a concept of the "end" or "position after the last
frame in an AVI". In the 30 frame AVI example above, positions 0 through
29 are the actual frames in the AVI file. 0 is the first frame, 1 is the
second frame, and 29 is the last (30'th) frame. Position 30 is the "end"
or "position after the last frame in an AVI".
The Microsoft Windows application, such as VidEdit 1.1 or Media Player,
decides what to display for this "end" position.
You can see this feature of the MCIAVI driver through the Media Player.
Open an AVI file through Media Player. Then, type Ctrl-F5 to invoke
a dialog box for entering MCI (Media Control Interface) string commands.
set time format frames
status length (would return 30 for the example above)
seek to start
status position (returns 0)
seek to end
status position (returns 30 - this is the "phantom" frame)
seek to 29 (this is the true last frame in the AVI file)
seek to 0
play
status position (returns 30)
In conclusion, the "phantom" final frame represents the position after
the last frame in the AVI file. It is NOT a frame in the AVI file.
Return to Top
Binary File Editors for Viewing and Editing AVI Files
Occasionally, you may need to view or edit an AVI file at the
down and dirty byte level. Use a binary file editor for this.
Many binary file editors, including quite a number of free
ones, exist.
HexEdit
Harmony Systems offers HexEdit, a free binary editor for Windows NT
and 95, that can be downloaded from their Web site:
http://www.hsys.com/hex.htm
SimTel Archives
The SimTel collection of ms-dos software includes a section with
many binary file editors. There are many mirrors of the SimTel
site. One is:
http://oak.oakland.edu/simtel.net/msdos/binaryed.html
HEdit 2.1
Trial versions of HEdit, a binary file editor, both for Windows 95/NT and
Windows 3.1 are available at:
http://www.yurisw.com/hedit/
GNU Emacs (Unix)
The GNU Emacs editor from the Free Software Foundation has a hexadecimal
mode. The GNU Emacs command to invoke this mode is hexl-mode.
In GNU Emacs, type the META Key (ESC-x)
Type: hexl-mode at the command prompt.
The current buffer will switch into (Hexl) mode.
On my Unix system (Sun), I found the Hexl mode a little sluggish
at times. Sometimes I had to wait several seconds to get a response
to scrolling or jumping to the start of the AVI file. Emacs modes
are usually implemented in interpreted LISP; this may be the reason.
beav (Unix)
beav, a binary file editor and viewer, is available for Unix.
beav displays the contents of a binary file as both hexadecimal and
ASCII in side by side views.
beav can edit as well as view binary files such as AVI files.
Unix Prompt% beav file.avi
od (Unix)
od is a common Unix command. It is NOT an editor. od
stands for Octal Dump.
od file.avi | more (Octal Dump of AVI File)
od -x file.avi | more (Hexadecimal Dump of AVI File)
od -a file.avi | more (ASCII Dump of AVI File)
Return to Top
RIFF and AVI Parser/Viewers
VidTrace
VidTrace is a 32-bit Windows console application for Windows 95 and
Windows NT that I wrote to parse and display RIFF and AVI files.
VidTrace displays the RIFF Forms, LISTS, and CHUNK. VidTrace also
understands the AVI header format, audio stream header format, and
video stream header format.
Sample output of VIDTRACE some-file.avi
RIFF (139086) AVI
LIST (2004) hdrl
avih (56)
Microseconds Per Frame: 33333
30.000300 Frames Per Second
Maximum Bytes Per Second: 1727488
Pad to Multiples of This Size: 6050647
Flags DWORD (hex): 710
FLAG: (AVIF_HASINDEX) AVI File Has 'idx1' chunk
FLAG: (AVIF_ISINTERLEAVED) AVI File is Interleaved
Total Frames: 239
Initial Frames: 23
Number of Streams: 2
Suggested Buffer Size: 57582
Width in Pixels: 160
Height in Pixels: 112
Scale (MAY BE UNUSED): 0
Rate (MAY BE UNUSED): 3220642425
Samples Per Second (MAY BE UNUSED): 3220642425
Start of AVI File (MAY BE UNUSED): 27920
Length of AVI File (MAY BE UNUSED): 4294967295
LIST (116) strl
strh (56)
Stream Type (Four Character Code): 'vids'
'vids' is Four Character Code for Video Stream
Installable Compressor (Four Character Code): 'vdow'
'VDOW' is Four Character Code for VDONet VDOWave Video Codec
Flags (hex): 0
Priority (MAY BE UNUSED) (hex): 0
Language Code (MAY BE UNUSED) (hex): 0
Initial Frames: 0
Scale: 33333
Rate: 1000000
Start: 0
Length: 239
Suggested Buffer Size: 1340
Quality: 0
Sample Size: 0
Frame (MAY BE UNUSED OR ABSENT): 0 0 0 2170023936
strf (40)
Windows Bitmap Header
Number of Bytes Required by Bitmap Structure: 40
Width of Bitmap in Pixels: 160
Height of Bitmap in Pixels: 112
Number of Planes: 1
Number of Bits Per Pixel (1,4,8,16,24, or 32): 24
Compression Mode (hex): 574f4456
COMPRESSION: Custom Compression 'VDOW'
Size of Image in Bytes: 53856
Horizontal Resolution in Pixels per Meter: 0
Vertical Resolution in Pixels per Meter: 0
Number of Color Indices Actually Used by the Bitmap: 0
Number of Color Indices Considered Important to Display Bitmap: 0
LIST (92) strl
strh (56)
Stream Type (Four Character Code): 'auds'
'auds' is Four Character Code for Audio Stream
Installable Compressor (Four Character Code): ''
'' is Four Character Code for Uncompressed Audio
Flags (hex): 0
Priority (MAY BE UNUSED) (hex): 0
Language Code (MAY BE UNUSED) (hex): 0
Initial Frames: 23
Scale: 1
Rate: 11025
Start: 0
Length: 87512
Suggested Buffer Size: 368
Quality: 0
Sample Size: 1
Frame (MAY BE UNUSED OR ABSENT): 0 0 0 2170023936
strf (16)
Windows Waveform Audio Header
Waveform Audio Format Type (hex): 1
Audio Format (WAVE_FORMAT_PCM): Microsoft Pulse Code Modulation Audio
Number of Channels of Audio: 1
Samples Per Second: 11025
Required Data Transfer Rates (Bytes Per Second): 11025
Block Alignment in Bytes: 1
Bits Per Sample: 8
Size of Extra Format Information Appended to End of WAVEFORMATEX Structure (Bytes): -15736
vedt (8)
JUNK (1688)
LIST (104908) movi
LIST (380) rec
01wb (367)
LIST (380) rec
01wb (368)
LIST (380) rec
01wb (367)
.
.
.
LIST (16) rec
00dc (4)
idx1 (11840)
DISP (21)
DISP (20268)
Download VIDTRACE
Microsoft RIFFWALK
Microsoft distributes a command line utility called RIFFWALK with the
16-bit Video for Windows 1.1e Development Kit that parses the
structure of RIFF and AVI files, displaying the file structure in RIFF
Forms, LISTS, and CHUNKS.
Sample output of RIFFWALK some-file.avi
00000000 RIFF (00021F4E) 'AVI '
0000000C LIST (000007D4) 'hdrl'
00000018 avih (00000038)
00000058 LIST (00000074) 'strl'
00000064 strh (00000038)
000000A4 strf (00000028)
000000D4 LIST (0000005C) 'strl'
000000E0 strh (00000038)
00000120 strf (00000010)
00000138 vedt (00000008)
000007E8 LIST (000199CC) 'movi'
0001A1BC idx1 (00002E40)
0001D004 DISP (00000015)
0001D022 DISP (00004F2C)
00021F56
The Video for Windows 1.1e Development Kit is included with the
16-bit SDK's in the Microsoft Developer Network CD-ROM's.
Bill Luken's RIFFSCAN
RIFFSCAN is another DOS console application that prints out
a human readable ASCII trace of RIFF and AVI files.
http://home.att.net/~wluken/bill2sw.htm
Return to Top
Effective Use of Video on a Web Page
The limited bandwidth of the Internet is the bane of effective
use of video on a Web page. Video clips on a Web page need to
be small. Even then downloading a video clip can take several
minutes, hours over a 28.8 modem to someone's home. The longer
the wait, the better the video should be!
FIRST AND FOREMOST, tell a story!!! A video clip without a
story is usually boring. A story can be told in 30
seconds, the duration of many television advertisements. Some
stories can be told in less time. Because of the bandwidth
limitations of the Internet, even 30 seconds is a big file, several
megabytes.
Characters, human personalities, sell. Sex sells. Violence
sells. Talking heads (your company's CEO saying "Welcome to our
great Web Site") tend to be boring.
USE AUDIO! Sound makes a world of difference. Use base, lower
frequencies in the soundtrack. Human beings are more sensitive to
low frequency sound. A soundtrack with more base tends to sound "better" to
most people. Most computer speakers are very cheap and don't
reproduce high frequencies well anyway. You will likely cheat
on higher frequencies to reduce bandwidth use by the audio as well.
TECHNICAL ISSUES
For widest distribution and ease of viewing:
Provide video clips as AVI using the Cinepak codec. For maximum
distribution, also provide flattened QuickTime files again using
the Cinepak codec; these can be played on both PC's with QuickTime
for Windows and on Macs. Provide MPEG-1 clips as well.
Give the size of the video file in KBytes or MBytes in text as part of
the link to the video file. This way the viewer can estimate how long
it will take to download the file if they wish to.
If you use less standard codecs or file formats to get smaller file
sizes, provide links to download the needed viewers or codecs.
Provide the AVI's with less standard codecs (e.g. VDOWave from VDONet)
in addition to Cinepak versions. Don't omit the Cinepak versions.
VIDEO ACCEPTABILITY
Video encoded at less than 15 frames per second usually looks very
jerky to human viewers, like a slide show rather than smooth motion.
Most viewers seem to perceive some jerkiness in 15 frame per second
video. The transition to smooth motion occurs somewhere in the range
15-17 frames per second. If motion is limited, frame rates below 15
may look acceptable, although often not.
The early motion picture industry standardized on 16 frame per second
film, which seemed to provide smooth motion in most cases. This
appears to be the origin of the folklore in video engineering that
16 frames per second is the transition to smooth motion.
Modern film uses 24 frames per second.
Image resolutions should be 320x240 or larger. In some cases, smaller
sizes such as 160x120 may work. In general, most viewers find sizes
smaller than 320x240 too small.
DO NOT COMPRESS the video so much that unnatural artifacts such as
blocking occur. In general loss of fine details appears natural
to human viewers. This corresponds to changes in natural viewing
conditions such as viewing an object at a distance or in poor lighting.
Unnatural artifacts such as visible 4x4 pixel blocks or 8x8 pixel
blocks jump out at most viewers and destroy the illusion of a natural
image.
AUDIO DISTRIBUTION
For AVI, sound codecs aren't very standard. Avoid using audio compression,
especially more exotic codecs. ADPCM may be ok. Again, if you use
an audio codec, make sure to include a link on your Web site to
download the codec. If possible, provide a version of the AVI without
special audio codecs (and Cinepak video).
AUDIO ACCEPTABILITY
Uncompressed audio takes space. You ALMOST NEVER need to use the 44
KHz sampling rate. At most, use 22 KHz sample rate. Many people
cannot hear the frequencies above 11 KHz (the sample rate is twice the
highest frequency that the sampled audio data can represent
faithfully). People who can hear frequencies between 11 KHz and 22
KHz are not very sensitive to these frequencies.
See if the soundtrack works ok at 11 KHz 8 bit Mono (not Stereo).
Use this low quality setting if you can get away with it (often this
won't work).
NOTE: You can select audio and video codecs, convert the frame rate,
convert the audio sampling rate, and resize the video using video
editor applications such as Adobe Premiere or VidEdit. See the
section on video editors:
Video Editors
TO REPEAT:
TELL A STORY!!! Many video clips in current (7/20/97) use on Web
sites are very short, a few seconds, and really don't tell a story.
These clips are boring! So are most talking heads (I have one on
my Web site and it IS boring). Movie trailers, short television
advertisements, etc. illustrate what is needed. If you don't have
a story, think seriously about dropping the video.
See elsewhere in this overview for information on authoring AVI files
and converting to QuickTime and MPEG-1.
Return to Top
How to embed an AVI file in a Web Page:
A Simple Hypertext Link
The simplest approach is to use the anchor tag
< A HREF="http://www.somplace.com/movie.avi" > A Movie </A>
In this instance, clicking on the link will cause the AVI file
to be downloaded. The browser recognizes that the AVI file is
not an HTML document. Typically, the browser invokes a helper
application that can play the AVI file, such as Media Player under
Windows 3.1. The movie will appear in a separate window. The browser
may have a plug-in that provides support for AVI, in which case the
video window will appear embedded in the HTML page.
Web browsers such as Netscape and Internet Explorer know how to handle
a file through a Content (MIME) type reported by the Web server. For
example, the MIME type for AVI files is video/avi. The browser may
contain a built-in decoder for this MIME type. For example, JPEG and
GIF still image compression decoding and viewing is built into
Internet Explorer and Netscape. The browser can be configured to
invoke a helper application such as Media Player. Helper applications
are invoked as separate applications with their own windows.
The browser can be configured to use a "plug-in" instead of a helper
application. A "plug-in" is a software component that extends the
capabilities of the browser. The "plug-in" handles input and presents
output embedded within the page. For example, a video plug-in's
decoded video appears within the page, not as a floating window.
In the case of a simple hypertext link, a browser with an AVI
plugin will jump to a blank page with the AVI video appearing in
a rectangle in the upper left corner of the blank page. The video
is not embedded in the page with the hypertext link. It is
necessary to use the Netscape EMBED HTML tag (see below) to produce a video
embedded in the page. Using the EMBED tag is different from using
a simple anchor A tag (hyptertext link).
If the browser is unable to handle a MIME type (no built-in capability
exists and no helper application or plug-in is specified), the browser
will present a dialog box asking the user to select an application,
save the file to disk, or cancel the operation.
In both Internet Explorer and Netscape, the user can configure the browser
to use helper applications or plug-ins as desired.
Netscape now provides a Netscape plug-in known as LiveVideo to play
AVI files. This plug-in should be installed in the \NETSCAPE\PLUGINS
directory. For the Windows 3.1 (16 bit) version of Netscape this
plug-in is named NPAVI16.DLL.
Digigami provides a plug-in for Netscape Navigator (Windows) called
CineWeb that adds playback of AVI, QuickTime .MOV, and MPEG files.
The URL is:
http://www.digigami.com/CineWebPress.html
Microsoft Internet Explorer HTML Syntax
Microsoft's Internet Explorer 2.0 added attributes to the IMG tag that
allow for inline video (an AVI file actually embedded in the page
rendered by the Web browser). These are the DYNSRC, CONTROLS, START, and
LOOP attributes. For example,
< IMG DYNSRC="movies/movie.avi" CONTROLS SRC="movies/movie.gif" >
This will embed the movie in the page with some simple playback controls
for the user to select. Browsers that do not support the DYNSRC attribute
will use the SRC attribute and display the image movie.gif instead.
Internet Explorer will ignore the SRC attribute.
In the Microsoft spirit of a new API every week, Microsoft has added
some new tags in Internet Explorer 3.0 and is discouraging use of the
IMG tag and DYNSRC attribute.
In Internet Explorer 3.0, Microsoft has added support for the Netscape
EMBED tag, see the section on HTML for Netscape's LiveVideo below.
Microsoft has also added a Microsoft specific OBJECT tag which does
essentially the same things as EMBED and is overtly linked with
Microsoft's OLE/COM/ActiveX environment. Naturally Microsoft
recommends using the OBJECT tag.
Unlike Netscape Navigator, Internet Explorer on Windows does not use
plug-ins, either from Micrsoft or 3rd parties, to view AVI. Rather it
invokes either the Video for Windows media player or the ActiveMovie
ActiveX control. If necessary, Internet Explorer is able to effectively
embed the applications in the Web page.
Microsoft has a copyrighted white paper "File References on HTML
Pages" on their Web site that provides a detailed description of
referencing AVI files on HTML pages for viewing with Internet Explorer.
http://www.microsoft.com/devonly/tech/amov1doc/amsdk008.htm
Since Microsoft reportedly has $9 billion in cash for acquisitions,
lawyers, and other fun - and I don't, I will refrain from simply
incorporating the document here.
Netscape LiveVideo HTML Syntax
If you hunt around the Netscape Web site you will find the following
detailed specification of the HTML syntax for embedding an AVI file
in a Web page for use with the LiveVideo Plug-in.
LIVEVIDEO SYNTAX
DESCRIPTION
LiveVideo plays video files in AVI format. (Currently for Windows 95 and
NT only.)
HTML SYNTAX
Section 11 of 14 - Prev - Next
All sections - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14
© allanswers.org | Terms of use