{"id":12143,"date":"2020-04-06T12:04:49","date_gmt":"2020-04-06T11:04:49","guid":{"rendered":"https:\/\/johnjohnston.info\/blog\/?p=12143"},"modified":"2021-09-20T22:23:38","modified_gmt":"2021-09-20T21:23:38","slug":"timelapse-in-lockdown","status":"publish","type":"post","link":"https:\/\/johnjohnston.info\/blog\/timelapse-in-lockdown\/","title":{"rendered":"Timelapse in lockdown"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-12143-1\" width=\"720\" height=\"540\" poster=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/outscaled.jpg\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/outscaled.mp4?_=1\" \/><a href=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/outscaled.mp4\">https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/outscaled.mp4<\/a><\/video><\/div>\n<p>After seeing <a href=\"https:\/\/micro.blog\/adders\">@adders<\/a> on micro.blog posting some timelapse I though I might have another go. My first thought was to just use the feature built into phone. I then though to repurpose a raspberry pi. This lead to the discovery that two of my PIs were at school leaving only one at home with a camera. This we zero had dome sterling service taking over 1 million pictures of the sky and stitching them into 122918 gifs and posting them to tumblr. I decommissioned that when tumblr started mistaking these for unsuitable photos.<\/p>\n<p><a href=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/skipijan-6-2020.gif\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12146\" data-permalink=\"https:\/\/johnjohnston.info\/blog\/timelapse-in-lockdown\/skipijan-6-2020\/\" data-orig-file=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/skipijan-6-2020.gif\" data-orig-size=\"648,486\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"skipijan-6-2020\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/skipijan-6-2020-620x465.gif\" data-large-file=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/skipijan-6-2020.gif\" class=\"aligncenter size-full wp-image-12146\" src=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/skipijan-6-2020.gif\" alt=\"\" width=\"648\" height=\"486\" \/><\/a><\/p>\n<p>My first idea were just write a simple bash script that would take a pic and copy it to my mac. I&#8217;ve done that before, just need to timestamp the image names. Then I found <a href=\"https:\/\/elinux.org\/RPi-Cam-Web-Interface\">RPi-Cam-Web-Interface<\/a>. This is really cool. It turns your pi into a camera and a webserver where you can control the camera and download the photos.<\/p>\n<p><a href=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/RPi-cam-control.jpg\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"12148\" data-permalink=\"https:\/\/johnjohnston.info\/blog\/timelapse-in-lockdown\/rpi-cam-control\/\" data-orig-file=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/RPi-cam-control.jpg\" data-orig-size=\"760,600\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"RPi-cam-control\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/RPi-cam-control-620x489.jpg\" data-large-file=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/RPi-cam-control.jpg\" class=\"aligncenter size-full wp-image-12148\" src=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/RPi-cam-control.jpg\" alt=\"\" width=\"760\" height=\"600\" srcset=\"https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/RPi-cam-control.jpg 760w, https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/RPi-cam-control-620x489.jpg 620w, https:\/\/johnjohnston.info\/blog\/wp-content\/uploads\/2020\/04\/RPi-cam-control-668x527.jpg 668w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/a><\/p>\n<p>I am <a title=\"Nodestorage on a Headless Raspberry Pi\" href=\"https:\/\/johnjohnston.info\/blog\/nodestorage-on-a-headless-raspberry-pi\/\">fairly used to setting up <\/a>a headless pi and getting on my WiFi now. So the next step was just to follow all the instructions from the RPi-Cam-Web-Interface page. The usual fairly incomprehensible stuff in the terminal ensued. All worked fine though.<\/p>\n<p>I then downloaded the folder full of images onto my mac and stitched them together with ffmpeg.<\/p>\n<p>ffmpeg is a really complex beast, I think this worked ok:<\/p>\n<p>make a list of the files with<\/p>\n<p><code>for f in *.jpg; do echo \"file '$f'\" &gt;&gt; mylist.txt; done<\/code><\/p>\n<p>then stitch them together:<\/p>\n<p><code>ffmpeg -r 10 -f concat -i mylist.txt -c:v libx264  -pix_fmt yuv420p   out.mp4<\/code><\/p>\n<p>I messed about quite a bit, resizing the images before starting made for a smaller move and finally I<\/p>\n<p><code>ffmpeg -i out.mp -vf scale=720:-2 outscaled.mp4<\/code><\/p>\n<p>To make an even smaller version.<\/p>\n<p>I am now on the look out for more interesting weather or a good sunset.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After seeing @adders on micro.blog posting some timelapse I though I might have another go. My first thought was to just use the feature built into phone. I then though to repurpose a raspberry pi. This lead to the discovery that two of my PIs were at school leaving only one at home with a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"mf2_syndication":["https:\/\/twitter.com\/johnjohnston\/status\/1247119481354235910"],"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"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,"webmentions_disabled_pings":false,"webmentions_disabled":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[660],"tags":[443,639,80,727,214],"post_format":[],"class_list":{"0":"post-12143","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-micro","7":"tag-bash","8":"tag-ffmpeg","9":"tag-fun","10":"tag-raspberry-pi","11":"tag-timelapse","12":"kind-article","14":"h-entry","15":"hentry"},"better_featured_image":null,"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p57zFQ-39R","jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"kind":false,"_links":{"self":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/12143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/comments?post=12143"}],"version-history":[{"count":3,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/12143\/revisions"}],"predecessor-version":[{"id":15437,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/posts\/12143\/revisions\/15437"}],"wp:attachment":[{"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/media?parent=12143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/categories?post=12143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/tags?post=12143"},{"taxonomy":"post_format","embeddable":true,"href":"https:\/\/johnjohnston.info\/blog\/wp-json\/wp\/v2\/post_format?post=12143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}