{"id":472,"date":"2019-02-08T15:19:13","date_gmt":"2019-02-08T20:19:13","guid":{"rendered":"http:\/\/www.lazytrap.com\/trapped\/?p=472"},"modified":"2019-02-08T18:34:19","modified_gmt":"2019-02-08T23:34:19","slug":"logitech-c920-octoprint-fine-tuning","status":"publish","type":"post","link":"http:\/\/www.lazytrap.com\/trapped\/?p=472","title":{"rendered":"Logitech c920 Octoprint Fine tuning"},"content":{"rendered":"\n<p>Fine tuning a c920 (or any UVC capable camera) for Octoprint streaming. Turning off Autofocus. Using manual focus. Adjust contrast, etc.<br><br>Note: When you get around to adjusting your controls, watch your stream to see the results and dial it in how you desire. Write down your values and then you can then use them in an autostart script so the settings are restored upon reboot of the system. See here: <a href=\"http:\/\/www.lazytrap.com\/trapped\/?p=485\">Octoprint Autostart Script<\/a><br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Install uvcdynctrl<\/strong> <br><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> <br>pi@octopi:~ $ sudo apt-get install uvcdynctrl<br>&gt;enter password&lt;<br> Reading package lists\u2026 Done<br> Building dependency tree<br> Reading state information\u2026 Done<br> The following additional packages will be installed:<br>   libwebcam0 uvcdynctrl-data<br>(......etc....)<br><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Look at Help<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">pi@octopi:~ $ uvcdynctrl -h<br> uvcdynctrl 0.2.4<br>pi@octopi:~ $ uvcdynctrl -h<br> uvcdynctrl 0.2.4<br> Manage dynamic controls in uvcvideo<br> Usage: uvcdynctrl [OPTIONS]\u2026 [VALUES]\u2026<br> -h, --help               Print help and exit<br>   -V, --version            Print version and exit<br>   -l, --list               List available cameras<br>   -i, --import=filename    Import dynamic controls from an XML file<br>   -a, --addctrl=vid        Import dynamic controls for vid from default location<br>   -v, --verbose            Enable verbose output  (default=off)<br>   -d, --device=devicename  Specify the device to use  (default=`video0')<br>   -c, --clist              List available controls<br>   -g, --get=control        Retrieve the current control value<br>   -G, --get_raw=unit_id:selector        Retrieve the current raw control value<br>   -s, --set=control        Set a new control value<br>                             (For negative values: -s 'My Control' -- -42)<br>   -S, --set_raw=unit_id:selector        Set the current raw control value<br>                             (value is a hex string of control size,<br>                              default is little endian- '(BE)' prefix to change:<br>                              -S 13:1 0x01100c or -S 13:1 '(BE)0x0c1001' )<br> -f, --formats            List available frame formats<br>   -W, --save=filename      Save device controls state to a file<br>   -L, --load=filename      Load device controls state from a file<br><br><br><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Save Defaults to file b4 changing things<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">pi@octopi:~ $ uvcdynctrl --save=c920defaults.txt<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Look at available controls<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">pi@octopi:~ $ uvcdynctrl -c<br>Listing available controls for device video0:<br>   Brightness<br>   Contrast<br>   Saturation<br>   White Balance Temperature, Auto<br>   Gain<br>   Power Line Frequency<br>   White Balance Temperature<br>   Sharpness<br>   Backlight Compensation<br>   Exposure, Auto<br>   Exposure (Absolute)<br>   Exposure, Auto Priority<br>   Pan (Absolute)<br>   Tilt (Absolute)<br>   Focus (absolute)<br>   Focus, Auto<br>   Zoom, Absolute<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Check the value of a control<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">pi@octopi:~ $  uvcdynctrl -g 'Focus, Auto'<br> 1<br><br>Smart to check values before changing them. <br> <br>pi@octopi:~ $  uvcdynctrl -g Sharpness <br>128<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Change the value of a control<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">E.G. To turn auto focus off:<br>pi@octopi:~ $  uvcdynctrl -s 'Focus, Auto' 0<br>E.G. To manually focus (range 0-8999..or something):<br>pi@octopi:~ $  uvcdynctrl -s 'Focus (absolute)' 24<br>E.G. To change sharpness:<br>pi@octopi:~ $  uvcdynctrl -s Sharpness 150<br><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Write your settings to file<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">pi@octopi:~ $  uvcdynctrl --save=c920custom.txt <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Load your settings from file<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">pi@octopi:~ $  uvcdynctrl --load=c920custom.txt <br><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Fine tuning a c920 (or any UVC capable camera) for Octoprint streaming. Turning off Autofocus. Using manual focus. Adjust contrast, etc. Note: When you get around to adjusting your controls, watch your stream to see the results and dial it in how you desire. Write down your values and then you can then use them\u2026 <span class=\"read-more\"><a href=\"http:\/\/www.lazytrap.com\/trapped\/?p=472\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":470,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149],"tags":[151,155,150,156,153,152,154],"jetpack_featured_media_url":"http:\/\/www.lazytrap.com\/trapped\/wp-content\/uploads\/2019\/02\/print.jpg","_links":{"self":[{"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/posts\/472"}],"collection":[{"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=472"}],"version-history":[{"count":11,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":491,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/posts\/472\/revisions\/491"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=\/wp\/v2\/media\/470"}],"wp:attachment":[{"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.lazytrap.com\/trapped\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}