Mercurial > mplayer.hg
annotate DOCS/tech/codecs.conf.txt @ 13998:14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
author | diego |
---|---|
date | Sat, 20 Nov 2004 16:23:10 +0000 |
parents | 03471b3767e8 |
children | e2a4a2ce54a8 |
rev | line source |
---|---|
3860 | 1 Understanding MPlayer's etc/codecs.conf File |
2 | |
3 Introduction | |
4 ------------ | |
5 MPlayer features a very flexible codec architecture which allows it to | |
6 use its own open source codecs, as well as open source libraries, Win32 | |
7 codec DLLs, and XAnim binary codec modules. To the MPlayer user, the | |
8 most visible piece of this architecture is the etc/codecs.conf file. This | |
9 is a text-based configuration file that controls which MPlayer components | |
10 are in charge of handling particular compressed data formats. | |
11 | |
12 The codecs.conf file is stored either in a shared directory for all system | |
13 users to access, or in the .mplayer directory in a user's home | |
14 directory. When MPlayer starts, it first looks for a codecs.conf file in a | |
15 user's home directory. Failing that, it searches for the shared file. If | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
16 the file has syntax errors, MPlayer will not start and report the error. |
3860 | 17 |
18 The codecs.conf file is really quite simple. It is simply a collection of | |
19 codec definition blocks that define how different media types should be | |
20 handled. There are a number of keywords that can occur in a block. Not all | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
21 of them are required and no particular order is enforced. |
3860 | 22 |
23 Editing codecs.conf | |
24 ------------------- | |
25 You can edit codecs.conf using your favorite text editor. Anything that | |
26 comes after a semicolon (;) on a line is regarded as a comment. For | |
27 example: | |
28 ; this is a comment | |
29 format 0x34616d69 ; "ima4" (MOV files) | |
30 | |
31 The codec blocks can be in any order; the file parser doesn't | |
32 care. However, they are organized in a particular order for the benefit of | |
33 human readers. For example, all of the open source decoders that MPlayer | |
34 implements natively are grouped in one section. | |
35 | |
6200
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
36 Release Number |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
37 -------------- |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
38 Your codecs.conf now requires a release number to avoid codec release |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
39 incompatibilities. The format is simple: (YYYYMMDD) |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
40 |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
41 release 20020520 |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
42 |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
43 Whenever changes are made to the codecs that *require* an updated |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
44 codecs.conf, then MPlayer will no longer accept outdated versions. |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
45 It is not recommended to change this line unless you know exactly |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
46 what you are doing. |
e604be87613d
codecs.conf versioning - patch by Joey Parrish <joey@yunamusic.com>
arpi
parents:
5586
diff
changeset
|
47 |
3860 | 48 Video Codecs |
49 ------------ | |
50 Let's jump right in with an example. Here is an example video codec block: | |
51 | |
52 videocodec indeo5ds | |
53 info "Intel Indeo 5" | |
54 status working | |
55 fourcc IV50,iv50 | |
56 driver dshow | |
57 dll "ir50_32.dll" | |
58 guid 0x30355649, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 | |
59 out YV12 | |
60 out YUY2 | |
61 out BGR32,BGR24,BGR16,BGR15 | |
62 | |
63 This is a particularly full-featured video codec. The "videocodec" keyword | |
64 identifies the fact that this is the start of a new video | |
7350 | 65 codec. "indeo5ds" is MPlayer's unique name for the codec. You have to use |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
66 this name with the -vc/-ac option. |
3860 | 67 |
68 The next line has the keyword "info" which specifies a human-readable | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
69 comment accompanying this codec. This is printed by -vc help / -ac help. |
3860 | 70 |
71 The "status" keyword carries information about the codec's functional | |
72 status. MPlayer currently recognizes 4 status levels: working, buggy, | |
7350 | 73 crashing, and untested. When it gets to codec auto-selection, it tries |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
74 untested first (to force users to test it for us and report results :)), |
7350 | 75 then working and finally buggy ones. Codecs marked crashing won't be tried, |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
76 unless explicitly (-vc/-ac) selected. |
3860 | 77 |
78 The next line lists 4-character codes (FOURCCs) that are associated with | |
79 this codec. There can be more than one FOURCC specified on a fourcc line | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
80 as long as they are separated with a comma. There can also be multiple |
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
81 fourcc lines in the codec. A second fourcc can also be given, separated |
7350 | 82 with a space. MPlayer will replace the original fourcc in the headers with |
83 this one before opening the codec. It's useful for win32 codecs checking for | |
84 the fourccs. | |
3860 | 85 |
86 The "driver" keyword associates this codec with an internal MPlayer | |
87 decoder module. MPlayer has a module named "dshow" that handles data | |
7350 | 88 encoded by the codec. See -vfm help / -afm help for the available module list. |
3860 | 89 |
7350 | 90 The "dll" keyword specifies which Win32/XAnim/Real binary module needs to be |
3860 | 91 loaded in order to handle the specific media type. This keyword is usually |
7350 | 92 only used in conjunction with the dshow, vfw, acm, xanim and real drivers since |
3860 | 93 they all manage communication with binary-only modules. |
94 | |
95 The "guid" keyword identifies a 16-byte Microsoft GUID that some media | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
96 files use to identify codecs. Used only for win32 dshow and DMO codecs. |
3860 | 97 |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
98 The "out" keyword identifies which output format the decoder is known |
3860 | 99 to output. Just like the fourcc line, there can be multiple out lines or |
100 multiple comma-separated output formats on the same line. The output | |
101 formats should be listed in order of preference. | |
7398 | 102 |
7350 | 103 The outfmt values can be followed by one or more flags, like flip, noflip, |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
104 static, query. The flags are defined as follows: |
7398 | 105 |
106 "flip": | |
107 If this flag is set for a given format, then o_bih->biHeight will NOT be | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
108 set to -bih->biHeight, i.e. the image will be decoded upside-down. |
7398 | 109 Used only by vfw and vfwex codecs. |
110 | |
111 "noflip": | |
112 This flag is ignored (no effect) without "flip" being set! | |
113 If this flag is set, it means the codec doesn't decode upside-down, | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
114 although it's told to do so. |
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
115 |
7398 | 116 "yuvhack": |
117 This flag is required for the old win32 ms-mpeg4 vfw codecs, including | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
118 MP42 and DIV3 (DivX 3.11). These DLLs actually support YUV formats, |
7398 | 119 but the query/begin functions are buggy and don't accept YUV fourccs |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
120 (the decode function accepts it and works well!) |
7398 | 121 If this flag is set, then o_bih->biCompression will be set to 0 for |
122 the initialization for the YUV modes. Used only by vfw/vfwex codecs. | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
123 |
7398 | 124 "query": |
125 This flag is used to control VDCTRL_QUERY_FORMAT for vfw/vfewx codecs. | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
126 If this flag is set, the control() will query the codec for the csp |
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
127 support, otherwise it will assume a constant csp table. Required for |
7398 | 128 some DLLs (like huffyuv, CRAM). |
129 | |
130 "static", | |
131 This flag forces STATIC (instead of TEMP) buffer allocation for the codec. | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
132 Used for some very old DLLs like Indeo 3 and for some XAnim codecs like |
7398 | 133 cinepak. See dr-methods.txt for details on buffer types. |
3860 | 134 |
135 Audio Codecs | |
136 ------------ | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
137 Here is an example of a rather full-featured audio codec block: |
3860 | 138 |
139 audiocodec mp3 | |
140 info "MPEG layer-2, layer-3" | |
141 status working | |
142 comment "Optimized to MMX/SSE/3Dnow!" | |
143 format 0x50 | |
144 format 0x55 | |
145 format 0x33706d2e ; ".mp3" CBR/VBR MP3 (MOV files) | |
146 format 0x5500736d ; "ms\0\x55" older mp3 fcc (MOV files) | |
147 driver mp3lib | |
148 dll "mp3lib (mpglib)" | |
149 flags seekable | |
150 | |
151 Many of the keywords are the same as a video codec block. However, we see | |
152 a few that we haven't seen before. The "comment" keyword identifies | |
153 another human-readable note for this codec. | |
154 | |
155 The "format" keyword performs a similar job as the fourcc line. However, | |
156 since certain media file formats (notably AVI) identify audio formats with | |
157 16-bit numbers rather than 32-bit FOURCCs, it's necessary to use this | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
158 convention to accommodate them. However, as shown in this example, FOURCCs |
3860 | 159 can also be specified with the format keyword as long as they're converted |
160 to their hex representation. It's important to note that this can be | |
161 useful for video codecs as well if a FOURCC contains a space (such as | |
162 Apple's "rle " codec). | |
163 | |
164 The "flags" keywords identifies any additional abilities of this | |
13998
14c476d62fc2
Some fixes by myself and compn <tempn at twmi dot rr dot com>
diego
parents:
7398
diff
changeset
|
165 codec. Currently, seekable is the only supported flag. |
3860 | 166 |
167 EOF |