mercoledì, settembre 18, 2013

Timelapse video with raspberry and raspberry pi camera module

Today I did some tests with the raspberry camera module

First you need to decide how many photos you take and how often, in my test I've took a photos per minute for fours hours.
To do this, the command is very simple:

  1. raspistill -o name_%04d.jpg -tl 60000 -t 14400000

-tl = timelapse mode, takes a picture every <t>ms (60.000 is 1x60x1000ms) = 1 minute
-t = time before taking picture (14.400.000 is 4x60x60x1000ms) = 4 hours
name_%04d = will result filenames with sequential number.

See man raspistill for more options

When taking photos is over we need to merge them into a video:

  1. avconv -r 10 -i name_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 videoname.mp4

-r = is a fps
-crf = is a quality video, lowers value = best quality = large file size, I think that 20 is a good value

With this parameters the file size result is 140 Mb (original size 2592x1944). If you want to resize a video use this option during video creation:

  1. avconv -r 10 -i name_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 -vf crop=2592:1944,scale=1280:720 videoname.mp4

With crop option the file size result is 15 Mb, perfect for youtube

venerdì, settembre 13, 2013

Wired remote control Canon homebuilt

Today I wanted to buy the wired remote control Canon but then I asked myself ... why not build it yourself?

A quick search on the internet to find the pinout ( and this is the result:

black button: meter
red button: shutter
red switch: bulb mode

material: jack stereo 2,5, three wire cable of the desired length, n. 2 button, n. 1 switch, 1 plastic box, welder and lots of patience :)

Connections details:

Final result:

Cost original remote control in the internet: 25 $ approximately
Cost for this project: 2 $ approximately

Thx to my friend Luca Soltoggio for help of the welding

giovedì, settembre 05, 2013

How to display the status of the torrent from the terminal

Today I need to see the status of torrents from the terminal on the raspberry. After obtaining this information, you can implement a lot of things (turn on an LED when a torrent is finished, send an email, write something on the lcd monitor etc ...).
The solution is the following:

transmission-remote --auth=username:password -l

but if, as in my case the transmission is non-standard port or host is different just use the command

transmission-remote host:port --auth=username:password -l

After obtaining the status of the torrent you can do the "parsing" of the result to be able to implement in a script (send mail, php page, lcd, led etc ...)

For more information and options read the man transmission-remote