Revision as of 09:49, 28 January 2014 by AlonLevy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

ok the idea is this we get motion to output a 16x16px ico file to us as dynamic low fps favicon for space.telavivmakers.com so people can know by the color of the favicon if there is someone in house.

there are a few methods of saving pictures with motion, the easiest is just timelapsing every n seconds.

Make automated snapshot every N seconds (default 0 = disabled)

snapshot_interval 1

Command to be executed when a picture (.ppm|.jpg) is saved (default none)
To give the filename as an argument to a command append it with %f

on_picture_save value

add this to the space.telavivmkaers.org header file

<link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

so what i need is to run a script to

1. downscale the 640x480 jpg to 16x16png
2. convert to .ico icon file (using png2ico ?)
9. clear the /tmp/pictures folder (we are low on space on the wr703)

Convertion of camera captured image to icon

Using imagemagic with the exclamation mark used to allow changes of aspect ratio - capture is 640x480 (4:3) and icon is 16x16 (1:1). Backslash used to quote against special meaning of exclamation mark (in most/all shells?):

  • convert input-image.jpg -resize 16x16\! favicon.ico

TODO: Caching

Need to tell server not to cache either image:

  • Server returned headers to HTTP GET request:
    • Pragma: No-cache
  • HTML side?
  • or use the trick where we change the url all the time so the browser has to do a new fetch (by appending #blabla to it, which is ignored by the server)