====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
peripherals:camera:timelapse [2016/06/21 02:15]
admin [4- Process files on the Raspberry Pi]
peripherals:camera:timelapse [2017/03/01 18:19]
admin [Convert / Modify images before combining]
Line 260: Line 260:
 ---- ----
 ==== 4- Process files on the Raspberry Pi ==== ==== 4- Process files on the Raspberry Pi ====
-**Note:** all recommendations hereafter are based on a [[:​os:​minibian|Minibian install]] (2016-03-12-jessie),​ it is supposedly very close to Raspbian but we haven'​t have the opportunity (yet) to test it.+**Note:** all recommendations hereafter are based on a [[:​os:​minibian|Minibian install]] (2016-03-12-jessie),​ it is supposedly very close to Raspbian but we haven'​t have the opportunity (yet) to test if all works the same on Raspbian.
  
 === A - View image files with FIM === === A - View image files with FIM ===
  
-There is a nice piece of software called [[http://​www.nongnu.org/​fbi-improved/​|FIM]] that allows to visualize image files stright ​into the Linux shell!+There is a nice piece of software called [[http://​www.nongnu.org/​fbi-improved/​|FIM]] that allows to visualize image files straight ​into the Linux shell!
  
 We'll follow the [[http://​www.nongnu.org/​fbi-improved/​|Download and build instructions]] from the FIM website: We'll follow the [[http://​www.nongnu.org/​fbi-improved/​|Download and build instructions]] from the FIM website:
Line 275: Line 275:
 > gpg --verify fim-0.5-rc1.tar.gz.sig > gpg --verify fim-0.5-rc1.tar.gz.sig
 </​Code>​ </​Code>​
 +
 +We'll need a few additional packages to go on:
 +<​Code:​bash |Install FIM required packages:>​
 +> apt-get install gcc gcc-c++ g++ build-essential flex bison libreadline-dev libexif-dev
 +> ./​configure ​
 +> make -j 6
 +> make install
 +</​Code>​
 +
 +**Notes:**
 +  * although ''​libreadline-dev''​ was installed we had to use the ''​--disable-readline''​ option to be able to configure
 +  * we used ''​make -j 6''​ to take advantage of the 4 cores in the Pi3 ([[https://​www.raspberrypi.org/​forums/​viewtopic.php?​f=29&​t=103001|see this]])
  
 === B - Install ffmpeg on The RasPi === === B - Install ffmpeg on The RasPi ===
Line 307: Line 319:
  
 We now have a //​my_timelapse.mp4//​ movie which is full HD (1920×1080). We now have a //​my_timelapse.mp4//​ movie which is full HD (1920×1080).
 +
 +==== Convert / Modify images before combining ====
 +----
 +
 +Sometimes it may be suitable to adjust,​convert or otherwise modify images before they are integrated as a movie.
 +
 +[[https://​www.imagemagick.org/​script/​convert.php|ImageMagick]] offers a set of command line tools that can be used to manipulate images from the command line. In the following example, we're going to ''​convert''​ all captured images to grayscale, it's also called desaturate. Therefore, we'll be using the imagemagick ''​[[https://​www.imagemagick.org/​script/​convert.php|convert]]''​ command. To enhance the output result, we'll also make use of the ''​-normalize''​ option.
 +
 +Here is how to **convert a single file**:
 +<​Code:​bash|Single file conversion>​
 +> convert my_originals/​img01.jpg -colorspace Gray -normalize my_converted/​img01.jpg
 +</​Code>​
 +
 +Here is how to **batch convert multiple files** at once:
 +<​Code:​bash|Multiple files conversion>​
 +> for f in my_originals/​*.jpg ; do convert "​$f"​ -colorspace Gray -normalize "​my_converted${f%my_originals}"​ ; done
 +</​Code>​
 +
 +Another interesting usage of ImageMagick here would be to "water mark" all images before integrating them into the movie, your timelapses can be "​signed"​ using this method.
 ==== MP4 Optimization for Web Streaming ==== ==== MP4 Optimization for Web Streaming ====
 ---- ----