MASH Archive File Formats
The MASH archive tools use a simple file format, which is very close to
the respective network transmission formats, RTP and SRM. Each
individual session is transmitted on a separate address/port and
consists of a number of streams, all of the same media type. The MASH
archive tools store media in individual files. All data packets of one
media type from a single source are stored in one file. For example,
consider a multimedia presentation consisting of audio, video and
mediaboard sessions. The collaboration has 3 participant sources, each
producing all three media types. Then 9 data files (*.dat) will be
generated. In addition, index files (*.idx) are generated for each data
file. Index files contain a mapping from time to data file position, and
allow fast random access. Finally, a catalog file (*.ctg) in plain text
is produced. The catalog file lists all of the component data and index
files for an archived collaboration. Loose synchronization between
streams from different sources is accomplished through recording
timestamps which indicate the wall clock time when streams were
received. The storage format
has been designed so that only the data files, (*.dat) are necessary
for playback. However, the current player implementation requires at
least data and index files. Each of the file types will be described
in more detail below.
Catalog file (*.ctg)
The catalog file has a plain text format designed to be manipulable by
humans. It consists of one or more stream records of the following
format, where each stream record starts on a new line.
START_STREAM
id=streamId
session=sessionId
datafile=dataFileName
indexfile=indexFileName
END_STREAM
Where streamId is an arbitrary name used to link streams with
indeces, and sessionId is a name used to group streams into
sessions. For example, in a multi-session with four video streams, all
four might share one session, or several sessions might be used, with
the streams divided between them. dataFileName and
indexFileName arguments give the data and index file names,
respectively. They are assumed to reside in the same directory as the
catalog file.
SDP information
The catalog file may also contain sdp information from the session recorded. This sdp information is recorded in the catalog file in its original format, in its entirety, enclosed in the tags START_SDP and END_SDP. For example:
START_SDP
v=0
o=schuett 3089487295 3089487394 IN IP4 128.32.130.14
s=CSCW Using CSCW - Class 14
i=Distance Learning Discussion
e=Angela Schuett (schuett@cs.berkeley.edu)
p=Angela Schuett (510)642-8919
c=IN IP4 224.8.8.2/63
t=0 0
a=tool:rsdr v5.0a9
a=type:test
m=audio 8000 RTP/AVP 0
c=IN IP4 224.8.8.2/63
m=video 8000 RTP/AVP 31
c=IN IP4 224.8.8.1/63
m=whiteboard 8000 udp mb
c=IN IP4 224.8.8.3/63
END_SDP
Data file (*.dat)
Data file formats are specialized for the data type represented.
Typically, data packets are stored verbatim in the file. Control
packets are filtered out since their information is time and connection
specific (for instance receiver connection quality reports). Useful
information from control packets is stored in the File Header and
Private Header sections of the file. The File Header structure is
uniform across data and index files. The Private Header structure is
used only for data files and is customized according to the protocol.
struct FileHeader {
char version[16];
char protocol[8];
char media[32];
char cname[128];
char name[128];
u_int32_t start_sec;
u_int32_t start_usec;
u_int32_t end_sec;
u_int32_t end_usec;
u_int32_t privateLen;
};
version indicates whether this is a data file, MDAT1.0,
or an index file, MIDX1.0
protocol indicates the transmission protocol used, either
RTP or SRM
media lists the media type, currently either audio, video
or mediaboard
cname is the unique name for the user. See the RTP or
SRM specs for further information. This is typically
username@host.domain
name is the real name used to describe the source e.g. "Jane
Doe, Berkeley"
start_sec and start_usec give the starting timestamp
for this stream in logical time.
end_sec and end_usec give the ending timestamp for
this stream in logical time.
privateLen gives the length of any private
header which may follow the file header.
The private header is a media specific header used to store source
information taken from control packets of that stream. The RTP private
header is as follows:
struct RTPprivatehdr {
char email[128];
char phone[64];
char loc[256]; // geographical user location
char tool[64]; // application or tool name
u_int32_t scale;
u_int32_t ssrc;
u_int32_t ref_rtp;
u_int32_t ref_tv_sec;
u_int32_t ref_tv_usec;
};
The fields email, phone, loc and tool
are taken from the RTCP SDES packet. They give the source's e-mail
address, phone number, geographic location, and the data generating
application or tool name.
The scale field is used for converting media specific timestamps to
logical time.
ssrc is the synchronization source identifier, as described
in the logical time.
ref_tv_sec and ref_tv_usec give the received time
stamp for the first packet of data. In contrast, start_sec and
start_usec in the File Header give the
sender time stamp.
RTP Packet format
RTP data is stored as individual RTP packets, in the format described in
the RTP specifications, except for a small header added on to each
packet which contains
struct recordhdr {
u_int len;
u_char type;
u_char d2;
};
len is the length of the following packet
type is 0 for a data packet and 0x80 for a
control packet. Control packets are not currently included in the data
file.
d2 is an obsolete field. It may go away soon.
Logical time is used as the standard time format across all streams.
See the LTS Object documentation
for description of logical time conversions.
Index file (*.idx)
Index files begin with a File Header of the
same format as data files. The body of the file is a series of
uniformly sized index records. The current format is:
struct IndexRecord {
u_int32_t sentTS_sec;
u_int32_t sentTS_usec;
u_int32_t recvTS_sec;
u_int32_t recvTS_usec;
u_int32_t seqno;
u_int32_t filePointer;
};
sentTS_sec and sentTS_usec are sender timestamps in
logical time format for the referenced packet.
recvTS_sec and recvTS_usec are receiver timestamps for
the referenced packet. This field is not currently used and may go away.
seqno is the sequence number for the packet. For more
information, see the RTP or SRM specifications.
filePointer gives the offset into the file for the referenced
packet.
RTP RFC: text, Postscript, HTML
Other RTP information
Last updated March 11, 2003