{"id":247,"date":"2019-04-13T20:13:09","date_gmt":"2019-04-13T20:13:09","guid":{"rendered":"https:\/\/egemeric2.ddns.net\/?p=247"},"modified":"2019-10-10T18:05:57","modified_gmt":"2019-10-10T18:05:57","slug":"rpi-cam","status":"publish","type":"post","link":"https:\/\/egemeric.gen.tr\/old\/index.php\/2019\/04\/13\/rpi-cam\/","title":{"rendered":"RPI CAM #Closed"},"content":{"rendered":"\n<p>Due to Heating issues I have closed the camera sorry :p<\/p>\n\n\n\n<p><a href=\"https:\/\/egemeric2.ddns.net\/index.php\/rpi-camera\/\">https:\/\/egemeric2.ddns.net\/index.php\/rpi-camera\/<\/a> (You can see here)<\/p>\n\n\n\n<p>You can see Ankara&#8217;s city View with RPI Cam.This camera is connected to Rpi Zero W . Also you can watch daily timelapses (but video qualities are very low due to my upload speed so i use webm format to decrease file size.)<\/p>\n\n\n\n<p> Whole day has nearly 18000 frame(1-2gb in jpeg) but i have used mancoder program to convert jpeg&#8217;s to Avi . By doing this ,whole day&#8217;s timelapse&#8217;s has been decreased to 40 mb but after converting avi to webm this file size is decreased extremely to 6-8 mb .<\/p>\n\n\n\n<p>I&#8217;ve used crontab to converting images to videos. crontab works at every 01.01 AM  (for ffmpeg and deleting used jpegs)<\/p>\n\n\n\n<p>On rpi zero i used <a href=\"https:\/\/elinux.org\/RPi-Cam-Web-Interface\">https:\/\/elinux.org\/RPi-Cam-Web-Interface&nbsp;<\/a>this tool to web gui and  after i created a basic curl script to catch images every 5 seconds. (this curl script works in my main dektop also this pc renders the files and hosts the videos)<\/p>\n\n\n\n<p>you can see my basic scripts at bottom<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>CURL SCRIPT<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env bash\n\nwhile [ true ]; do\nsleep 5\n\n\ncurl http:\/\/1.1.1.1:8080\/cam_pic.php? -o $(date +%H-%M-%S).jpg\ndone<\/code><\/pre>\n\n\n\n<p><strong>Creating timelapse from jpegs and converting to webm[<\/strong>for&nbsp;crontab(cron.sh)]<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n\nmencoder mf:\/\/\/home\/egemeric\/time\/*.jpg -mf w=1024:h=720:fps=60:type=jpg -ovc lavc -lavcopts threads=6 vcodec=msmpeg4v2:vbitrate=56000:keyint=15:mbd=2:trell -oac copy -o \/home\/egemeric\/$(date +\"%m-%d\").avi ; \n\nffmpeg -i \/home\/egemeric\/$(date +\"%m-%d\").avi \/var\/www\/timelapse\/$(date +\"%m-%d\").webm ;  \n\nrm \/home\/egemeric\/*.avi\n<\/code><\/pre>\n\n\n\n<p><strong>Crontab <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1 1 * * * \/home\/egemeric\/time\/cron.sh > \/home\/egemeric\/cronout\n\n1 2 * * * rm \/home\/egemeric\/time\/*.jpg<\/code><\/pre>\n\n\n\n<p>if you want , i can give my apache config for proxying web pages  \ud83d\ude00<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/egemeric2.ddns.net\/wp-content\/uploads\/2019\/04\/summary-1024x724.png\" alt=\"\" class=\"wp-image-248\" width=\"706\" height=\"499\" srcset=\"https:\/\/egemeric.gen.tr\/old\/wp-content\/uploads\/2019\/04\/summary-1024x724.png 1024w, https:\/\/egemeric.gen.tr\/old\/wp-content\/uploads\/2019\/04\/summary-300x212.png 300w, https:\/\/egemeric.gen.tr\/old\/wp-content\/uploads\/2019\/04\/summary-768x543.png 768w, https:\/\/egemeric.gen.tr\/old\/wp-content\/uploads\/2019\/04\/summary.png 1123w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><figcaption>my network summary \ud83d\ude00<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Due to Heating issues I have closed the camera sorry :p https:\/\/egemeric2.ddns.net\/index.php\/rpi-camera\/ (You can see here) You can see Ankara&#8217;s city View with RPI Cam.This camera is connected to Rpi Zero W . Also you can watch daily timelapses (but video qualities are very low due to my upload speed so i use webm format &hellip; <a href=\"https:\/\/egemeric.gen.tr\/old\/index.php\/2019\/04\/13\/rpi-cam\/\" class=\"more-link\"><span class=\"screen-reader-text\">RPI CAM #Closed<\/span> yaz\u0131s\u0131na devam et <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-247","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/posts\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":7,"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":268,"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/posts\/247\/revisions\/268"}],"wp:attachment":[{"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egemeric.gen.tr\/old\/index.php\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}