10l initial patch by Oded Shimon <ods15 at ods15.dyndns.org>
[mplayer/greg.git] / cfg-mencoder.h
blobd0ec47be1237beb885b4a9533a446bdd1e810d65
2 /*
3 * config for cfgparser
4 */
6 #include "cfg-common.h"
8 #ifdef USE_FAKE_MONO
9 extern int fakemono; // defined in dec_audio.c
10 #endif
11 #ifdef HAVE_ODIVX_POSTPROCESS
12 extern int use_old_pp;
13 #endif
15 extern int sws_flags;
16 extern int readPPOpt(void *, char *arg);
17 extern void revertPPOpt(void *conf, char* opt);
18 extern char *pp_help;
20 #ifdef HAVE_DIVX4ENCORE
21 extern m_option_t divx4opts_conf[];
22 #endif
24 #ifdef HAVE_MP3LAME
25 m_option_t lameopts_conf[]={
26 {"q", &lame_param_quality, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
27 {"aq", &lame_param_algqual, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
28 {"vbr", &lame_param_vbr, CONF_TYPE_INT, CONF_RANGE, 0, vbr_max_indicator, NULL},
29 {"cbr", &lame_param_vbr, CONF_TYPE_FLAG, 0, 0, 0, NULL},
30 {"abr", &lame_param_vbr, CONF_TYPE_FLAG, 0, 0, vbr_abr, NULL},
31 {"mode", &lame_param_mode, CONF_TYPE_INT, CONF_RANGE, 0, MAX_INDICATOR, NULL},
32 {"padding", &lame_param_padding, CONF_TYPE_INT, CONF_RANGE, 0, PAD_MAX_INDICATOR, NULL},
33 {"br", &lame_param_br, CONF_TYPE_INT, CONF_RANGE, 0, 1024, NULL},
34 {"ratio", &lame_param_ratio, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
35 {"vol", &lame_param_scale, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10, NULL},
36 {"lowpassfreq",&lame_param_lowpassfreq, CONF_TYPE_INT, CONF_RANGE, -1, 48000,0},
37 {"highpassfreq",&lame_param_highpassfreq, CONF_TYPE_INT, CONF_RANGE, -1, 48000,0},
38 {"nofree", &lame_param_free_format, CONF_TYPE_FLAG, 0, 0, 0, NULL},
39 {"free", &lame_param_free_format, CONF_TYPE_FLAG, 0, 0, 1, NULL},
40 {"br_min", &lame_param_br_min, CONF_TYPE_INT, CONF_RANGE, 0, 1024, NULL},
41 {"br_max", &lame_param_br_max, CONF_TYPE_INT, CONF_RANGE, 0, 1024, NULL},
42 #if HAVE_MP3LAME >= 392
43 {"fast", &lame_param_fast, CONF_TYPE_FLAG, 0, 0, 1, NULL},
44 {"preset", &lame_param_preset, CONF_TYPE_STRING, 0, 0, 0, NULL},
45 #else
46 {"fast", "MPlayer was built without -lameopts fast support (requires libmp3lame >=3.92).\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
47 {"preset", "MPlayer was built without -lameopts preset support (requires libmp3lame >=3.92).\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
48 #endif
49 {"help", MSGTR_MEncoderMP3LameHelp, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
50 {NULL, NULL, 0, 0, 0, 0, NULL}
52 #endif
54 #ifdef USE_LIBAVCODEC
55 extern m_option_t lavcopts_conf[];
56 #endif
58 #ifdef HAVE_TOOLAME
59 extern m_option_t toolameopts_conf[];
60 #endif
62 #ifdef USE_WIN32DLL
63 extern m_option_t vfwopts_conf[];
64 #endif
66 #if defined(HAVE_XVID3) || defined(HAVE_XVID4)
67 extern m_option_t xvidencopts_conf[];
68 #endif
70 #if defined(HAVE_X264)
71 extern m_option_t x264encopts_conf[];
72 #endif
74 extern m_option_t nuvopts_conf[];
76 m_option_t ovc_conf[]={
77 {"copy", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_COPY, NULL},
78 {"frameno", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_FRAMENO, NULL},
79 {"divx4", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_DIVX4, NULL},
80 // {"raw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAW, NULL},
81 {"lavc", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_LIBAVCODEC, NULL},
82 // {"null", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_NULL, NULL},
83 {"raw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAW, NULL},
84 {"vfw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_VFW, NULL},
85 {"libdv", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_LIBDV, NULL},
86 {"xvid", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_XVID, NULL},
87 {"qtvideo", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_QTVIDEO, NULL},
88 {"nuv", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_NUV, NULL},
89 {"x264", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_X264, NULL},
90 {"help", "\nAvailable codecs:\n"
91 " copy - frame copy, without re-encoding. Doesn't work with filters.\n"
92 " frameno - special audio-only file for 3-pass encoding, see DOCS.\n"
93 " raw - uncompressed video. Use fourcc option to set format explicitly.\n"
94 " nuv - nuppel video\n"
95 #ifdef HAVE_DIVX4ENCORE
96 #ifdef ENCORE_XVID
97 " divx4 - XviD (divx4linux compatibility mode)\n"
98 #else
99 " divx4 - divx4linux/divx5linux library (depends on configuration)\n"
100 #endif
101 #endif
102 #ifdef USE_LIBAVCODEC
103 " lavc - libavcodec codecs - best quality!\n"
104 #endif
105 #ifdef USE_WIN32DLL
106 " vfw - VfW DLLs, currently only AVID is supported.\n"
107 " qtvideo - QuickTime DLLs, currently only SVQ1/3 are supported.\n"
108 #endif
109 #ifdef HAVE_LIBDV095
110 " libdv - DV encoding with libdv v0.9.5\n"
111 #endif
112 #if defined(HAVE_XVID3) || defined(HAVE_XVID4)
113 " xvid - XviD encoding\n"
114 #endif
115 #ifdef HAVE_X264
116 " x264 - H.264 encoding\n"
117 #endif
118 "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
119 {NULL, NULL, 0, 0, 0, 0, NULL}
122 m_option_t oac_conf[]={
123 {"copy", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_COPY, NULL},
124 {"pcm", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_PCM, NULL},
125 #ifdef HAVE_MP3LAME
126 {"mp3lame", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_VBRMP3, NULL},
127 #else
128 {"mp3lame", "MPlayer was compiled without libmp3lame support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
129 #endif
130 #ifdef USE_LIBAVCODEC
131 {"lavc", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_LAVC, NULL},
132 #else
133 {"lavc", "MPlayer was compiled without libavcodec. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
134 #endif
135 #ifdef HAVE_TOOLAME
136 {"toolame", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_TOOLAME, NULL},
137 #else
138 {"toolame", "MPlayer was compiled without libtoolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
139 #endif
140 {"help", "\nAvailable codecs:\n"
141 " copy - frame copy, without re-encoding (useful for AC3)\n"
142 " pcm - uncompressed PCM audio\n"
143 #ifdef HAVE_MP3LAME
144 " mp3lame - cbr/abr/vbr MP3 using libmp3lame\n"
145 #endif
146 #ifdef USE_LIBAVCODEC
147 " lavc - FFmpeg audio encoder (MP2, AC3, ...)\n"
148 #endif
149 #ifdef HAVE_TOOLAME
150 " toolame - Toolame MP2 audio encoder\n"
151 #endif
152 "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
153 {NULL, NULL, 0, 0, 0, 0, NULL}
156 m_option_t info_conf[]={
157 {"name", &info_name, CONF_TYPE_STRING, 0, 0, 0, NULL},
158 {"artist", &info_artist, CONF_TYPE_STRING, 0, 0, 0, NULL},
159 {"genre", &info_genre, CONF_TYPE_STRING, 0, 0, 0, NULL},
160 {"subject", &info_subject, CONF_TYPE_STRING, 0, 0, 0, NULL},
161 {"copyright", &info_copyright, CONF_TYPE_STRING, 0, 0, 0, NULL},
162 {"srcform", &info_sourceform, CONF_TYPE_STRING, 0, 0, 0, NULL},
163 {"comment", &info_comment, CONF_TYPE_STRING, 0, 0, 0, NULL},
164 {"help", "\nAvailable INFO fields:\n"
165 " name - title of the work\n"
166 " artist - artist or author of the work\n"
167 " genre - original work category\n"
168 " subject - contents of the work\n"
169 " copyright - copyright information\n"
170 " srcform - original format of the digitzed material\n"
171 " comment - general comments about the work\n"
172 "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
173 {NULL, NULL, 0, 0, 0, 0, NULL}
176 m_option_t of_conf[]={
177 {"avi", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_AVI, NULL},
178 {"mpeg", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_MPEG, NULL},
179 {"rawvideo", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_RAWVIDEO, NULL},
180 {"help", "\nAvailable output formats:\n"
181 " avi - Microsoft Audio/Video Interleaved\n"
182 " mpeg - MPEG-1 system stream format\n"
183 " rawvideo - (video only, one stream only) raw stream, no muxing\n"
184 "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
185 {NULL, NULL, 0, 0, 0, 0, NULL}
188 extern float avi_aspect_override; /* defined in libmpdemux/muxer_avi.c */
189 extern int write_odml; /* defined in libmpdemux/muxer_avi.c */
191 m_option_t mencoder_opts[]={
192 /* name, pointer, type, flags, min, max */
194 {"endpos", parse_end_at, CONF_TYPE_FUNC_PARAM, 0, 0, 0, NULL},
196 // set output framerate - recommended for variable-FPS (ASF etc) files
197 // and for 29.97FPS progressive MPEG2 streams
198 {"ofps", &force_ofps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0, NULL},
199 {"o", &out_filename, CONF_TYPE_STRING, 0, 0, 0, NULL},
201 // limit number of skippable frames after a non-skipped one
202 {"skiplimit", &skip_limit, CONF_TYPE_INT, 0, 0, 0, NULL},
203 {"noskiplimit", &skip_limit, CONF_TYPE_FLAG, 0, 0, -1, NULL},
204 {"noskip", &skip_limit, CONF_TYPE_FLAG, 0, 0, 0, NULL},
206 {"audio-density", &audio_density, CONF_TYPE_INT, CONF_RANGE, 1, 50, NULL},
207 {"audio-preload", &audio_preload, CONF_TYPE_FLOAT, CONF_RANGE, 0, 2, NULL},
208 {"audio-delay", &audio_delay, CONF_TYPE_FLOAT, CONF_MIN, 0, 0, NULL},
210 {"x", "-x is obsolete, use -vf scale=w:h for scaling.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
211 {"xsize", "-xsize is obsolete, use -vf crop=w:h:x:y for cropping.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
213 // output audio/video codec selection
214 {"oac", oac_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
215 {"ovc", ovc_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
217 // output file format
218 {"of", of_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
220 // override FOURCC in output file
221 {"ffourcc", &force_fourcc, CONF_TYPE_STRING, 0, 4, 4, NULL},
223 // override avi aspect autodetection
224 {"force-avi-aspect", &avi_aspect_override, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL},
226 {"pass", "-pass is obsolete, use -lavcopts vpass=n, -xvidencopts pass=n, -divx4opts pass=n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
227 {"passlogfile", &passtmpfile, CONF_TYPE_STRING, 0, 0, 0, NULL},
229 {"vobsubout", &vobsub_out, CONF_TYPE_STRING, 0, 0, 0, NULL},
230 {"vobsuboutindex", &vobsub_out_index, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL},
231 {"vobsuboutid", &vobsub_out_id, CONF_TYPE_STRING, 0, 0, 0, NULL},
233 {"autoexpand", &auto_expand, CONF_TYPE_FLAG, 0, 0, 1, NULL},
234 {"noautoexpand", &auto_expand, CONF_TYPE_FLAG, 0, 1, 0, NULL},
236 {"encodedups", &encode_duplicates, CONF_TYPE_FLAG, 0, 0, 1, NULL},
237 {"noencodedups", &encode_duplicates, CONF_TYPE_FLAG, 0, 1, 0, NULL},
239 {"odml", &write_odml, CONF_TYPE_FLAG, 0, 0, 1, NULL},
240 {"noodml", &write_odml, CONF_TYPE_FLAG, 0, 1, 0, NULL},
242 // info header strings
243 {"info", info_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
245 #ifdef HAVE_DIVX4ENCORE
246 {"divx4opts", divx4opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
247 #endif
248 #ifdef HAVE_MP3LAME
249 {"lameopts", lameopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
250 #endif
251 #ifdef USE_LIBAVCODEC
252 {"lavcopts", lavcopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
253 #else
254 {"lavcopts", "MPlayer was compiled without libavcodec. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
255 #endif
256 #ifdef HAVE_TOOLAME
257 {"toolameopts", toolameopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
258 #else
259 {"toolameopts", "MPlayer was compiled without libtoolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
260 #endif
261 #ifdef USE_WIN32DLL
262 {"vfwopts", vfwopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
263 #endif
264 #if defined(HAVE_XVID3) || defined(HAVE_XVID4)
265 {"xvidencopts", xvidencopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
266 #endif
267 #if defined(HAVE_X264)
268 {"x264encopts", x264encopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
269 #endif
271 {"nuvopts", nuvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
273 #define MAIN_CONF
274 #include "cfg-common.h"
275 #undef MAIN_CONF
277 // {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
278 // {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
279 // {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
280 {NULL, NULL, 0, 0, 0, 0, NULL}