GXF: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
Line 34: Line 34:
The payload of a map packet has the following format:
The payload of a map packet has the following format:


   byte 0        0xE0
   byte 0        0xE0 (for version 0, version if it is ever created would have 0xE1 etc.)
   byte 1        0xFF
   byte 1        reserved, must be 0xFF
   bytes 2-3    length of material data
   bytes 2-3    length of material data
   bytes 4..    material data
   bytes 4..    material data
Line 49: Line 49:


* type 3 or 4: [[MJPEG]] video
* type 3 or 4: [[MJPEG]] video
* type 13 or 15: [[dvc]] video
* type 13 to 16: [[dvc]] or [[dvcp]] video
* type 14 or 16: [[dvcp]] video
* type 11, 12: [[MPEG-2]] video
* type 11, 12, or 20: [[MPEG-2]] video
* type 22 or 23: [[MPEG-1]] video
* type 22 or 23: [[MPEG-1]] video
For these, if the lowest bit (bit 0) is set, the video is encoded at 525 lines (NTSC), otherwise at 625 lines (PAL).
* type 20: [[MPEG-2]] video (HD, Main Profile at High Level)
* type 9: [[PCM]] audio
* type 9: [[PCM]] audio
** 24-bit, signed, little-endian, mono, 48000 Hz PCM
** 24-bit, signed, little-endian, mono, 48000 Hz PCM
* type 10: [[PCM]] audio
* type 10: [[PCM]] audio
** 16-bit, signed, little-endian, mono, 48000 Hz PCM
** 16-bit, signed, little-endian, mono, 48000 Hz PCM
For these, a stereo (or multi-channel) signal is encoding by using multiple audio tracks
* type 17: [[AC3]] audio
* type 17: [[AC3]] audio
** stereo, 48000 Hz audio
** 48000 Hz audio


=== Media Packet ===
=== Media Packet ===

Revision as of 02:41, 3 July 2006

The GXF is a container format associated with SMPTE360.

Format Description

A GXF file is comprised of a series of packets. Multi-byte numbers are stored in big endian format.

Packet Header

Each packet begins with a 16-byte header that has the following format:

 bytes 0-3    all 0
 byte 4       set to 1
 byte 5       packet type
 bytes 6-9    length of packet, including this 16-byte header
 bytes 10-13  reserved, currently all 0
 byte 14      set to 0xE1
 byte 15      set to 0xE2

Note that the length must be at least 16 (size of header). Note: in the ffmpeg demuxer the top byte (bits 31-24) is discarded and set to 0.

Packet Types

  • 0xBC: map packet
  • 0xBF: media packet
  • 0xFB: end-of-stream (EOS) indicator packet
  • 0xFC: FLT (field locator table) packet (useful to implement seeking)
  • 0xFD: UMF (unified material format) packet (additional format information, mostly redundant information or not needed for basic playback)

A GXF file must start with a map packet and end with an EOS packet. Files without EOS should be treated as incomplete. The map packet may be repeated and its values may change.

Map Packet

The payload of a map packet has the following format:

 byte 0        0xE0 (for version 0, version if it is ever created would have 0xE1 etc.)
 byte 1        reserved, must be 0xFF
 bytes 2-3     length of material data
 bytes 4..     material data
 2 bytes       length of track description
 bytes ..      track description
   1 byte      track type (bit 7 must be set)
   1 byte      track ID (valid track IDs must have top 2 bits set)
   2 bytes     length of track description

There may be data remaining in the map packet which can be skipped.

The bottom 7 bits of the track type determine the format for the stream identified by the bottom 6 bits of the track ID:

For these, if the lowest bit (bit 0) is set, the video is encoded at 525 lines (NTSC), otherwise at 625 lines (PAL).

  • type 20: MPEG-2 video (HD, Main Profile at High Level)
  • type 9: PCM audio
    • 24-bit, signed, little-endian, mono, 48000 Hz PCM
  • type 10: PCM audio
    • 16-bit, signed, little-endian, mono, 48000 Hz PCM

For these, a stereo (or multi-channel) signal is encoding by using multiple audio tracks

  • type 17: AC3 audio
    • 48000 Hz audio

Media Packet

A media packet contains encoded media data with the following format:

 byte 0        track type
 byte 1        track ID
 bytes 2-5     field number
 bytes 6-9     field information
 bytes 10-13   timeline field number
 byte 14       flags
 byte 15       reserved
 bytes 16..    remaining bytes contain encoded media