Difference between revisions of "RealMedia"

From MultimediaWiki
Jump to navigation Jump to search
(.RMF)
(spelling/grammar)
Line 45: Line 45:
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.


Possible fourcc values are [[RealAudio 28.8|28_8]], [[RealAudio_dnet|dnet]] and [[RealAudio_sipr|sipr]].
Possible  
fourCC values are [[RealAudio 28.8|28_8]], [[RealAudio_dnet|dnet]] and [[RealAudio_sipr|sipr]].


  byte[4]  Header signature ('.', 'r', 'a', 0xfd)
  byte[4]  Header signature ('.', 'r', 'a', 0xfd)
Line 55: Line 56:
  dword    Header size - 16
  dword    Header size - 16
  word    Codec flavor
  word    Codec flavor
  dword    Coded Frame Size
  dword    Coded frame size
  byte[12] Unknown
  byte[12] Unknown
  word    Sub packet h
  word    Sub packet h
  word    Frame Size
  word    Frame size
  word    Sub Packet Size
  word    Subpacket size
  word    Unknown
  word    Unknown
  word    Sample rate
  word    Samplerate
  word    Unknown
  word    Unknown
  word    Sample size
  word    Sample size
  word    Channels
  word    Channels
  byte    genr string length (always 4)
  byte    Genre string length (always 4)
  byte[]  genr string
  byte[]  Genre string
  byte    Fourcc string length (always 4)
  byte    FourCC string length (always 4)
  byte[]  Fourcc string
  byte[]  FourCC string
  byte[3]  Unknown
  byte[3]  Unknown
  byte    Title string length
  byte    Title string length
Line 86: Line 87:
=== .ra version 5 ===
=== .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.
While the .ra header can contain version 5, there are no known RealAudio files with this format, and it's not known if they really exist.


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


This is the newer format which stores both audio and video.  All multi-byte numbers are stored in big endian-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:
A RealMedia file consists of a series of chunks. Each chunk has the following format:
Line 105: Line 106:
* CONT: Content description/metadata (typically one per file)
* CONT: Content description/metadata (typically one per file)
* DATA: File data
* DATA: File data
* INDX: File index (tipically one per stream)
* INDX: File index (typically one per stream)




=== RealMedia file header (.RMF) ===
=== RealMedia file header (.RMF) ===
This must be the first chunk in a RealMedia file. Only one .RMF can be present in a file. The only useful informations carried by .RMF is the number of headers.


A .RMF chunk have this format
This must be the first chunk in a RealMedia file. Only one .RMF can be present in a file. The only useful information carried by .RMF is the number of headers.
 
A .RMF chunk has the following format


  dword chunk type ('.RMF')
  dword chunk type ('.RMF')
  dword chunk size (tipically 0x12)
  dword chunk size (typically 0x12)
  word  chunk version (always 0, for every known file)
  word  chunk version (always 0, for every known file)
  dword file version
  dword file version
Line 120: Line 122:


Notes:
Notes:
* All known sample file version equal to 0
* All known sample files have version equal to 0.
* There is a sample with chunk size = 0x10, in that case file version is a word. Note that the sample have chunk version = 0 like all other files
* There is a sample with chunk size = 0x10, in that case file version is a word. Note that the sample has chunk version = 0 like all other files.


== Codecs ==
== Codecs ==

Revision as of 00:24, 27 February 2006

  • Extensions: rm, ra, rmvb
  • 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 describe audio streams in RM files.

The audio data part is just a stream of bytes with no structure. There is no index in .ra 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     Subpacket size
word     Unknown
word     Samplerate
word     Unknown
word     Sample size
word     Channels
byte     Genre string length (always 4)
byte[]   Genre 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 the .ra header can contain 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:

dword  chunk type (FOURCC)
dword  chunk size, including 8-byte preamble
word   chunk version
byte[] chunk payload

Real chunk types:

  • .RMF: RealMedia file header (only one per file, must be the first chunk)
  • PROP: File properties (only one per file)
  • MDPR: Stream properties (one for each stream)
  • CONT: Content description/metadata (typically one per file)
  • DATA: File data
  • INDX: File index (typically one per stream)


RealMedia file header (.RMF)

This must be the first chunk in a RealMedia file. Only one .RMF can be present in a file. The only useful information carried by .RMF is the number of headers.

A .RMF chunk has the following format

dword chunk type ('.RMF')
dword chunk size (typically 0x12)
word  chunk version (always 0, for every known file)
dword file version
dword number of headers

Notes:

  • All known sample files have version equal to 0.
  • There is a sample with chunk size = 0x10, in that case file version is a word. Note that the sample has chunk version = 0 like all other files.

Codecs

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

Audio
Video