's original raspicam.htm and the "improvements" (mentioned above) that I made which he didn't appreciate.
Code: Select all
38,47c38,100
< function check(id1,opt,id2,id3,id4,id5,id6){
< if (id1.checked == true)
< {
< id1.value = opt;
< id2.disabled = false;
< id2.select();
< id3.disabled = false;
< id4.disabled = false;
< id5.disabled = false;
<
---
> // O_type and C_pipe are handled specially
> var settings = ['d', 'o', 'v', 'p', 'f', 'n', 'sh', 'co', 'br', 'sa', 'ISO', 'ev', 'ex', 'awb', 'ifx', 'cfx', 'mm', 'rot', 'hf', 'vf', 'w1', 'h1', 'q', 'r', 't1', 'tl', 'th', 'e', 'x', 'w2', 'h2', 'b', 't2', 'fps', 'vs', 'e2'];
>
> function generateCommand() {
> str = document.getElementById('O_type').value;
> for (i=0; i<settings.length; i++)
> {
> option = document.getElementById('C_'+settings[i]);
> if (option && option.checked)
> {
> str += ' -'+option.value;
> suboption = document.getElementById('C_'+settings[i]+settings[i]);
> if (suboption)
> {
> str += ' '+suboption.value;
> }
> }
> }
> if (document.getElementById('C_pipe').checked)
> {
> str += ' | '+document.getElementById('C_pipepipe').value;
> }
> return str;
> }
>
> function update(parent, opts, sepchar) {
> str = "";
> for (i=0; i<opts.length; i++)
> {
> suboption = document.getElementById('C_'+parent+opts[i]);
> if (suboption)
> {
> str += sepchar + suboption.value;
> }
> }
> document.getElementById('C_'+parent+parent).value = str.substr(1);
> }
>
> function check(which) {
> return checkdef(which, '')
> }
> function checkdef(which, def) {
> return check2def(which, def, '');
> }
> function check2(which, suffix) {
> return check2def(which, '', suffix);
> }
> function check2def(which, def, suffix) {
> checked = which.checked;
> suboption = document.getElementById('C_'+which.value+suffix+which.value+suffix);
> if (suboption)
> {
> if (checked)
> {
> suboption.disabled = false;
> suboption.select();
> }
> else
> {
> suboption.disabled = true;
> suboption.value = def;
> }
> }
49,61c102,104
< else if (id1.checked == false)
< {
< id1.value = "";
< id2.value = "";
< id2.disabled = true;
< id3.value = "";
< id3.disabled = true;
< id4.value = "";
< id4.disabled = true;
< id5.value = "";
< id5.disabled = true;
< id6.value = "";
< id6.disabled = true;
---
>
> function checkmulti(which, opts) {
> return checkmultidef(which, opts, []);
62a106,142
> function checkmultidef(which, opts, defs) {
> checked = which.checked;
> for (i=0; i<opts.length; i++)
> {
> suboption = document.getElementById('C_'+which.value+opts[i]);
> if (suboption)
> {
> if (checked)
> {
> suboption.disabled = false;
> if (i==0)
> {
> suboption.select();
> }
> }
> else
> {
> suboption.disabled = true;
> if (defs.length > i)
> {
> suboption.value = defs[i];
> }
> else
> {
> suboption.value = '';
> }
> }
> }
> }
> if (!checked)
> {
> suboption = document.getElementById('C_'+which.value+which.value);
> if (suboption)
> {
> suboption.value = "";
> }
> }
63a144
>
95,101c176,177
< <input type="checkbox" id="C_w" value="" onclick="check(C_w,' -w ',C_ww);" /> <i>-w</i> Set image width
< <input type="text" id="C_ww" class="txt" value="" disabled="true"/> (64 to 1920)
< <br>
< <input type="checkbox" id="C_h" value="" onclick="check(C_h,' -h ',C_hh);" /> <i>-h</i> Set image height
< <input type="text" id="C_hh" class="txt" value="" disabled="true"/> (64 to 1080)
< <br>
< <input type="checkbox" id="C_d" value="" onclick="check(C_d,' -d','');" /> <i>-d</i> Run a demo mode
---
> <input type="checkbox" id="C_d" value="d" onclick="checkdef(this,'250')" /> <i>-d</i> Run a demo mode
> <input type="text" id="C_dd" class="txt" value="250" disabled="true" /> (msec)
103c179
< <input type="checkbox" id="C_o" value="" onclick="check(C_o,' -o ',C_oo);" /> <i>-o</i> Output filename
---
> <input type="checkbox" id="C_o" value="o" onclick="check(this)" /> <i>-o</i> Output filename
106c182
< <input type="checkbox" id="C_v" value="" onclick="check(C_v,' -v');"/> <i>-v</i> Output verbose information during run
---
> <input type="checkbox" id="C_v" value="v" onclick="check(this)"/> <i>-v</i> Output verbose information during run
113,117c189,193
< <input type="checkbox" id="C_p" value="" onclick="check(C_p,' -p ',C_px,C_py,C_pw,C_ph,C_pp);" /> <i>-p</i> Preview window settings
< x <input type="text" id="C_px" class="txt" value="" disabled="true" onchange="C_pp.value = C_px.value + ',' + C_py.value + ',' + C_pw.value + ',' + C_ph.value" />
< y <input type="text" id="C_py" class="txt" value="" disabled="true" onchange="C_pp.value = C_px.value + ',' + C_py.value + ',' + C_pw.value + ',' + C_ph.value" />
< w <input type="text" id="C_pw" class="txt" value="" disabled="true" onchange="C_pp.value = C_px.value + ',' + C_py.value + ',' + C_pw.value + ',' + C_ph.value" />
< h <input type="text" id="C_ph" class="txt" value="" disabled="true" onchange="C_pp.value = C_px.value + ',' + C_py.value + ',' + C_pw.value + ',' + C_ph.value" />
---
> <input type="checkbox" id="C_p" value="p" onclick="checkmulti(this,['x','y','w','h'])" /> <i>-p</i> Preview window settings
> x <input type="text" id="C_px" class="txt" value="" disabled="true" onchange="update('p',['x','y','w','h'],',')" />
> y <input type="text" id="C_py" class="txt" value="" disabled="true" onchange="update('p',['x','y','w','h'],',')" />
> w <input type="text" id="C_pw" class="txt" value="" disabled="true" onchange="update('p',['x','y','w','h'],',')" />
> h <input type="text" id="C_ph" class="txt" value="" disabled="true" onchange="update('p',['x','y','w','h'],',')" />
120c196
< <input type="checkbox" id="C_f" value="" onclick="check(C_f,' -f');" /> <i>-f</i> Fullscreen preview mode
---
> <input type="checkbox" id="C_f" value="f" onclick="check(this)" /> <i>-f</i> Fullscreen preview mode
122c198
< <input type="checkbox" id="C_n" value="" onclick="check(C_n,' -n');" /> <i>-n</i> Do not display a preview window
---
> <input type="checkbox" id="C_n" value="n" onclick="check(this)" /> <i>-n</i> Do not display a preview window
129,130c205,206
< <input type="checkbox" id="C_sh" value="" onclick="check(C_sh,' -sh ',C_shsh);" /> <i>-sh</i> Set image sharpness
< <input type="text" id="C_shsh" class="txt" value="" disabled="true" /> (-100 to 100)
---
> <input type="checkbox" id="C_sh" value="sh" onclick="checkdef(this,'0')" /> <i>-sh</i> Set image sharpness
> <input type="text" id="C_shsh" class="txt" value="0" disabled="true" /> (-100 to 100)
132,133c208,209
< <input type="checkbox" id="C_co" value="" onclick="check(C_co,' -co ',C_coco);" /> <i>-co</i> Set image contrast
< <input type="text" id="C_coco" class="txt" value="" disabled="true" /> (-100 to 100)
---
> <input type="checkbox" id="C_co" value="co" onclick="checkdef(this,'0')" /> <i>-co</i> Set image contrast
> <input type="text" id="C_coco" class="txt" value="0" disabled="true" /> (-100 to 100)
135,136c211,212
< <input type="checkbox" id="C_br" value="" onclick="check(C_br,' -br ',C_brbr);" /> <i>-br</i> Set image brightness
< <input type="text" id="C_brbr" class="txt" value="" disabled="true" /> (0 to 100)
---
> <input type="checkbox" id="C_br" value="br" onclick="checkdef(this,'50')" /> <i>-br</i> Set image brightness
> <input type="text" id="C_brbr" class="txt" value="50" disabled="true" /> (0 to 100)
138,139c214,215
< <input type="checkbox" id="C_sa" value="" onclick="check(C_sa,' -sa ',C_sasa);" /> <i>-sa</i> Set image saturation
< <input type="text" id="C_sasa" class="txt" value="" disabled="true" /> (-100 to 100)
---
> <input type="checkbox" id="C_sa" value="sa" onclick="checkdef(this,'0')" /> <i>-sa</i> Set image saturation
> <input type="text" id="C_sasa" class="txt" value="0" disabled="true" /> (-100 to 100)
141,142c217,218
< <input type="checkbox" id="C_iso" value="" onclick="check(C_iso,' -ISO ',C_isoiso);" /> <i>-ISO</i> Set capture ISO
< <input type="text" id="C_isoiso" class="txt" value="" disabled="true"/> (not yet implemented)
---
> <input type="checkbox" id="C_ISO" value="ISO" onclick="checkdef(this,'400')" /> <i>-ISO</i> Set capture ISO
> <input type="text" id="C_ISOISO" class="txt" value="400" disabled="true"/> (not yet implemented)
144,145c220,221
< <input type="checkbox" id="C_ev" value="" onclick="check(C_ev,' -ev ',C_evev);" /> <i>-ev</i> Set EV compensation
< <input type="text" id="C_evev" class="txt" value="" disabled="true" /> (-10 to +10)
---
> <input type="checkbox" id="C_ev" value="ev" onclick="checkdef(this,'0')" /> <i>-ev</i> Set EV compensation
> <input type="text" id="C_evev" class="txt" value="0" disabled="true" /> (-10 to +10)
147c223
< <input type="checkbox" id="C_ex" value="" onclick="check(C_ex,' -ex ',C_exex);" /> <i>-ex</i> Set exposure mode
---
> <input type="checkbox" id="C_ex" value="ex" onclick="checkdef(this,'auto')" /> <i>-ex</i> Set exposure mode
149d224
< <option value=""></option>
151c226
< <option value="auto">auto</option>
---
> <option selected value="auto">auto</option>
165c240
< <input type="checkbox" id="C_awb" value="" onclick="check(C_awb,' -awb ',C_awbawb);" /> <i>-awb</i> Set Automatic White Balance mode
---
> <input type="checkbox" id="C_awb" value="awb" onclick="checkdef(this,'auto')" /> <i>-awb</i> Set Automatic White Balance mode
167d241
< <option value=""></option>
169c243
< <option value="auto">auto</option>
---
> <option selected value="auto">auto</option>
180c254
< <input type="checkbox" id="C_ifx" value="" onclick="check(C_ifx,' -ifx ',C_ifxifx);" /> <i>-ifx</i> Set image effect
---
> <input type="checkbox" id="C_ifx" value="ifx" onclick="checkdef(this,'none')" /> <i>-ifx</i> Set image effect
182,183c256
< <option value=""></option>
< <option value="none">none</option>
---
> <option selected value="none">none</option>
208,210c281,283
< <input type="checkbox" id="C_cfx" value="" onclick="check(C_cfx,' -cfx ',C_cfxu,C_cfxv,C_cfxcfx);" /> <i>-cfx</i> Set colour effect
< U <input type="text" id="C_cfxu" class="txt" value="" disabled="true" onchange="C_cfxcfx.value = C_cfxu.value + ':' + C_cfxv.value" />
< V <input type="text" id="C_cfxv" class="txt" value="" disabled="true" onchange="C_cfxcfx.value = C_cfxu.value + ':' + C_cfxv.value" />
---
> <input type="checkbox" id="C_cfx" value="cfx" onclick="checkmulti(this,['u','v'])" /> <i>-cfx</i> Set colour effect
> U <input type="text" id="C_cfxu" class="txt" value="" disabled="true" onchange="update('cfx',['u','v'],':')" />
> V <input type="text" id="C_cfxv" class="txt" value="" disabled="true" onchange="update('cfx',['u','v'],':')" /> (0 to 255)
213c286
< <input type="checkbox" id="C_mm" value="" onclick="check(C_mm,' -mm ',C_mmmm);" /> <i>-mm</i> Set metering mode
---
> <input type="checkbox" id="C_mm" value="mm" onclick="checkdef(this,'average')" /> <i>-mm</i> Set metering mode
215,216c288
< <option value=""></option>
< <option value="average">average</option>
---
> <option selected value="average">average</option>
222,223c294,295
< <input type="checkbox" id="C_rot" value="" onclick="check(C_rot,' -rot ',C_rotrot);" /> <i>-rot</i> Set image rotation
< <input type="text" id="C_rotrot" class="txt" value="" disabled="true" /> (0 to 359)
---
> <input type="checkbox" id="C_rot" value="rot" onclick="checkdef(this,'0')" /> <i>-rot</i> Set image rotation
> <input type="text" id="C_rotrot" class="txt" value="0" disabled="true" /> (0 to 359)
225c297
< <input type="checkbox" id="C_hf" value="" onclick="check(C_hf,' -hf');" /> <i>-hf</i> Set horizontal flip
---
> <input type="checkbox" id="C_hf" value="" onclick="check(this)" /> <i>-hf</i> Set horizontal flip
227c299
< <input type="checkbox" id="C_vf" value="" onclick="check(C_vf,' -vf');" /> <i>-vf</i> Set vertical flip
---
> <input type="checkbox" id="C_vf" value="" onclick="check(this)" /> <i>-vf</i> Set vertical flip
234,235c306,307
< <input type="checkbox" id="C_q" value="" onclick="check(C_q,' -q ',C_qq);" /> <i>-q</i> Set jpeg quality
< <input type="text" id="C_qq" class="txt" value="" disabled="true" /> (0 to 100)
---
> <input type="checkbox" id="C_w1" value="w" onclick="check2def(this,'2592','1')" /> <i>-w</i> Set image width
> <input type="text" id="C_w1w1" class="txt" value="2592" disabled="true"/> (64 to 2592)
237c309,310
< <input type="checkbox" id="C_r" value="" onclick="check(C_r,' -r');" /> <i>-r</i> Add raw bayer data to jpeg metadata
---
> <input type="checkbox" id="C_h1" value="h" onclick="check2def(this,'1944','1')" /> <i>-h</i> Set image height
> <input type="text" id="C_h1h1" class="txt" value="1944" disabled="true"/> (64 to 1944)
239,240c312,318
< <input type="checkbox" id="C_t1" value="" onclick="check(C_t1,' -t ',C_tt1);" /> <i>-t</i> Time before takes picture and shuts down
< <input type="text" id="C_tt1" class="txt" value="" disabled="true"/> (msec)
---
> <input type="checkbox" id="C_q" value="q" onclick="checkdef(this,'85')" /> <i>-q</i> Set jpeg quality
> <input type="text" id="C_qq" class="txt" value="85" disabled="true" /> (0 to 100)
> <br>
> <input type="checkbox" id="C_r" value="r" onclick="check(this)" /> <i>-r</i> Add raw bayer data to jpeg metadata
> <br>
> <input type="checkbox" id="C_t1" value="t" onclick="check2def(this,'5000','1')" /> <i>-t</i> Time before takes picture and shuts down
> <input type="text" id="C_t1t1" class="txt" value="5000" disabled="true"/> (msec)
242c320
< <input type="checkbox" id="C_tl" value="" onclick="check(C_tl,' -tl ',C_tltl);" /> <i>-tl</i> Timelapse mode
---
> <input type="checkbox" id="C_tl" value="tl" onclick="check(this)" /> <i>-tl</i> Timelapse mode
245,248c323,326
< <input type="checkbox" id="C_th" value="" onclick="check(C_th,' -th ',C_thx,C_thy,C_thq,C_thth);" /> <i>-th</i> Set thumbnail parameters
< x <input type="text" id="C_thx" class="txt" value="" disabled="true" onchange="C_thth.value = C_thx.value + ':' + C_thy.value + ':' + C_thq.value" />
< y <input type="text" id="C_thy" class="txt" value="" disabled="true" onchange="C_thth.value = C_thx.value + ':' + C_thy.value + ':' + C_thq.value" />
< q <input type="text" id="C_thq" class="txt" value="" disabled="true" onchange="C_thth.value = C_thx.value + ':' + C_thy.value + ':' + C_thq.value" />
---
> <input type="checkbox" id="C_th" value="th" onclick="checkmultidef(this,['x','y','q'],['64','48','35'])" /> <i>-th</i> Set thumbnail parameters
> x <input type="text" id="C_thx" class="txt" value="64" disabled="true" onchange="update('th',['x','y','q'],':')" />
> y <input type="text" id="C_thy" class="txt" value="48" disabled="true" onchange="update('th',['x','y','q'],':')" />
> q <input type="text" id="C_thq" class="txt" value="35" disabled="true" onchange="update('th',['x','y','q'],':')" />
251c329
< <input type="checkbox" id="C_e" value="" onclick="check(C_e,' -e ',C_ee);" /> <i>-e</i> Encoding to use for output file
---
> <input type="checkbox" id="C_e" value="e" onclick="checkdef(this, 'jpg')" /> <i>-e</i> Encoding to use for output file
253,254c331
< <option value=""></option>
< <option value="jpg">jpg</option>
---
> <option selected value="jpg">jpg</option>
260c337
< <input type="checkbox" id="C_x" value="" onclick="check(C_x,' -x ',C_xx);" /> <i>-x</i> EXIF tag to apply to captures
---
> <input type="checkbox" id="C_x" value="x" onclick="check(this)" /> <i>-x</i> EXIF tag to apply to captures
268,269c345,352
< <input type="checkbox" id="C_b" value="" onclick="check(C_b,' -b ',C_bb);" /> <i>-b</i> Set bitrate
< <input type="text" id="C_bb" class="txt" value="" disabled="true" /> (bits/second)
---
> <input type="checkbox" id="C_w2" value="w" onclick="check2def(this,'1920','2')" /> <i>-w</i> Set video width
> <input type="text" id="C_w2w2" class="txt" value="1920" disabled="true"/> (64 to 1920)
> <br>
> <input type="checkbox" id="C_h2" value="h" onclick="check2def(this,'1080','2')" /> <i>-h</i> Set video height
> <input type="text" id="C_h2h2" class="txt" value="1080" disabled="true"/> (64 to 1080)
> <br>
> <input type="checkbox" id="C_b" value="b" onclick="checkdef(this,'17000000')" /> <i>-b</i> Set bitrate
> <input type="text" id="C_bb" class="txt" value="17000000" disabled="true" /> (bits/second)
271,272c354,355
< <input type="checkbox" id="C_t2" value="" onclick="check(C_t2,' -t ',C_tt2);" /> <i>-t</i> Lengt of video capture
< <input type="text" id="C_tt2" class="txt" value="" disabled="true"/> (msec)
---
> <input type="checkbox" id="C_t2" value="t" onclick="check2def(this,'5000','2')" /> <i>-t</i> Length of video capture
> <input type="text" id="C_t2t2" class="txt" value="5000" disabled="true"/> (msec)
274,275c357,358
< <input type="checkbox" id="C_fps" value="" onclick="check(C_fps,' -fps ',C_fpsfps);" /> <i>-fps</i> Specify the frame per second to record
< <input type="text" id="C_fpsfps" class="txt" value="" disabled="true" /> (2 to 30)
---
> <input type="checkbox" id="C_fps" value="fps" onclick="checkdef(this,'30')" /> <i>-fps</i> Specify the frame per second to record
> <input type="text" id="C_fpsfps" class="txt" value="30" disabled="true" /> (2 to 30)
277c360
< <input type="checkbox" id="C_vs" value="" onclick="check(C_vs,' -vs');" /> <i>-vs</i> Turn on video stabilisation
---
> <input type="checkbox" id="C_vs" value="" onclick="check(this)" /> <i>-vs</i> Turn on video stabilisation
279c362
< <input type="checkbox" id="C_e2" value="" onclick="check(C_e2,' -e');" /> <i>-e</i> Display preview image after encoding
---
> <input type="checkbox" id="C_e2" value="e" onclick="check2(this, '2')" /> <i>-e</i> Display preview image after encoding
286c369
< <input type="checkbox" id="C_pipe" value="" onclick="check(C_pipe,' | ',C_pipepipe);" /> | Add pipe
---
> <input type="checkbox" id="C_pipe" value="pipe" onclick="check(this)" /> | Add pipe
292,295c375,376
< <input type="button" value="Generate command" onclick="document.getElementById('command').value =
< O_type.value + C_w.value + C_ww.value + C_h.value + C_hh.value + C_d.value + C_o.value + C_oo.value + C_v.value + C_p.value + C_pp.value + C_f.value + C_n.value + C_sh.value + C_shsh.value + C_co.value + C_coco.value + C_br.value + C_brbr.value + C_sa.value + C_sasa.value + C_iso.value + C_isoiso.value + C_vs.value + C_ev.value + C_evev.value + C_ex.value + C_exex.value + C_awb.value + C_awbawb.value + C_ifx.value + C_ifxifx.value + C_cfx.value + C_cfxcfx.value + C_mm.value + C_mmmm.value + C_rot.value + C_rotrot.value + C_hf.value + C_vf.value + C_q.value + C_qq.value + C_r.value + C_t1.value + C_tt1.value + C_tl.value + C_tltl.value + C_th.value + C_thth.value + C_e.value + C_ee.value + C_x.value + C_xx.value + C_b.value + C_bb.value + C_t2.value + C_tt2.value + C_fps.value + C_fpsfps.value + C_e2.value + C_pipe.value + C_pipepipe.value
< " />
---
> <input type="button" value="Generate command" onclick="document.getElementById('command').value = generateCommand()" />