{"id":707,"date":"2022-12-28T17:37:28","date_gmt":"2022-12-28T16:37:28","guid":{"rendered":"https:\/\/snakenet.eu\/blog\/?p=707"},"modified":"2023-07-08T14:19:24","modified_gmt":"2023-07-08T13:19:24","slug":"raspberry-pi-webcam-usb","status":"publish","type":"post","link":"https:\/\/snakenet.eu\/blog\/raspberry-pi-webcam-usb\/707\/","title":{"rendered":"Raspberry pi &#8211; Webcam usb"},"content":{"rendered":"\n<p>Si v4l2rtspserver ne fonctionne pas avec vous non plus, voici une alternative old-school bas\u00e9e sur &lsquo;Motion&rsquo;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install motion<\/code><\/pre>\n\n\n\n<p>Cr\u00e9er le fichier de config \/etc\/systemd\/system\/motion.service<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\n# This systemd unit file is part of the motion project:\n#\n# https:\/\/motion-project.github.io\/\n#\n# This program is free software: you can redistribute it and\/or modify\n# it under the terms of version 2 of the GNU General Public License as\n# published by the Free Software Foundation.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this program. If not, see\n# &lt;https:\/\/www.gnu.org\/licenses\/old-licenses\/gpl-2.0.html&gt;\n#\n\n&#91;Unit]\nDescription=Motion - monitor live video, trigger responses, record video\/stills.\nDocumentation=man:motion(1)\nAfter=local-fs.target network.target\n\n&#91;Service]\nUser=motion\n#EnvironmentFile=-\/etc\/default\/motion\n# The the sleep on the following line is needed with systemd version\n# 232, otherwise the error message that we echo doesn't hit 'systemctl\n# status'.\nExecStart=\/bin\/sh -c 'exec \/usr\/bin\/motion -n'\nType=simple\n# Set StandardError=journal to use journald to log messages from motion.\n# See also the \"log_file\" config file option in motion(1) and\n# systemd.service(5).\nStandardError=null\nExecReload=@KILL@ -HUP $MAINPID\nRestart=on-failure\nRestartSec=5\n# Don't restart if unconfigured \/ misconfigured e.g. daemon disabled\n# in defaults file. See also \/usr\/include\/sysexits.h or sysexits(3)\nRestartPreventExitStatus=78\n# To tune restart behaviour, see systemd.unit(5) and use\n# \"systemctl edit motion\" to change the following settings:\n#StartLimitBurst=\n#StartLimitIntervalSec=\n#StartLimitAction=\n#FailureAction=\n# The following can be used to increase the security of the\n# installation, by mitigating risk from attacks on motion and the\n# binaries, libraries and scripts which it relies on. They are disabled\n# by default in case they break existing installations, e.g. those which\n# call site-local scripts which would inherit the same restrictions.\n#\n# See systemd.exec(5) and\n# http:\/\/0pointer.net\/public\/systemd-nluug-2014.pdf for more details\n# of these and other related options.\n#\n# Use \"systemctl edit motion\" to change these settings.\n#PrivateTmp=true\n#NoNewPrivileges=yes\n#PrivateNetwork=yes\n#ProtectHome=yes\n#DeviceAllow=\/dev\/video0\n#MountFlags=slave\n#SystemCallFilter=\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>Et l&rsquo;activer avec : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable motion<\/code><\/pre>\n\n\n\n<p>Cr\u00e9er le fichier de configuration de motion :: \/etc\/motion\/motion.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>daemon on\nframerate 10\nstream_port 8081\nstream_quality 100\nstream_localhost off\nstream_motion off\nstream_maxrate 10\nwebcontrol_localhost off\nquality 80\nwidth 640\nheight 480\npost_capture 5\npre_capture 2\nffmpeg_output_movies OFF\noutput_pictures OFF<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Si v4l2rtspserver ne fonctionne pas avec vous non plus, voici une alternative old-school bas\u00e9e sur &lsquo;Motion&rsquo; Cr\u00e9er le fichier de config \/etc\/systemd\/system\/motion.service Et l&rsquo;activer avec : Cr\u00e9er le fichier de configuration de motion :: \/etc\/motion\/motion.conf<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-707","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"_links":{"self":[{"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/posts\/707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/comments?post=707"}],"version-history":[{"count":4,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/posts\/707\/revisions"}],"predecessor-version":[{"id":717,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/posts\/707\/revisions\/717"}],"wp:attachment":[{"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/media?parent=707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/categories?post=707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/snakenet.eu\/blog\/wp-json\/wp\/v2\/tags?post=707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}