{"assets":[],"author_link":"author\/kvisle\/","author_name":"Kvisle","cat":"LD #21","categories":["LD #21"],"comments":[],"epoch":1313739000,"event":"LD21","likes":6,"metadata":{"p_key":"77339","p_author":"Kvisle","p_authorkey":"0","p_urlkey":"286190","p_title":"Creating a timelapse in Linux","p_cat":"LD #21","p_event":"LD21","p_time":"1313739000","p_likes":"6","p_comments":"0","p_status":"WAYBACK","us_key":null,"us_name":null,"us_username":null,"event_start":"1313712000","event_key":"7","event_name":"LD21"},"source_url":"2011\/08\/19\/creating-a-timelapse-in-linux\/","text":"<p>Hello,<\/p>\n<p>I\u2019ve written a couple of scripts for making timelapses in Linux.  It\u2019s fairly simple stuff;<\/p>\n<p>Create a screenshot every 15th second by running the following script in a terminal;<\/p>\n<p><code><br\/>\n#!\/bin\/bash<\/code><\/p>\n<p># Takes a screenshot of my second monitor every 15 seconds<br\/>\n# Only have one monitor? Drop the -crop part ...<\/p>\n<p>mkdir ~\/img<\/p>\n<p>while [ 1 ]; do<br\/>\n#       Uncomment the line below if you only want timelapse of your second monitor, and both monitors are 1680x1050 big.<br\/>\n#\timport -window root -crop 1680x1050+1680+0 ~\/img\/LD21-$(date +%y%m%d-%H%M%S).jpg<\/p>\n<p>\timport -window root ~\/img\/LD21-$(date +%y%m%d-%H%M%S).jpg<br\/>\n\tsleep 15<br\/>\ndone<br\/>\n<\/p>\n<p>(The script is interrupted by pressing CTRL+C)<\/p>\n<p>Then encoding the images can be done using mencoder, like this;<\/p>\n<p><code>mencoder mf:\/\/*.jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi<\/code><\/p>\n<p>If you want audio, add \u2018-audiofile somefile.mp3\u2019.<\/p>\n<p>Hurray!<\/p>\n<p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/howto\/\" rel=\"tag\">howto<\/a>, <a href=\"http:\/\/ludumdare.com\/compo\/tag\/timelapse\/\" rel=\"tag\">timelapse<\/a><\/p>","time":"August 19th, 2011 7:30 am","title":"Creating a timelapse in Linux","title_was_empty":false}