MIMETypesCodecs: Difference between revisions

From XiphWiki
Jump to navigation Jump to search
(→‎Codecs Parameter: undo until i find out whats what)
(→‎MIME Types: Add Opus to the audio/ogg table)
 
(20 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== Specification of MIME types and respective codecs parameter ==
== Specification of MIME types and respective codecs parameter ==
Also includes a specification of the recommended file extensions to use with Ogg.


=== MIME Types ===
=== MIME Types ===


The following MIME types are now officially registered with IANA (well, almost,
The following MIME types are now officially registered with IANA and specified with the IETF as [http://www.ietf.org/rfc/rfc5334.txt RFC 5334]:
see [[https://datatracker.ietf.org/idtracker/draft-goncalves-rfc3534bis/]]):


* application/ogg - for complex, multitrack, multiplexed files encapsulated in Ogg
{| class="wikitable" style="text-align: center;"
** requires a Skeleton logical bitstream
|-
** .ogx file extension
! MIME Type
** Macintosh File Type Code: OggX
! Use
! [[Ogg Skeleton|Skeleton]]<br />logical stream?
! File<br />Extension(s)
! Macintosh File<br />Type Code
|-
| video/ogg
| video (possibly with audio)<br />
encapsulated in Ogg
| recommended
| .ogv
| OggV
|-
| audio/ogg
| audio<br />encapsulated in Ogg
| recommended
| .oga<br />
.ogg ([[Vorbis]] I)<br />
.opus ([[Opus]])<br />
.spx ([[Speex]])
| OggA
|-
| application/ogg
| complex/multitrack/multiplexed files<br />
encapsulated in Ogg
| required
| .ogx
| OggX
|}


* video/ogg - for video encapsulated in Ogg
[[MIME_Types_and_File_Extensions|Other MIME types]] are still in the registration process.
** recommends a Skeleton logical bitstrem
** .ogv file extension
** Macintosh File Type Code: OggV


* audio/ogg - for audio encapsulated in Ogg
=== Codecs Parameter ===
** recommends a Skeleton logical bitstrem
** .oga file extension, .ogg for Vorbis I, .spx for Speex
** Macintosh File Type Code: OggA


[http://www.rfc-editor.org/rfc/rfc4281.txt Typically], MIME types of media encapsulation formats use the optional "codecs" parameter to specify which codecs are being used in a particular file.


[[MIME_Types_and_File_Extensions|Other MIME types]] are still in the process.
Codecs encapsulated in Ogg require a text identifier at the beginning of the first header page to identify the encapsulated codecs.


The following table contains the identifiers for existing Xiph codecs and the codec parameter names used for */ogg MIME types (in alphabetical order):


=== Codecs Parameter ===
{| class="wikitable" border="1"
 
[http://www.rfc-editor.org/rfc/rfc4281.txt Typically], MIME types of media encapsulation formats use the optional "codecs" parameter to specify which codes are being used in a particular file.
 
Codecs encapsulated in Ogg require a text identifier at the beginning of the first header page to identify the encapsulated codecs.  The following table contains the identifiers for existing Xiph codecs and the codecs parameter names used for */ogg MIME types (in alphabetical order):
 
{| class="codecstable" border="1"
|-
|-
! Codecs Parameter Name
! Codecs Parameter Name
! Codec Type
! Codec Identifier
! Codec Identifier
(decimal, hex, octal)
(decimal, hex, octal)
! Version Field (if available)
! Version Field (if available)
|-
| [http://wiki.xiph.org/index.php/OggDirac  dirac]
| char[0,5]: <tt>'BBCD\0'</tt>
hex: <tt>'0x42 0x42 0x43 0x44 00'</tt>
oct: <tt>'0102 0102 0103 0104 0000'</tt>
| ??
|-
|-
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h celt]
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h celt]
| audio
| char[0,8]: <tt>'CELT\ \ \ \ '</tt>
| char[0,8]: <tt>'CELT\ \ \ \ '</tt>
hex: <tt>'0x43 0x45 0x4c 0x54 0x20 0x20 0x20 0x20'</tt>
hex: <tt>'0x43 0x45 0x4c 0x54 0x20 0x20 0x20 0x20'</tt>
Line 53: Line 66:
|-
|-
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h cmml]
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h cmml]
| text
| char[0,8]: <tt>'CMML\0\0\0\0'</tt>
| char[0,8]: <tt>'CMML\0\0\0\0'</tt>
hex: <tt>'0x43 0x4d 0x4d 0x4c 0x00 0x00 0x00 0x00'</tt>
hex: <tt>'0x43 0x4d 0x4d 0x4c 0x00 0x00 0x00 0x00'</tt>
Line 59: Line 73:
| char[8,2]: major version number,
| char[8,2]: major version number,
char[10,2]: minor version number
char[10,2]: minor version number
|-
| [[OggDirac|dirac]]
| video
| char[0,5]: <tt>'BBCD\0'</tt>
hex: <tt>'0x42 0x42 0x43 0x44 0x00'</tt>
oct: <tt>'0102 0102 0103 0104 0000'</tt>
| ??
|-
|-
| [http://flac.sourceforge.net/ogg_mapping.html  flac]
| [http://flac.sourceforge.net/ogg_mapping.html  flac]
| audio
| char[0,5]: <tt>'\177FLAC'</tt>
| char[0,5]: <tt>'\177FLAC'</tt>
hex: <tt>'0x7F 0x46 0x4C 0x41 0x43'</tt>
hex: <tt>'0x7F 0x46 0x4C 0x41 0x43'</tt>
Line 69: Line 92:
|-
|-
| [[OggMNG|jng]]
| [[OggMNG|jng]]
| video
| char[0,8]: <tt>'\213JNG\r\n\032\n'</tt>
| char[0,8]: <tt>'\213JNG\r\n\032\n'</tt>
hex: <tt>'0x8b 0x4a 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'</tt>
hex: <tt>'0x8b 0x4a 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'</tt>
Line 76: Line 100:
|-
|-
| [[OggKate|kate]]
| [[OggKate|kate]]
| text
| char[0,8]: <tt>'\x80kate\0\0\0'</tt>
| char[0,8]: <tt>'\x80kate\0\0\0'</tt>
hex: <tt>'0x80 0x6b 0x61 0x74 0x65 0x00 0x00 0x00'</tt>
hex: <tt>'0x80 0x6b 0x61 0x74 0x65 0x00 0x00 0x00'</tt>
Line 84: Line 109:
|-
|-
| [http://lists.xiph.org/pipermail/vorbis-dev/2001-August/004501.html  midi]
| [http://lists.xiph.org/pipermail/vorbis-dev/2001-August/004501.html  midi]
| text
| char[0,8]: <tt>'OggMIDI\0'</tt>
| char[0,8]: <tt>'OggMIDI\0'</tt>
hex: <tt>'0x4f 0x67 0x67 0x4d 0x49 0x44 0x49 0x00'</tt>
hex: <tt>'0x4f 0x67 0x67 0x4d 0x49 0x44 0x49 0x00'</tt>
Line 91: Line 117:
|-
|-
| [[OggMNG|mng]]
| [[OggMNG|mng]]
| video
| char[0,8]: <tt>'\212MNG\r\n\032\n'</tt>
| char[0,8]: <tt>'\212MNG\r\n\032\n'</tt>
hex: <tt>'0x8a 0x4d 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'</tt>
hex: <tt>'0x8a 0x4d 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'</tt>
Line 96: Line 123:
oct: <tt>'0212 0115 0116 0107 0015 0012 0032 0012'</tt>
oct: <tt>'0212 0115 0116 0107 0015 0012 0032 0012'</tt>
| ??
| ??
|-
| [[OggOpus|opus]]
| audio
| char[0,8]: <tt>'OpusHead'</tt>
hex: <tt>'0x4f 0x70 0x75 0x73 0x48 0x65 0x61 0x64'</tt>
oct: <tt>'0117 0160 0165 0163 0110 0150 0141 0145 1044'</tt>
| char[8,1]: version field
|-
|-
| [[OggPCM|pcm]]
| [[OggPCM|pcm]]
| audio
| char[0,8]: <tt>'PCM\ \ \ \ \ '</tt>
| char[0,8]: <tt>'PCM\ \ \ \ \ '</tt>
hex: <tt>'0x53 0x70 0x65 0x65 0x78 0x20 0x20 0x20'</tt>
hex: <tt>'0x50 0x43 0x4d 0x20 0x20 0x20 0x20 0x20'</tt>


oct: <tt>'0123 0160 0145 0145 0170 0040 0040 0040'</tt>
oct: <tt>'0120 0103 0115 0040 0040 0040 0040 0040'</tt>
| char[8,2]: version major field,
| char[8,2]: version major field,
char[10,2]: version minor field
char[10,2]: version minor field
|-
|-
| [[OggMNG|png]]
| [[OggMNG|png]]
| video
| char[0,8]: <tt>'\211PNG\r\n\032\n'</tt>
| char[0,8]: <tt>'\211PNG\r\n\032\n'</tt>
hex: <tt>'0x89 0x50 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'</tt>
hex: <tt>'0x89 0x50 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'</tt>
Line 113: Line 150:
|-
|-
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h  speex]
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h  speex]
| audio
| char[0,8]: <tt>'Speex\ \ \ '</tt>
| char[0,8]: <tt>'Speex\ \ \ '</tt>
hex: <tt>'0x53 0x70 0x65 0x65 0x78 0x20 0x20 0x20'</tt>
hex: <tt>'0x53 0x70 0x65 0x65 0x78 0x20 0x20 0x20'</tt>
Line 120: Line 158:
|-
|-
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h  theora]
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h  theora]
| video
| char[0,7]: <tt>'\x80theora'</tt>
| char[0,7]: <tt>'\x80theora'</tt>
hex: <tt>'0x80 0x74 0x68 0x65 0x6f 0x72 0x61'</tt>
hex: <tt>'0x80 0x74 0x68 0x65 0x6f 0x72 0x61'</tt>
Line 130: Line 169:
|-
|-
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h  vorbis]
| [http://svn.annodex.net/liboggz/trunk/src/liboggz/oggz_auto.h  vorbis]
| audio
| char[0,7]: <tt>'\x01vorbis'</tt>
| char[0,7]: <tt>'\x01vorbis'</tt>
hex: <tt>'0x01 0x76 0x6f 0x72 0x62 0x69 0x73'</tt>
hex: <tt>'0x01 0x76 0x6f 0x72 0x62 0x69 0x73'</tt>
Line 136: Line 176:
| char[7,4]: version field
| char[7,4]: version field
|-
|-
| yuv4mpeg
| [[OggYUV4MPEG|yuv4mpeg]]
| char[0,9]: <tt>'YUV4MPEG2'</tt>
| video
hex: <tt>'0x59 0x55 0x56 0x34 0x4d 0x50 0x45 0x47 0x32'</tt>
| char[0,8]: <tt>'YUV4MPEG'</tt>
hex: <tt>'0x59 0x55 0x56 0x34 0x4d 0x50 0x45 0x47'</tt>


oct: <tt>'0131 0125 0126 0064 0115 0120 0105 0107 0062'</tt>
oct: <tt>'0131 0125 0126 0064 0115 0120 0105 0107'</tt>
| ??
| char[8,1] = '2' (0x32) for yuv4mpeg format version 2
|}
|}



Latest revision as of 15:12, 17 November 2015

Specification of MIME types and respective codecs parameter

Also includes a specification of the recommended file extensions to use with Ogg.

MIME Types

The following MIME types are now officially registered with IANA and specified with the IETF as RFC 5334:

MIME Type Use Skeleton
logical stream?
File
Extension(s)
Macintosh File
Type Code
video/ogg video (possibly with audio)

encapsulated in Ogg

recommended .ogv OggV
audio/ogg audio
encapsulated in Ogg
recommended .oga

.ogg (Vorbis I)
.opus (Opus)
.spx (Speex)

OggA
application/ogg complex/multitrack/multiplexed files

encapsulated in Ogg

required .ogx OggX

Other MIME types are still in the registration process.

Codecs Parameter

Typically, MIME types of media encapsulation formats use the optional "codecs" parameter to specify which codecs are being used in a particular file.

Codecs encapsulated in Ogg require a text identifier at the beginning of the first header page to identify the encapsulated codecs.

The following table contains the identifiers for existing Xiph codecs and the codec parameter names used for */ogg MIME types (in alphabetical order):

Codecs Parameter Name Codec Type Codec Identifier

(decimal, hex, octal)

Version Field (if available)
celt audio char[0,8]: 'CELT\ \ \ \ '

hex: '0x43 0x45 0x4c 0x54 0x20 0x20 0x20 0x20'

oct: '0103 0105 0114 0124 0040 0040 0040 0040'

char[28,4]: version id
cmml text char[0,8]: 'CMML\0\0\0\0'

hex: '0x43 0x4d 0x4d 0x4c 0x00 0x00 0x00 0x00'

oct: '0103 0115 0115 0114 0000 0000 0000 0000'

char[8,2]: major version number,

char[10,2]: minor version number

dirac video char[0,5]: 'BBCD\0'

hex: '0x42 0x42 0x43 0x44 0x00'

oct: '0102 0102 0103 0104 0000'

??
flac audio char[0,5]: '\177FLAC'

hex: '0x7F 0x46 0x4C 0x41 0x43'

oct: '0177 0106 0114 0101 0103'

char[5,1]: binary major version number,

char[6,1]: binary minor version number of mapping

jng video char[0,8]: '\213JNG\r\n\032\n'

hex: '0x8b 0x4a 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'

oct: '0213 0112 0116 0107 0015 0012 0032 0012'

??
kate text char[0,8]: '\x80kate\0\0\0'

hex: '0x80 0x6b 0x61 0x74 0x65 0x00 0x00 0x00'

oct: '0200 0153 0141 0164 0145 0000 0000 0000'

char[9,1]: major version number,

char[10,1]: minor version number

midi text char[0,8]: 'OggMIDI\0'

hex: '0x4f 0x67 0x67 0x4d 0x49 0x44 0x49 0x00'

oct: '0117 0147 0147 0115 0111 0104 0111 0000'

char[8,1]: version field
mng video char[0,8]: '\212MNG\r\n\032\n'

hex: '0x8a 0x4d 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'

oct: '0212 0115 0116 0107 0015 0012 0032 0012'

??
opus audio char[0,8]: 'OpusHead'

hex: '0x4f 0x70 0x75 0x73 0x48 0x65 0x61 0x64'

oct: '0117 0160 0165 0163 0110 0150 0141 0145 1044'

char[8,1]: version field
pcm audio char[0,8]: 'PCM\ \ \ \ \ '

hex: '0x50 0x43 0x4d 0x20 0x20 0x20 0x20 0x20'

oct: '0120 0103 0115 0040 0040 0040 0040 0040'

char[8,2]: version major field,

char[10,2]: version minor field

png video char[0,8]: '\211PNG\r\n\032\n'

hex: '0x89 0x50 0x4e 0x47 0x0D 0x0A 0x1A 0x0A'

oct: '0211 0120 0116 0107 0015 0012 0032 0012'

??
speex audio char[0,8]: 'Speex\ \ \ '

hex: '0x53 0x70 0x65 0x65 0x78 0x20 0x20 0x20'

oct: '0123 0160 0145 0145 0170 0040 0040 0040'

char[28,4]: version id
theora video char[0,7]: '\x80theora'

hex: '0x80 0x74 0x68 0x65 0x6f 0x72 0x61'

oct: '0180 0164 0150 0145 0157 0162 0141'

char[7,1]: major version number,

char[8,1]: minor version number,

char[9,1]: version revision number

vorbis audio char[0,7]: '\x01vorbis'

hex: '0x01 0x76 0x6f 0x72 0x62 0x69 0x73'

oct: '0001 0166 0157 0162 0142 0151 0163'

char[7,4]: version field
yuv4mpeg video char[0,8]: 'YUV4MPEG'

hex: '0x59 0x55 0x56 0x34 0x4d 0x50 0x45 0x47'

oct: '0131 0125 0126 0064 0115 0120 0105 0107'

char[8,1] = '2' (0x32) for yuv4mpeg format version 2

The "char[x,y]" fields mean here: start at byte number x (counting from 0) for a length of y bytes.