{"id":302,"date":"2017-02-20T17:19:01","date_gmt":"2017-02-20T17:19:01","guid":{"rendered":"http:\/\/feiereisen.net\/?page_id=302"},"modified":"2017-02-24T01:09:08","modified_gmt":"2017-02-24T01:09:08","slug":"time-lapse-movies","status":"publish","type":"page","link":"https:\/\/feiereisen.net\/?page_id=302","title":{"rendered":"Time Lapse Movies"},"content":{"rendered":"<p>There are plenty of generally accessible webcams. Instead of just tuning in and watching, I wrote some perl scripts \u00a0to grab pictures at regular intervals and then put them together into time-lapse movies. I&#8217;m fond of Madison, Wisconsin, because I grew up there.<\/p>\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=R8LVXS1HuwQ\">3 days on Lake Mendota, Madison Wisconsin, from the King Hall webcam<\/a><\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=KLMvgvgopRs\">One year @ 8am, Lake Mendota, Madison Wisconsin, from the King Hall webcam<\/a><\/li>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=qJG6l4dNfNE\">24 hours above Lausanne, Switzerland from the Rue du Valentin Webcam<\/a><\/li>\n<\/ul>\n<p>This Perl script generates a one-day movie from the King Hall, Lake Mendota cam:<\/p>\n<pre>#!\/usr\/bin\/perl -w\r\n\r\n# get_webcam_pics Bill Feiereisen, February 22, 2017\r\n# Put this script in a file ending in .pl For example --&gt; get_webcam_pics.pl\r\n# Place it in a new directory. Execute it with .\/get_webcam_pics.pl\r\n# Patience! It runs for a long time depending on how many pictures and the wait interval\r\n\r\n# Gets webcam pictures at regular intervals from public webcams and stores\r\n# them for later processing into a time-lapse movie.\r\n# Downloads from the chosen camera URL with curl.\r\n# Creates a sequential filename for each picture and stores in the current directory.\r\n# After the main loop calls ffmpeg to generate the movie from stored frames.\r\n# You gotta have curl and ffmpeg installed on your system.\r\n# You could do the downloading with wget if you don't have curl.\r\n\r\n# identify script to the terminal.\r\n  print \"get_webcam_pics Bill Feiereisen February 22, 2017\\n\";\r\n\r\n# Here's where this particular cam stores its files.\r\n  $CAM_URL=\"http:\/\/agwx.soils.wisc.edu\/soils-agwx-assets\/uwex_agwx\/images\/webcam\/fullsize.jpg\";\r\n  $CAM_NAME=\"Lake_Mendota\";\r\n\r\n# picture counter limit\r\n# This is one day at five minute intervals.\r\n  $ipic_max = 288; #How many pictures? Change to suit.\r\n# sleep time\r\n  $sleep_tics = 300; #This is 300 seconds, five minute interval. Change to suit.\r\n\r\n# main picture gathering loop\r\n  for ($ipic = 0; $ipic &lt; $ipic_max; $ipic+=1) { # main loop\r\n      $picture_name = \"$CAM_NAME$ipic.jpg\"; # create filename with sequential numbered files\r\n      print \"$picture_name\\n\"; # print something to the terminal so you know what's happening.\r\n      system(\"curl -o $picture_name $CAM_URL;\"); # get the picture and store it\r\n      sleep $sleep_tics; #sleep for a while until the next picture is available.\r\n  } #end picture gathering loop\r\n\r\n# make movie with ffmpeg\r\n# for this call use 15fps, start with file number 0, code at 1280x800\r\n  system(\"ffmpeg -r 15 -start_number 0 -i $CAM_NAME%d.jpg -s 1280x800 -vcodec libx264 $CAM_NAME.mp4;\");\r\n\r\n# end of main program\r\n  exit;<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are plenty of generally accessible webcams. Instead of just tuning in and watching, I wrote some perl scripts \u00a0to grab pictures at regular intervals and then put them together into time-lapse movies. I&#8217;m fond of Madison, Wisconsin, because I &hellip; <a href=\"https:\/\/feiereisen.net\/?page_id=302\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":32,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-302","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/feiereisen.net\/index.php?rest_route=\/wp\/v2\/pages\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/feiereisen.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/feiereisen.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/feiereisen.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/feiereisen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302"}],"version-history":[{"count":14,"href":"https:\/\/feiereisen.net\/index.php?rest_route=\/wp\/v2\/pages\/302\/revisions"}],"predecessor-version":[{"id":324,"href":"https:\/\/feiereisen.net\/index.php?rest_route=\/wp\/v2\/pages\/302\/revisions\/324"}],"up":[{"embeddable":true,"href":"https:\/\/feiereisen.net\/index.php?rest_route=\/wp\/v2\/pages\/32"}],"wp:attachment":[{"href":"https:\/\/feiereisen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}