]> git.sesse.net Git - ffmpeg/blob - tests/ref/fate/opt
fate/prores-metadata : make output bit exact
[ffmpeg] / tests / ref / fate / opt
1 Testing default values
2 num=0
3 toggle=1
4 string=default
5 escape=\=,
6 flags=1
7 rational=1/1
8 video_rate=25/1
9 width=200 height=300
10 pix_fmt=0bgr
11 sample_fmt=s16
12 duration=1000
13 color=255 192 203 255
14 channel_layout=311=311
15 binary=62 69 6e 0
16 binary_size=4
17 num64=1
18 flt=0.333333
19 dbl=0.333333
20 TestContext AVOptions:
21   -num               <int>        E........ set num (from 0 to 100) (default 0)
22   -toggle            <int>        E........ set toggle (from 0 to 1) (default 1)
23   -rational          <rational>   E........ set rational (from 0 to 10) (default 1/1)
24   -string            <string>     E........ set string (default "default")
25   -escape            <string>     E........ set escape str (default "\=,")
26   -flags             <flags>      E........ set flags (default cool)
27      cool                         E........ set cool flag
28      lame                         E........ set lame flag
29      mu                           E........ set mu flag
30   -size              <image_size> E........ set size (default "200x300")
31   -pix_fmt           <pix_fmt>    E........ set pixfmt (default 0bgr)
32   -sample_fmt        <sample_fmt> E........ set samplefmt (default s16)
33   -video_rate        <video_rate> E........ set videorate (default "25")
34   -duration          <duration>   E........ set duration (default 0.001)
35   -color             <color>      E........ set color (default "pink")
36   -cl                <channel_layout> E........ set channel layout (default 0x137)
37   -bin               <binary>     E........ set binary value
38   -bin1              <binary>     E........ set binary value
39   -bin2              <binary>     E........ set binary value
40   -num64             <int64>      E........ set num 64bit (from 0 to 100) (default 1)
41   -flt               <float>      E........ set float (from 0 to 100) (default 0.333333)
42   -dbl               <double>     E........ set double (from 0 to 100) (default 0.333333)
43   -bool1             <boolean>    E........ set boolean value (default auto)
44   -bool2             <boolean>    E........ set boolean value (default true)
45   -bool3             <boolean>    E........ set boolean value (default false)
46
47 Testing av_opt_is_set_to_default()
48 name:       num default:1 error:
49 name:    toggle default:0 error:
50 name:  rational default:0 error:
51 name:    string default:0 error:
52 name:    escape default:0 error:
53 name:     flags default:0 error:
54 name:      cool default:1 error:Option not found
55 name:      lame default:1 error:Option not found
56 name:        mu default:1 error:Option not found
57 name:      size default:0 error:
58 name:   pix_fmt default:0 error:
59 name:sample_fmt default:0 error:
60 name:video_rate default:0 error:
61 name:  duration default:0 error:
62 name:     color default:0 error:
63 name:        cl default:0 error:
64 name:       bin default:0 error:
65 name:      bin1 default:1 error:
66 name:      bin2 default:1 error:
67 name:     num64 default:0 error:
68 name:       flt default:0 error:
69 name:       dbl default:0 error:
70 name:     bool1 default:0 error:
71 name:     bool2 default:0 error:
72 name:     bool3 default:1 error:
73 name:       num default:1 error:
74 name:    toggle default:1 error:
75 name:  rational default:1 error:
76 name:    string default:1 error:
77 name:    escape default:1 error:
78 name:     flags default:1 error:
79 name:      cool default:1 error:Option not found
80 name:      lame default:1 error:Option not found
81 name:        mu default:1 error:Option not found
82 name:      size default:1 error:
83 name:   pix_fmt default:1 error:
84 name:sample_fmt default:1 error:
85 name:video_rate default:1 error:
86 name:  duration default:1 error:
87 name:     color default:1 error:
88 name:        cl default:1 error:
89 name:       bin default:1 error:
90 name:      bin1 default:1 error:
91 name:      bin2 default:1 error:
92 name:     num64 default:1 error:
93 name:       flt default:1 error:
94 name:       dbl default:1 error:
95 name:     bool1 default:1 error:
96 name:     bool2 default:1 error:
97 name:     bool3 default:1 error:
98
99 Test av_opt_serialize()
100 num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0.001,color=0xffc0cbff,cl=0x137,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false
101 Setting entry with key 'num' to value '0'
102 Setting entry with key 'toggle' to value '1'
103 Setting entry with key 'rational' to value '1/1'
104 Setting entry with key 'string' to value 'default'
105 Setting entry with key 'escape' to value '\=,'
106 Setting entry with key 'flags' to value '0x00000001'
107 Setting entry with key 'size' to value '200x300'
108 Setting entry with key 'pix_fmt' to value '0bgr'
109 Setting entry with key 'sample_fmt' to value 's16'
110 Setting entry with key 'video_rate' to value '25/1'
111 Setting entry with key 'duration' to value '0.001'
112 Setting entry with key 'color' to value '0xffc0cbff'
113 Setting entry with key 'cl' to value '0x137'
114 Setting entry with key 'bin' to value '62696E00'
115 Setting entry with key 'bin1' to value ''
116 Setting entry with key 'bin2' to value ''
117 Setting entry with key 'num64' to value '1'
118 Setting entry with key 'flt' to value '0.333333'
119 Setting entry with key 'dbl' to value '0.333333'
120 Setting entry with key 'bool1' to value 'auto'
121 Setting entry with key 'bool2' to value 'true'
122 Setting entry with key 'bool3' to value 'false'
123 num=0,toggle=1,rational=1/1,string=default,escape=\\\=\,,flags=0x00000001,size=200x300,pix_fmt=0bgr,sample_fmt=s16,video_rate=25/1,duration=0.001,color=0xffc0cbff,cl=0x137,bin=62696E00,bin1=,bin2=,num64=1,flt=0.333333,dbl=0.333333,bool1=auto,bool2=true,bool3=false
124
125 Testing av_set_options_string()
126 Setting options string ''
127 OK    ''
128 Setting options string ':'
129 Missing key or no key/value separator found after key ':'
130 Error ':'
131 Setting options string '='
132 Missing key or no key/value separator found after key ''
133 Error '='
134 Setting options string 'foo=:'
135 Setting entry with key 'foo' to value ''
136 Key 'foo' not found.
137 Error 'foo=:'
138 Setting options string ':=foo'
139 Setting entry with key ':' to value 'foo'
140 Key ':' not found.
141 Error ':=foo'
142 Setting options string '=foo'
143 Missing key or no key/value separator found after key ''
144 Error '=foo'
145 Setting options string 'foo='
146 Setting entry with key 'foo' to value ''
147 Key 'foo' not found.
148 Error 'foo='
149 Setting options string 'foo'
150 Missing key or no key/value separator found after key 'foo'
151 Error 'foo'
152 Setting options string 'foo=val'
153 Setting entry with key 'foo' to value 'val'
154 Key 'foo' not found.
155 Error 'foo=val'
156 Setting options string 'foo==val'
157 Setting entry with key 'foo' to value '=val'
158 Key 'foo' not found.
159 Error 'foo==val'
160 Setting options string 'toggle=:'
161 Setting entry with key 'toggle' to value ''
162 Undefined constant or missing '(' in ''
163 Unable to parse option value ""
164 Error 'toggle=:'
165 Setting options string 'string=:'
166 Setting entry with key 'string' to value ''
167 OK    'string=:'
168 Setting options string 'toggle=1 : foo'
169 Setting entry with key 'toggle' to value '1'
170 Missing key or no key/value separator found after key 'foo'
171 Error 'toggle=1 : foo'
172 Setting options string 'toggle=100'
173 Setting entry with key 'toggle' to value '100'
174 Value 100.000000 for parameter 'toggle' out of range [0 - 1]
175 Error 'toggle=100'
176 Setting options string 'toggle==1'
177 Setting entry with key 'toggle' to value '=1'
178 Undefined constant or missing '(' in '=1'
179 Unable to parse option value "=1"
180 Error 'toggle==1'
181 Setting options string 'flags=+mu-lame : num=42: toggle=0'
182 Setting entry with key 'flags' to value '+mu-lame'
183 Setting entry with key 'num' to value '42'
184 Setting entry with key 'toggle' to value '0'
185 OK    'flags=+mu-lame : num=42: toggle=0'
186 Setting options string 'num=42 : string=blahblah'
187 Setting entry with key 'num' to value '42'
188 Setting entry with key 'string' to value 'blahblah'
189 OK    'num=42 : string=blahblah'
190 Setting options string 'rational=0 : rational=1/2 : rational=1/-1'
191 Setting entry with key 'rational' to value '0'
192 Setting entry with key 'rational' to value '1/2'
193 Setting entry with key 'rational' to value '1/-1'
194 Value -1.000000 for parameter 'rational' out of range [0 - 10]
195 Value -1.000000 for parameter 'rational' out of range [0 - 10]
196 Error 'rational=0 : rational=1/2 : rational=1/-1'
197 Setting options string 'rational=-1/0'
198 Error 'rational=-1/0'
199 Setting options string 'size=1024x768'
200 Setting entry with key 'size' to value '1024x768'
201 OK    'size=1024x768'
202 Setting options string 'size=pal'
203 Setting entry with key 'size' to value 'pal'
204 OK    'size=pal'
205 Setting options string 'size=bogus'
206 Setting entry with key 'size' to value 'bogus'
207 Unable to parse option value "bogus" as image size
208 Error 'size=bogus'
209 Setting options string 'pix_fmt=yuv420p'
210 Setting entry with key 'pix_fmt' to value 'yuv420p'
211 OK    'pix_fmt=yuv420p'
212 Setting options string 'pix_fmt=2'
213 Setting entry with key 'pix_fmt' to value '2'
214 OK    'pix_fmt=2'
215 Setting options string 'pix_fmt=bogus'
216 Setting entry with key 'pix_fmt' to value 'bogus'
217 Unable to parse option value "bogus" as pixel format
218 Error 'pix_fmt=bogus'
219 Setting options string 'sample_fmt=s16'
220 Setting entry with key 'sample_fmt' to value 's16'
221 OK    'sample_fmt=s16'
222 Setting options string 'sample_fmt=2'
223 Setting entry with key 'sample_fmt' to value '2'
224 OK    'sample_fmt=2'
225 Setting options string 'sample_fmt=bogus'
226 Setting entry with key 'sample_fmt' to value 'bogus'
227 Unable to parse option value "bogus" as sample format
228 Error 'sample_fmt=bogus'
229 Setting options string 'video_rate=pal'
230 Setting entry with key 'video_rate' to value 'pal'
231 OK    'video_rate=pal'
232 Setting options string 'video_rate=25'
233 Setting entry with key 'video_rate' to value '25'
234 OK    'video_rate=25'
235 Setting options string 'video_rate=30000/1001'
236 Setting entry with key 'video_rate' to value '30000/1001'
237 OK    'video_rate=30000/1001'
238 Setting options string 'video_rate=30/1.001'
239 Setting entry with key 'video_rate' to value '30/1.001'
240 OK    'video_rate=30/1.001'
241 Setting options string 'video_rate=bogus'
242 Setting entry with key 'video_rate' to value 'bogus'
243 Undefined constant or missing '(' in 'bogus'
244 Unable to parse option value "bogus" as video rate
245 Error 'video_rate=bogus'
246 Setting options string 'duration=bogus'
247 Setting entry with key 'duration' to value 'bogus'
248 Unable to parse option value "bogus" as duration
249 Error 'duration=bogus'
250 Setting options string 'duration=123.45'
251 Setting entry with key 'duration' to value '123.45'
252 OK    'duration=123.45'
253 Setting options string 'duration=1\:23\:45.67'
254 Setting entry with key 'duration' to value '1:23:45.67'
255 OK    'duration=1\:23\:45.67'
256 Setting options string 'color=blue'
257 Setting entry with key 'color' to value 'blue'
258 OK    'color=blue'
259 Setting options string 'color=0x223300'
260 Setting entry with key 'color' to value '0x223300'
261 OK    'color=0x223300'
262 Setting options string 'color=0x42FF07AA'
263 Setting entry with key 'color' to value '0x42FF07AA'
264 OK    'color=0x42FF07AA'
265 Setting options string 'cl=stereo+downmix'
266 Setting entry with key 'cl' to value 'stereo+downmix'
267 OK    'cl=stereo+downmix'
268 Setting options string 'cl=foo'
269 Setting entry with key 'cl' to value 'foo'
270 Unable to parse option value "foo" as channel layout
271 Error 'cl=foo'
272 Setting options string 'bin=boguss'
273 Setting entry with key 'bin' to value 'boguss'
274 Error 'bin=boguss'
275 Setting options string 'bin=111'
276 Setting entry with key 'bin' to value '111'
277 Error 'bin=111'
278 Setting options string 'bin=ffff'
279 Setting entry with key 'bin' to value 'ffff'
280 OK    'bin=ffff'
281 Setting options string 'num64=bogus'
282 Setting entry with key 'num64' to value 'bogus'
283 Undefined constant or missing '(' in 'bogus'
284 Unable to parse option value "bogus"
285 Error 'num64=bogus'
286 Setting options string 'num64=44'
287 Setting entry with key 'num64' to value '44'
288 OK    'num64=44'
289 Setting options string 'num64=44.4'
290 Setting entry with key 'num64' to value '44.4'
291 OK    'num64=44.4'
292 Setting options string 'num64=-1'
293 Setting entry with key 'num64' to value '-1'
294 Value -1.000000 for parameter 'num64' out of range [0 - 100]
295 Error 'num64=-1'
296 Setting options string 'num64=101'
297 Setting entry with key 'num64' to value '101'
298 Value 101.000000 for parameter 'num64' out of range [0 - 100]
299 Error 'num64=101'
300 Setting options string 'flt=bogus'
301 Setting entry with key 'flt' to value 'bogus'
302 Undefined constant or missing '(' in 'bogus'
303 Unable to parse option value "bogus"
304 Error 'flt=bogus'
305 Setting options string 'flt=2'
306 Setting entry with key 'flt' to value '2'
307 OK    'flt=2'
308 Setting options string 'flt=2.2'
309 Setting entry with key 'flt' to value '2.2'
310 OK    'flt=2.2'
311 Setting options string 'flt=-1'
312 Setting entry with key 'flt' to value '-1'
313 Value -1.000000 for parameter 'flt' out of range [0 - 100]
314 Error 'flt=-1'
315 Setting options string 'flt=101'
316 Setting entry with key 'flt' to value '101'
317 Value 101.000000 for parameter 'flt' out of range [0 - 100]
318 Error 'flt=101'
319 Setting options string 'dbl=bogus'
320 Setting entry with key 'dbl' to value 'bogus'
321 Undefined constant or missing '(' in 'bogus'
322 Unable to parse option value "bogus"
323 Error 'dbl=bogus'
324 Setting options string 'dbl=2'
325 Setting entry with key 'dbl' to value '2'
326 OK    'dbl=2'
327 Setting options string 'dbl=2.2'
328 Setting entry with key 'dbl' to value '2.2'
329 OK    'dbl=2.2'
330 Setting options string 'dbl=-1'
331 Setting entry with key 'dbl' to value '-1'
332 Value -1.000000 for parameter 'dbl' out of range [0 - 100]
333 Error 'dbl=-1'
334 Setting options string 'dbl=101'
335 Setting entry with key 'dbl' to value '101'
336 Value 101.000000 for parameter 'dbl' out of range [0 - 100]
337 Error 'dbl=101'
338 Setting options string 'bool1=true'
339 Setting entry with key 'bool1' to value 'true'
340 OK    'bool1=true'
341 Setting options string 'bool2=auto'
342 Setting entry with key 'bool2' to value 'auto'
343 OK    'bool2=auto'
344
345 Testing av_opt_set_from_string()
346 Setting options string ''
347 OK    ''
348 Setting options string '5'
349 Setting 'num' to value '5'
350 OK    '5'
351 Setting options string '5:hello'
352 Setting 'num' to value '5'
353 Setting 'string' to value 'hello'
354 OK    '5:hello'
355 Setting options string '5:hello:size=pal'
356 Setting 'num' to value '5'
357 Setting 'string' to value 'hello'
358 Setting 'size' to value 'pal'
359 OK    '5:hello:size=pal'
360 Setting options string '5:size=pal:hello'
361 Setting 'num' to value '5'
362 Setting 'size' to value 'pal'
363 No option name near 'hello'
364 Error '5:size=pal:hello'
365 Setting options string ':'
366 Setting 'num' to value ''
367 Undefined constant or missing '(' in ''
368 Unable to parse option value ""
369 Error ':'
370 Setting options string '='
371 Setting '' to value ''
372 Option '' not found
373 Error '='
374 Setting options string ' 5 : hello : size = pal '
375 Setting 'num' to value '5'
376 Setting 'string' to value 'hello'
377 Setting 'size' to value 'pal'
378 OK    ' 5 : hello : size = pal '
379 Setting options string 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42'
380 Setting 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here' to value '42'
381 Option 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here' not found
382 Error 'a_very_long_option_name_that_will_need_to_be_ellipsized_around_here=42'