{"id":66210,"date":"2024-10-05T11:45:52","date_gmt":"2024-10-05T10:45:52","guid":{"rendered":"https:\/\/ekiwi-blog.de\/66210\/set-up-linux-as-ip-camera-streaming-server\/"},"modified":"2024-10-05T11:45:52","modified_gmt":"2024-10-05T10:45:52","slug":"set-up-linux-as-ip-camera-streaming-server","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/66210\/set-up-linux-as-ip-camera-streaming-server\/","title":{"rendered":"Set up Linux as IP camera, streaming server"},"content":{"rendered":"<p>Use a Linux computer as an IP camera and streaming server in your own network.<\/p>\n<p><!--more--><\/p>\n<p>Having already set up an old Android smartphone as a streaming server and IP camera on the network, we are now using a Linux computer. Well, it will end up consuming more power, but maybe it&#8217;s running anyway.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of content<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ekiwi-blog.de\/en\/66210\/set-up-linux-as-ip-camera-streaming-server\/#Streaming_server_with_motion\" >Streaming server with motion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ekiwi-blog.de\/en\/66210\/set-up-linux-as-ip-camera-streaming-server\/#Firewall_activation\" >Firewall activation<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Streaming_server_with_motion\"><\/span>Streaming server with motion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>We use &#8220;motion&#8221; for streaming. This can be installed with the following command:<\/p>\n<pre>\r\nsudo apt install motion\r\n<\/pre>\n<p>We then edit the configuration file.<\/p>\n<pre>\r\nsudo vim \/etc\/motion\/motion.conf\r\n<\/pre>\n<p>Here we find numerous settings, e.g. also the frame rate, image size.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_1.png\" alt=\"\" width=\"765\" height=\"499\" class=\"aligncenter size-full wp-image-66196\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_1.png 765w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_1-300x196.png 300w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><\/p>\n<p>The settings for the network are also important, with <code>webcontrol_localhost<\/code> and <code>stream_localhost<\/code> we can control access from the network. If these are set to &#8220;on&#8221;, only local access is possible. We can also specify the port.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_2.png\" alt=\"\" width=\"868\" height=\"515\" class=\"aligncenter size-full wp-image-66200\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_2.png 868w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_2-300x178.png 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_2-768x456.png 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/p>\n<p>Once the file is saved, we can start the service.<\/p>\n<pre>\r\nsudo service motion start\r\n<\/pre>\n<p>There are two ways to access it, either the control interface with more options or just the image.<\/p>\n<pre>\r\nhttp:\/\/localhost:8080\/\r\nhttp:\/\/localhost:8081\/\r\n<\/pre>\n<p>Both addresses can be opened in the browser and the image is displayed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_3.png\" alt=\"\" width=\"800\" height=\"257\" class=\"aligncenter size-full wp-image-66204\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_3.png 800w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_3-300x96.png 300w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/10\/webcam_linux_3-768x247.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Firewall_activation\"><\/span>Firewall activation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>For external access, the ports may still need to be enabled in the firewall. We can check the status first.<\/p>\n<pre>\r\nsudo ufw status\r\n<\/pre>\n<p>The following two adjustments allow access, adjust port if necessary.<\/p>\n<pre>\r\nsudo ufw allow 8081\/tcp\r\nsudo ufw allow 8080\/tcp\r\n<\/pre>\n<p>Access should then also be possible from other devices in the network. Access is initially only possible in the internal network. For remote access, a port share can be set up on the router or alternatively a VPN can be used.<\/p>","protected":false},"excerpt":{"rendered":"<p>Use a Linux computer as an IP camera and streaming server in your own network.<\/p>\n","protected":false},"author":1,"featured_media":66186,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[1682,2835,1559],"class_list":["post-66210","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-linux-en","tag-server-en","tag-tutorial-en"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/66210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=66210"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/66210\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/66186"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=66210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=66210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=66210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}