Streaming image from webcam through www

Willing to stream image from your webcam through Internet? Nothing easier with Ubuntu!

# install
sudo apt-get install motion

# create config file
mkdir ~/.motion && gedit ~/.motion/motion.conf

# define the port and motion settings
webcam_port 8081
webcam_localhost on
# increase maxrate & quality
webcam_maxrate 30
webcam_quality 90
# slow down the stream to 1 frame per second if no motion
webcam_motion on

# run motion

You can find the stream at http://localhost:8081/.

If you wish to stream it publicly, I recommend at least basic HTTP based authentication.
# install apache2-utils
sudo apt install apache2-utils

# setup new user & passwd
sudo htpasswd -c /etc/apache2/.htpasswd webcam

# configure apache2 – add to your VirtualHost config
# webcam
<Location "/cam">
# proxy
ProxyPass http://localhost:8081/
ProxyPassReverse http://localhost:8081/
# htpasswd
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
Now, image from your webcam will be accessible at http://YOURDOMAIN.COM/cam

Finally, you can configure motion to run only when you are away.

Inspired by gist.

Geotag your photos for free

Today slightly different topic. I was looking for a way of geotagging my photos. At first, I wanted to share GPS position from my phone to my camera via wi-fi. But it turned out to be impossible…

Then, I considered buying dedicated GPS dongle, but these are quite expensive and pretty useless, as they work only with given manufacturer and sometimes only with given camera model, and you have to carry (and re-charge) yet another gadget (sic!).

Recently I have realised there is much simpler solution. During my trips, I enable GPS tracking on my phone (ie. Endomondo) and shoot photos as usual. After going back home I get GPS info from Endomondo website (More options –> Export –> .gpx file) and update photos with geotags (ie. GottenGeography or digiKam under Linux).