{"id":5710,"date":"2019-08-26T23:28:19","date_gmt":"2019-08-26T23:28:19","guid":{"rendered":"https:\/\/max-drake.cc\/?p=5710"},"modified":"2019-08-27T00:22:04","modified_gmt":"2019-08-27T00:22:04","slug":"rasperry-pi-camera-and-time-lapse","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=5710","title":{"rendered":"Rasperry Pi Camera and time lapse"},"content":{"rendered":"\n<p>I have a lovely view over part of Wellington and take photos of sunrises and sunsets. I have discussed with others about making time lapse photos of the change of light from the house. There is quite a popular one of  Moonrise over Mt Victoria<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Full Moon Silhouettes\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/ehulHtKfpuM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>I want to do something far simpler.  I saw this tutorial<a rel=\"noreferrer noopener\" aria-label=\" Raspberry Pi Time-Lapse In Four Dead Easy Steps (opens in a new tab)\" href=\"https:\/\/pimylifeup.com\/raspberry-pi-time-lapse\/\" target=\"_blank\"> Raspberry Pi Time-Lapse In Four Dead Easy Steps<\/a> that I want to follow and play with. As it doesn&#8217;t use the GPIO pins I&#8217;ll also do some testing on temperature sensors as well, that&#8217;ll be another post. <\/p>\n\n\n\n<p>There is a video for the tutorial too:<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Raspberry Pi Time-Lapse and Setup Camera Module\" width=\"678\" height=\"381\" data-src=\"https:\/\/www.youtube.com\/embed\/1XND114I8Qg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>This is the process for capturing stills at an interval, then you need to build a time lapse video. I have a Raspberry Pi 3 B and a 5Mp  Raspberry Pi  camera.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code for running a timelapse at command line. <\/h3>\n\n\n\n<p>You need to create a folder where you want the images to be stored and ran the code from there:  <strong>raspistill -t 60000 -tl 1000-o image%04d.jpg <\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"495\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-1024x495.jpg\" alt=\"\" class=\"wp-image-5714 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-1024x495.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-300x145.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-768x371.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-100x48.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-207x100.jpg 207w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-1324x640.jpg 1324w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-640x309.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-1589x768.jpg 1589w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/00071424-1920x928.jpg 1920w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/495;\" \/><\/figure>\n\n\n\n<p>I modified the code to :  <strong>raspistill -t 3600000 -tl 6000-o image%04d.jpg  <\/strong><\/p>\n\n\n\n<p>This then took a photo every minute for an hour. So sixty photos, later I put it at 2000 (every 1\/3 of a minute) and got lots of photos. I had to start blowing away a few as I had too many. <\/p>\n\n\n\n<p>I connected to the RPi via Remote Desktop, that seemed to be the easiest way to do things. I used<a rel=\"noreferrer noopener\" aria-label=\" Advanced IP Scanner (opens in a new tab)\" href=\"http:\/\/www.advanced-ip-scanner.com\/\" target=\"_blank\"> <strong>Advanced IP Scanner<\/strong><\/a> to scan to find the IP address of the Raspberry Pi. <\/p>\n\n\n\n<p>Once connected to the Pi I did as per video tutorial and made a directory to send the images to. <\/p>\n\n\n\n<p>The pi camera I was using was wide angle. I&#8217;d bought it in Jaycar for $29 NZ. I did not have a mount (as I was testing it out) and wanted to quickly see if the process works. So I used Duct Tape to put the camera up against the window. It was aligned a little bit squiffy.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"768\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920-1024x768.jpg\" alt=\"\" class=\"wp-image-5717 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920-1024x768.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920-300x225.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920-768x576.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920-100x75.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920-133x100.jpg 133w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920-853x640.jpg 853w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920-640x480.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/IMG_20190827_105944_resized_20190827_110033920.jpg 1152w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/768;\" \/><\/figure>\n\n\n\n<p>You can see the photos taken are skewed. I&#8217;ll talk about this later. It does capture the light and the view quite well. I&#8217;m interested in the light change at dawn and dusk. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"768\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-1024x768.jpg\" alt=\"\" class=\"wp-image-5716 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-1024x768.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-300x225.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-768x576.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-100x75.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-133x100.jpg 133w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-853x640.jpg 853w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-640x480.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001-1440x1080.jpg 1440w, https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001.jpg 1632w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/768;\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Free Stitching Programmes<\/h3>\n\n\n\n<p>I wanted a simple free programme to load the images and stitch them together with a defined lapse time. I initially tried out <strong><a rel=\"noreferrer noopener\" aria-label=\"PhotoLapse (opens in a new tab)\" href=\"https:\/\/photolapse.en.softonic.com\/?\" target=\"_blank\">PhotoLapse<\/a><\/strong>, which was OK and did the job, but I thought I&#8217;d try out another one too.  I tried <strong><a rel=\"noreferrer noopener\" aria-label=\"Images to Video  (opens in a new tab)\" href=\"https:\/\/www.freewarefiles.com\/Images-to-Video_program_45901.html\" target=\"_blank\">Images to Video <\/a><\/strong>which has a simple interface and did a quick job.  I was happy with the results from both programmes. I used them both for comparison. <\/p>\n\n\n\n<p>Because the photos were skewed I wondered if the stitching programme could rotate them. I decided to look into that. Generally they could rotate 90 degrees or flip, which is not what I wanted.  I was thinking about a more sophisticated programme to rotate and possibly crop images but decided that for this exercise I just wanted to test the timelapse. <\/p>\n\n\n\n<p>Also, thinking about it later, I decided it was a better option to set the camera up in a more aligned state so that you wouldn&#8217;t have to rotate each image, a far easier solution. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The results two 3 second video timelapses<\/h2>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Timelapse using PhotoLapse and Image capture from Raspberry Pi camera- 3 seconds\" width=\"678\" height=\"509\" data-src=\"https:\/\/www.youtube.com\/embed\/3al0klkl5as?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>The above video size was <strong>767Mp<\/strong> with the PhotoLapse programme.<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-4-3 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Timelapse using \u201cImages to Video\u201d and Image capture from Raspberry Pi camera- 3 seconds\" width=\"678\" height=\"509\" data-src=\"https:\/\/www.youtube.com\/embed\/_3eRYxx7Jrs?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>The file size was <strong>12Mp <\/strong>with the Images to Video programme.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">End comment<\/h2>\n\n\n\n<p>I was pleased with this test project:<\/p>\n\n\n\n<div id=\"\" class=\"wp-block-cwp-like-dislike cwp-common-main-wrap cwp-full-width-small-container\"><div class=\"cwp-common-main-wrap-inner\" data-scroll-delay=\"10\" data-scroll-threshold=\"40\"><div class=\"cwp-main-wrapper cwp-2-column\"><div class=\"cwp-inner-wrap\"><div class=\"cwp-content-wrap\"><div class=\"cwp-list-content-wrap\"><div class=\"cwp-list-content-icon\"><div class=\"cwp-icon\"><i class=\"fa fa-thumbs-up\"><\/i><\/div><\/div><div class=\"cwp-list-content-title\"><ul><li>  It was easy to setup (apart from File transfer to USB)  <\/li><li> The coding was simple <\/li><li> The images were of a good quality <\/li><li> The stitching images to video programmes were fast  <\/li><\/ul><\/div><\/div><\/div><\/div><div class=\"cwp-inner-wrap\"><div class=\"cwp-content-wrap\"><div class=\"cwp-list-content-wrap\"><div class=\"cwp-list-content-icon\"><div class=\"cwp-icon\"><i class=\"fa fa-thumbs-down\"><\/i><\/div><\/div><div class=\"cwp-list-content-title\"><ul><li> File transfer became an issue from Raspberry Pi to USB later <\/li><li> It highlighted a mount is required to get the images to align correctly<\/li><li> The wide angle lens was too wide.  <\/li><\/ul><\/div><\/div><\/div><\/div><\/div><\/div><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">File transfer<\/h4>\n\n\n\n<p>Where I have the Pi Setup on the windowsill I can link it via an Ethernet cable, so I want to see if I can transfer the files that way. <\/p>\n\n\n\n<p>I&#8217;m being a bit thick here, I just tried using FileZilla and it transferred the files in a blink of an eye. So that is a good method to transfer files if the Pi is connected via a Ethernet cable. <\/p>\n\n\n\n<p>So I am ordering another camera from Ali Express to see if I can Zoom in to a smaller area as I want to explore the process more. <\/p>\n\n\n\n<p>I will take this project further, I&#8217;m pleased with how it has turned out so far. I like the fact of starting it up and leaving it to chug away for an hour capturing photos, it allows me to get out and go for a walk while that is all happening. Also, as sunsets will be variable, some days cloudy etc, it is good that I can choose when I want the photos to be taken. <\/p>\n\n\n\n<p>I need to play around with options and rather than run from command line I&#8217;d like ot have several setups and be able to run from a file. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using a Raspberry Pi 3 B 5Mp camera to capture still images at specified intervals and stitch them together to make video time lapse. <\/p>\n","protected":false},"author":1,"featured_media":5716,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[443],"tags":[],"class_list":["post-5710","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-iot-internet-of-things"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2019\/08\/img0001.jpg","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/5710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5710"}],"version-history":[{"count":0,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/5710\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/5716"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}