📄 realmedia file format.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0059)http://globecom.net/ietf/draft/draft-heftagaub-rmff-00.html -->
<HTML><HEAD><TITLE>RealMedia File Format</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff link=#0000ff text=#000000 vLink=#ff0000>
<PRE>
Internet Draft Rahul Agarwal, RealNetworks
draft-heftagaub-rmff-00.txt Jeff Ayars, RealNetworks
Brad Hefta-Gaub, RealNetworks
Dale Stammen, RealNetworks
March 13, 1998 Expires: August 13, 1998
RealMedia File Format
STATUS OF THIS MEMO
This document is an Internet-Draft. Internet-Drafts are working
documents of the Internet Engineering Task Force (IETF), its areas, and
its working groups. Note that other groups may also distribute working
documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference material
or to cite them other than as ``work in progress''.
To learn the current status of any Internet-Draft, please check the
``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
ftp.isi.edu (US West Coast).
Distribution of this document is unlimited.
Abstract:
Introduction
The RealMedia File Format (RMFF) is designed to be a generic container
for streaming media data. This data may then be played back locally or
streamed over a network using protocols such as RTSP and RTP. The
format is data-independent, allowing any data type to be recorded,
manipulated and played back.
Note: This document is intended to be informational in nature of what
the file format in use by RealNetworks' RealServer and RealPlayer
implementations. Though we think that there are a lot of important
concepts embodied in this specification, and that it may even make the
basis of a "standard" file format, this is intended to eventually end
up as an Informational RFC.
Copyright Notice:
Copyright (C) RealNetworks (1998). All Rights Reserved.
R. Agarwal, J. Ayars, B. Hefta-Gaub, D. Stammen Page <A name=2>1
<HR>
INTERNET-DRAFT RTSP March 13, 1998
RealMedia File Format (RMFF)
1. File Format
2. Header Section
2.1 RealMedia File Header
2.2 Properties Header
2.3 Media Properties Header
2.4 Content Description Header
3. Data Section
3.1 Data Chunk Header
3.2 Data Packet Header
4. Index Section
4.1 Index Section Header
4.2 Index Record
1. File Format
RealMedia File Format is a standard tagged file format that uses
four-character codes to identify file elements. These codes are 32-bit,
represented by a sequence of one to four ASCII alphanumeric characters,
padded on the right with space characters. The data type for
four-character codes is FOURCC. Use the PN_FOURCC macro to convert four
characters into a four-character code.
The basic building block of a RealMedia File is a chunk, which is a
logical unit of data, such as a stream header or a packet of data. Each
chunk contains the following fields:
* four-character code specifying the chunk identifier
* 32-bit value specifying the size of the data member in the chunk
* blob of opaque chunk data
R. Agarwal, J. Ayars, B. Hefta-Gaub, D. Stammen Page <A name=3>2
<HR>
INTERNET-DRAFT RTSP March 13, 1998
Depending on its type, a top-level chunk can contain subobjects. This
document describes the tagged chunks contained in RMFF, as well as the
format of the data stored in each type of tagged chunk.
Tagged Chunk +----------------------+
| ID |
+----------------------+
| Size |
+----------------------+
| Data |
Tagged Chunk +----------------------+
| ID |
+----------------------+
| Size |
+----------------------+
| |
/+-------------+ |
Subchunk / | Data | |
\ | | |
\| | |
/+-------------+ |
Subchunk / | Data | |
\ | | |
\| | |
+-------------+ |
+----------------------+
Figure 1. Tagged File Formats
2. Header Section
Because RMFF is a tagged file format, the order of the chunks is not
explicit, except that the RealMedia File Header must be the first chunk
in the file. However, most applications write the standard headers into
the file's header section. The following chunks are typically found in
the header section of RMFF:
* RealMedia File Header (This must be the first chunk of the file)
* Properties Header
* Media Properties Header
* Content Description Header
After the RealMedia File Header object, the other headers may appear in
any order. All headers are required except the Index Header. The
following sections describe the individual header objects ,
R. Agarwal, J. Ayars, B. Hefta-Gaub, D. Stammen Page <A name=4>3
<HR>
INTERNET-DRAFT RTSP March 13, 1998
2.1 RealMedia File Header
Each RealMedia file begins with the RealMedia File Header, which
identifies the file as RMFF. There is only one RealMedia File Header in
a RealMedia file. Because the contents of the RealMedia File Header may
change with different versions of RMFF, the header structure supports an
object version field for determining what additional fields exists. The
following pseudo-structure describes the RealMedia File Header:
RealMedia_File_Header
{
UINT32 object_id;
UINT32 size;
UINT16 object_version;
if (object_version == 0)
{
UINT32 file_version;
UINT32 num_headers;
}
}
The RealMedia File Header contains the following fields:
object_id: 32 bits
The unique object ID for a RealMedia File ('.RMF'). All RealMedia
files begin with this identifier.
size: 32 bits
The size of the RealMedia header section in bytes.
object_version: 16 bits
The version of the RealMedia File Header object. All files created
according to this specification have an object_version number of 0
(zero).
file_version: 32 bits
The version of the RealMedia file in PN Version format. All files
created according to this specification have a major version number
of 1. This member is present on all RealMedia_File_Header objects
with an object_version of 0 (zero).
num_headers: 32 bits
The number of headers in the header section that follow the
RealMedia File Header. This member is present on all
RealMedia_File_Header objects with an object_version of 0 (zero).
R. Agarwal, J. Ayars, B. Hefta-Gaub, D. Stammen Page <A name=5>4
<HR>
INTERNET-DRAFT RTSP March 13, 1998
2.2 Properties Header
The Properties Header describes the general media properties of the
RealMedia File. Components of the RealMedia system use this object to
configure themselves for handling the data in the RealMedia file or
stream. There is only one Properties Header in a RealMedia file. The
following pseudo-structure describes the Properties header:
Properties
{
UINT32 object_id;
UINT32 size;
UINT16 object_version;
if (object_version == 0)
{
UINT32 max_bit_rate;
UINT32 avg_bit_rate;
UINT32 max_packet_size;
UINT32 avg_packet_size;
UINT32 num_packets;
UINT32 duration;
UINT32 preroll;
UINT32 index_offset;
UINT32 data_offset;
UINT16 num_streams;
UINT16 flags;
}
}
The Properties Header contains the following fields:
object_id: 32 bits
The unique object ID for a Properties Header ('PROP').
size: 32 bits
The size of the Properties Header in bytes.
object_version: 16 bits
The version of the RealMedia File Header object. All files created
according to this specification have an object_version number of 0
(zero).
R. Agarwal, J. Ayars, B. Hefta-Gaub, D. Stammen Page <A name=6>5
<HR>
INTERNET-DRAFT RTSP March 13, 1998
max_bit_rate: 32 bits
The maximum bit rate required to deliver this file over a network.
This member is present on all Properties objects with an
object_version of 0 (zero).
avg_bit_rate: 32 bits
The average bit rate required to deliver this file over a network.
This member is present on all Properties objects with an
object_version of 0 (zero).
max_packet_size: 32 bits
The largest packet size (in bytes) in the media data. This member is
present on all Properties objects with an object_version of 0 (zero).
avg_packet_size: 32 bits
The average packet size (in bytes) in the media data. This member
is present on all Properties objects with an object_version of 0
(zero).
num_packets: 32 bits
The number of packets in the media data. This member is present on
all Properties objects with an object_version of 0 (zero).
duration: 32 bits
The duration of the file in milliseconds. This member is present on
all Properties objects with an object_version of 0 (zero).
preroll: 32 bits
The number of milliseconds to pre-buffer before starting playback.
This member is present on all Properties objects with an
object_version of 0 (zero).
index_offset: 32 bits
The offset in bytes from the start of the file to the start of the
index header object. This member is present on all Properties
objects with an object_version of 0 (zero).
data_offset: 32 bits
The offset in bytes from the start of the file to the start of the
Data Section. This member is present on all Properties objects with
an object_version of 0 (zero).
num_streams: 16 bits
The number of media streams contained in the file. This member is
present on all Properties objects with an object_version of 0
(zero).
R. Agarwal, J. Ayars, B. Hefta-Gaub, D. Stammen Page <A name=7>6
<HR>
INTERNET-DRAFT RTSP March 13, 1998
flags: 16 bits
Flags indicating characteristics of the RealMedia file. The
following flags are defined:
o #define PN_SAVE_ENABLED 0x0001
Allows clients to save a copy of the RealMedia file to disk.
o #define PN_PERFECT_PLAY_ENABLED 0x0002
Allows clients to use extra buffering to ensure Perfect Play.
o #define PN_LIVE_BROADCAST 0x0004
The RealMedia file is being generated by a live broadcast.
2.3 Media Properties Header
The Media Properties Header describes the specific media properties of
each stream in a RealMedia File. Components of the RealMedia system use
this object to configure themselves for handling the media data in each
stream. There is one Media Properties Header for each media stream in a
RealMedia file. The following pseudo-structure describes the Media
Properties header:
Media_Properties
{
UINT32 object_id;
UINT32 size;
UINT16 object_version;
R. Agarwal, J. Ayars, B. Hefta-Gaub, D. Stammen Page <A name=8>7
<HR>
INTERNET-DRAFT RTSP March 13, 1998
if (object_version == 0)
{
UINT16 stream_number;
UINT32 max_bit_rate;
UINT32 avg_bit_rate;
UINT32 max_packet_size;
UINT32 avg_packet_size;
UINT32 start_time;
UINT32 preroll;
UINT32 duration;
UINT8 stream_name_size;
UINT8[stream_name_size] stream_name;
UINT8 mime_type_size;
UINT8[mime_type_size] mime_type;
UINT32 type_specific_len;
UINT8[type_specific_len] type_specific_data;
}
}
The Media Properties Header contains the following fields:
object_id: 32 bits
The unique object ID for a Media Properties Header ('MDPR').
size: 32 bits
The size of the Media Properties Header in bytes.
object_version: 16 bits
The version of the Media Properties Header object.
stream_number: 32 bits
The stream_number (synchronization source identifier) is a unique
value that identifies a media stream. Every data packet that
belongs to a media stream contains the same STREAM_NUMBER. The
STREAM_NUMBER enables a receiver of multiple media streams to
distinguish which packets belong to each media stream. This member
is present on all MediaProperties objects with an object_version of
0 (zero).
max_bit_rate: 32 bits
The maximum bit rate required to deliver this stream over a
network. This member is present on all MediaProperties objects
with an object_version of 0 (zero).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -