RealMedia: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
No edit summary
(Extended and clarified)
Line 8: Line 8:
== RA Format ==
== RA Format ==


RealAudio 1.0 file:
This is the old audio-only RealAudio file format.
A very similar structure is also used to descibe audio streams in RM files.


This is from the very first version of RealAudio (1994)These files can only contain 8kbps VSELP audio data. A FourCC (lpcJ) may be present, but it is ignored.
=== RealAudio 1.0 file (.ra version 3) ===


  bytes 0-3 '.', 'r', 'a', 0xfd
This is from the very first version of RealAudio (1994). These files can only contain [[RealAudio 14.4|8kbps VSELP]] audio data.  A FourCC (lpcJ) may be present, but it is ignored.
  bytes 4-5  0x00, 0x03
 
  bytes 6-7 Pointer to start of compressed audio data
byte[4] Header signature ('.', 'r', 'a', 0xfd)
  bytes 8-21 Unknown
  word    Version (always 3)
  bytes 22+:
  word    Header size - 7
   Title string, preceded by a length byte
  byte[10] Unknown
   Author string, preceded by a length byte
  dword    Data size
   Copyright string, preceded by a length byte
byte    Title string length
   Comment string, preceded by a length byte
byte[]   Title string
   ...
byte    Author string length
byte[]   Author string
byte    Copyright string length
byte[]   Copyright string
byte    Comment string length
byte[]   Comment string
byte    Unknown *
byte    Fourcc string length (always 4) *
byte[]   Fourcc string (always "lpcJ") *
   Audio data
   Audio data


RealAudio 2.0 file:
Notes:
*fields marked with * may be missing. Based on the only known sample with no fourcc, it's assumed that all these fields are either present or missing.
* the informative fields (title, author, copyright and comment) can have zero length.
 
 
=== RealAudio 2.0 file (.ra version 4) ===


This is second version of the RealAudio file format.  It is distinguished from the above by the value in byte 5 (=0x04).  This type of file must contain a valid FourCC to identify the audio codec.
This is second version of the RealAudio file format.  It is distinguished from the above by the value in byte 5 (=0x04).  This type of file must contain a valid FourCC to identify the audio codec.


  bytes 0-3  '.', 'r', 'a', 0xfd
Possible fourcc values are [[RealAudio 28.8|28_8]], [[RealAudio_dnet|dnet]] and [[RealAudio_sipr|sipr]].
  bytes 4-7  0x00, 0x04, 0x00, 0x00
 
  bytes 8-11 ".ra4"
byte[4] Header signature ('.', 'r', 'a', 0xfd)
  bytes 12-15 Data size (??)
  word    Version (always 4)
  bytes 16-17 Version (??)
word    Unused (always 0)
  bytes 18-21 Header size (??)
  byte[4] ra4 signature (always ".ra4")
  bytes 22-23 Codec flavor
  dword    Data size - 0x27
  bytes 24-27 Coded Frame Size
  word    Version2 (always equal to version)
  bytes 28-41 ???
  dword    Header size - 16
  bytes 42-43 Frame Size
  word    Codec flavor
  bytes 44-45 Sub Packet Size
  dword    Coded Frame Size
  bytes 46-47 ??
  byte[12] Unknown
  bytes 48-49 Sample rate
word    Sub packet h
  bytes 50-53 ??
  word    Frame Size
  bytes 54-55 Channels
  word    Sub Packet Size
  bytes 56+   Type and FourCC
  word    Unknown
  word    Sample rate
  word    Unknown
word    Sample size
  word    Channels
  byte    genr string length (always 4)
byte[]   genr string
byte    Fourcc string length (always 4)
byte[]  Fourcc string
byte[3]  Unknown
byte    Title string length
byte[]  Title string
byte    Author string length
byte[]  Author string
byte    Copyright string length
byte[]  Copyright string
byte    Comment string length
byte[]  Comment string
  Audio Data
 
