{"id":1800,"date":"2016-04-11T13:20:19","date_gmt":"2016-04-11T11:20:19","guid":{"rendered":"http:\/\/www.sciencetronics.com\/greenphotons\/?p=1800"},"modified":"2025-06-16T18:37:57","modified_gmt":"2025-06-16T16:37:57","slug":"setting-up-webcam-exposure-under-linux","status":"publish","type":"post","link":"https:\/\/www.sciencetronics.com\/greenphotons\/?p=1800","title":{"rendered":"Setting up webcam exposure under linux"},"content":{"rendered":"<p>I had some problems with fswebcam to set the automatic exposure. The exact way how to enter certain parameters is not clear from the lacking documentation, but it works fine if you set parameters through another command line tool.<\/p>\n<p>This is the script behind BirdCam:<\/p>\n<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"text codecolorer\">#!\/bin\/bash<br \/>\n<br \/>\nDATE=$(date +&quot;%Y-%m-%d_%H%M&quot;)<br \/>\n<br \/>\nv4l2-ctl -c exposure_auto=1<br \/>\nv4l2-ctl -c gamma=5<br \/>\nv4l2-ctl -c brightness=128<br \/>\nv4l2-ctl -c contrast=67<br \/>\nv4l2-ctl -c exposure_auto=2<br \/>\n<br \/>\nfswebcam -c fswebcam.cfg \/var\/tmp\/image.jpg<br \/>\ncurl -T \/var\/tmp\/image.jpg -u &lt;username&gt;:&lt;password&gt; ftp:\/\/&lt;ftp-server address&gt;\/&lt;directory&gt;\/$DATE.jpg<\/div><\/div>\n<p>At least I thought so, but suddenly and without any intervention the exposure settings stopped working again. Everything was fine until 14:50 local time<br \/>\n<a href=\"http:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1250.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1250-300x225.jpg\" alt=\"2016-04-11_1250\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1802\" srcset=\"https:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1250-300x225.jpg 300w, https:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1250-150x113.jpg 150w, https:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1250-400x300.jpg 400w, https:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1250.jpg 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nbut a minute later the camera captured this image and continued to do so&#8230;<br \/>\n<a href=\"http:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1251.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1251-300x225.jpg\" alt=\"2016-04-11_1251\" width=\"300\" height=\"225\" class=\"aligncenter size-medium wp-image-1803\" srcset=\"https:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1251-300x225.jpg 300w, https:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1251-150x113.jpg 150w, https:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1251-400x300.jpg 400w, https:\/\/www.sciencetronics.com\/greenphotons\/wp-content\/uploads\/2016\/04\/2016-04-11_1251.jpg 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Is this a problem of the particular webcam I am using? I don&#8217;t know.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had some problems with fswebcam to set the automatic exposure. The exact way how to enter certain parameters is not clear from the lacking documentation, but it works fine if you set parameters through another command line tool. This is the script behind BirdCam: #!\/bin\/bash DATE=$(date +&quot;%Y-%m-%d_%H%M&quot;) v4l2-ctl -c exposure_auto=1 v4l2-ctl -c gamma=5 v4l2-ctl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[22,25,19,27],"tags":[],"class_list":["post-1800","post","type-post","status-publish","format-standard","hentry","category-computers_en","category-outdoors_en","category-photography_en","category-science_en","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p48grL-t2","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/posts\/1800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1800"}],"version-history":[{"count":4,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/posts\/1800\/revisions"}],"predecessor-version":[{"id":2369,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=\/wp\/v2\/posts\/1800\/revisions\/2369"}],"wp:attachment":[{"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sciencetronics.com\/greenphotons\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}