6 A mimetype is a combination of two (short) strings (words), the content
7 type and the content subtype, that make up a pair that describes a file
8 content type. In multimedia, mime types are used to describe the media
9 streamtype . In GStreamer, obsiously, we use mimetypes in the same way.
10 They are part of a GstCaps, that describes a media stream. Besides a
11 mimetype, a GstCaps also contains stream properties (GstProps), which
12 are combinations of key/value pairs, and a name.
14 An example of a mimetype is 'video/mpeg'. A corresponding GstCaps could
16 GstCaps *caps = gst_caps_new("video_mpeg_type",
18 gst_props_new("width", GST_PROPS_INT(384),
19 "height", GST_PROPS_INT(288),
22 Obviously, mimetypes and their corresponding properties are of major
23 importance in GStreamer for uniquely identifying media streams.
27 Some streams may have mimetypes or GstCaps that do not fully describe
28 the stream. In most cases, this is not a problem, though. For a stream
29 that contains Ogg/Vorbis data, we don't need to know the samplerate of
30 the raw audio stream, for example, since we can't play it back anyway.
31 The samplerate _is_ important for _raw_ audio, so a decoder would need
32 to retrieve the samplerate from the Ogg/Vorbis stream headers (that are
33 part of the bytestream) in order to pass it on in the GstCaps that
34 belongs to the decoded audio ('audio/raw').
36 Another problem is that many media types can be defined in multiple ways.
37 For example, MJPEG video can be defined as video/jpeg, video/mjpeg,
38 image/jpeg, video/avi with a compression of (fourcc) MJPG, etc. None of
39 these is really official, since there isn't an official mimetype for
42 The main focus of this document is to propose a standardized set of
43 mimetypes and properties that will be used by the GStreamer plugins.
45 3) Different types of streams
46 -----------------------------
47 There are several types of media streams. The most important distinction
48 will be container formats, audio codecs and video codecs. Container
49 formats are bytestreams that contain one or more substreams inside it,
50 and don't provide any direct media data itself. Examples are Quicktime,
51 AVI or MPEG (bytestream). They mostly contain of a set of headers that
52 define the media stream(s) that is packed inside the container and the
54 Video codecs and audio codecs describe encoded audio or video data.
55 Examples are MPEG-1 video, DivX ;-) video, MPEG-1 layer 3 (MP3) audio
56 or Ogg/Vorbis audio. Actually, Ogg is a container format too (for Vorbis
57 audio), but these are usually used in conjunction with each other.
60 1 - AVI (Microsoft RIFF/AVI)
61 mimetype: video/x-msvideo
63 mimetype: video/x-quicktime
66 properties: 'systemstream' = 1 (INT)
72 mimetype: video/realmedia
73 7 - DV (Digital Video)
75 properties: 'systemstream' = 1 (INT)
80 For convenience, the fourcc codes used in the AVI container format will be
81 listed along with the mimetype and optional properties. All video codecs
82 share the properties 'width' and 'height', both INT, which define the size
83 of the frame (in pixels).
84 1a - Raw Video (YUV/YCbCr)
86 properties: 'format' = 'XXXX' (fourcc)
87 known fourccs: YUY2, IYUV/I420, Y41P, etc.
90 properties: 'format' = 'RGB ' (fourcc)
91 'endianness' = 1234/4321 (INT) <- endianness
92 'r_mask' = bitmask (0x..) (INT) <- red pixel mask
93 'g_mask' = bitmask (0x..) (INT) <- green pixel mask
94 'b_mask' = bitmask (0x..) (INT) <- blue pixel mask
95 'depth' = 15/16/24/32 (INT) <- bits per pixel (depth)
96 'bpp' = 16/24/32 (INT) <- bits per pixel (in memory)
97 2 - MPEG-1, -2 and -4 video (ISO/LA MPEG)
99 properties: 'systemstream' = 0 (INT)
100 'mpegversion' = 1/2/4 (INT)
101 known fourccs: MPEG, MPGI
102 3 - DivX ;-) 3.x, 4.x and 5.x video
104 properties: 'divxversion' = 3/4/5 (INT)
105 known fourccs: DIV3, DIV4, DIV5, DIVX, DX50, DIVX, divx
106 4 - Microsoft MPEG 4.1, 4.2 and 4.3
107 mimetype: video/x-msmpeg
108 properties: 'mpegversion' = 41/42/43 (INT)
109 known fourccs: MPG4, MP42, MP43
110 5 - Motion-JPEG (official and extended)
112 known fourccs: MJPG (YUY2 MJPEG), JPEG (any), PIXL (Pinnacle/Miro), VIXL
113 6 - Sorensen (Quicktime - SVQ1/SVQ3)
114 mimetypes: video/x-svq
115 properties: 'svqversion' = 1/3 (INT)
116 7 - H263 and related codecs
118 known fourccs: H263, i263, M263, x263, VDOW, VIVO
120 mimetype: video/realvideo
121 9 - Digital Video (DV)
123 properties: 'systemstream' = 0 (INT)
124 known fourccs: DVSD, dvsd
125 10 - Windows Media Video 1 and 2 (WMV)
127 properties: 'wmvversion' = 1/2 (INT)
130 known fourccs: xvid, XVID
133 known fourccs: 3IV1, 3IV2
135 mimetype: video/x-ogg-tarkin
137 mimetype: video/x-ogg-theora
139 mimetype: video/x-huffyuv
143 for convenience, the two-byte hexcodes (as are being used for identification
144 in AVI files) are also given
147 properties: 'rate' = X (INT) <- samplerate
148 'width' = X (INT) <- audio bitsize
149 'depth' = X (INT) <- same?
150 'law' = 0/1/2 (INT) <- no law (0), alaw (1) or mulaw (2)
151 'signedness' = X (BOOLEAN)
152 'channels' = X (INT) <- number of audio channels
153 'endianness' = 1234/4321 <- endianness of audio stream
154 2 - MPEG-1 layer 1/2/3 audio
156 properties: 'mpegversion' = 1/2/3 (INT)
158 mimetype: application/x-ogg
159 4 - Windows Media Audio 1 and 2 (WMA)
164 4 - Status of this document
165 ---------------------------
166 This document is currently under construction and the types listed in here
167 are purely imaginary. Don't take this as your starting point (yet).
169 Blame Ronald Bultje <rbultje@ronald.bitfreak.net> aka BBB for any mistakes