Notes:
* the 0x27 in data size is the size of the fixed-length part of the header (up to channels).
* the informative fields (title, author, copyright and comment) can have zero length.


Version '5':
=== .ra version 5 ===


Same as above, except byte 5 = 0x05 and there are 6 more bytes after  'sub packet size', and the FourCC is not preceeded by a length byte.
While .ra header can have version 5, there are no known RealAudio files with this format, and it's not known if they really exist.


== RealMedia Format ==
== RealMedia Format ==

Revision as of 17:09, 24 February 2006

  • Extensions: rm, ra
  • Company: Real

Multimedia container format developed by Real and used almost exclusively for codecs developed by Real.

The old .ra files are just for audio. The newer RealMedia (.rm) files are for audio and video.

RA Format

This is the old audio-only RealAudio file format. A very similar structure is also used to descibe audio streams in RM files.

RealAudio 1.0 file (.ra version 3)

This is from the very first version of RealAudio (1994). These files can only contain 8kbps VSELP audio data. A FourCC (lpcJ) may be present, but it is ignored.

byte[4]  Header signature ('.', 'r', 'a', 0xfd)
word     Version (always 3)
word     Header size - 7
byte[10] Unknown
dword    Data size
byte     Title string length
byte[]   Title string
byte     Author string length
byte[]   Author string
byte     Copyright string length
byte[]   Copyright string
byte     Comment string length
byte[]   Comment string
byte     Unknown *
byte     Fourcc string length (always 4) *
byte[]   Fourcc string (always "lpcJ") *
 Audio data

Notes:

  • fields marked with * may be missing. Based on the only known sample with no fourcc, it's assumed that all these fields are either present or missing.
  • the informative fields (title, author, copyright and comment) can have zero length.


RealAudio 2.0 file (.ra version 4)

This is second version of the RealAudio file format. It is distinguished from the above by the value in byte 5 (=0x04). This type of file must contain a valid FourCC to identify the audio codec.

Possible fourcc values are 28_8, dnet and sipr.

byte[4]  Header signature ('.', 'r', 'a', 0xfd)
word     Version (always 4)
word     Unused (always 0)
byte[4]  ra4 signature (always ".ra4")
dword    Data size - 0x27
word     Version2 (always equal to version)
dword    Header size - 16
word     Codec flavor
dword    Coded Frame Size
byte[12] Unknown
word     Sub packet h
word     Frame Size
word     Sub Packet Size
word     Unknown
word     Sample rate
word     Unknown
word     Sample size
word     Channels
byte     genr string length (always 4)
byte[]   genr string
byte     Fourcc string length (always 4)
byte[]   Fourcc string
byte[3]  Unknown
byte     Title string length
byte[]   Title string
byte     Author string length
byte[]   Author string
byte     Copyright string length
byte[]   Copyright string
byte     Comment string length
byte[]   Comment string
 Audio Data

Notes:

  • the 0x27 in data size is the size of the fixed-length part of the header (up to channels).
  • the informative fields (title, author, copyright and comment) can have zero length.

.ra version 5

While .ra header can have version 5, there are no known RealAudio files with this format, and it's not known if they really exist.

RealMedia Format

This is the newer format which stores both audio and video. All multi-byte numbers are stored in big endian format.

A RealMedia file consists of a series of chunks. Each chunk has the following format:

bytes 0-3    chunk type (FOURCC)
bytes 4-7    chunk size, including 8-byte preamble
bytes n..    chunk payload

Real chunk types:

  • .RMF: RealMedia file header
  • PROP: File properties
  • MDPR: Stream properties
  • CONT: Content description/metadata
  • DATA: File data
  • INDX: File index
  • '.','r','a',0xFD: Legacy RealAudio encapsulation
  • VIDO

Codecs

Codecs in RealMedia are identified by the following four character codes:

Audio
Video
  • rv10 - H.263
  • rv13 - H.263
  • rv20 - H.263+
  • rv30 - Unknown format
  • rv40 - Unknown format