Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've written previously about setting up a traffic webcam on OS X, well now I decided to move away from my old OS X Lion Server so couldn't use those scripts any more. This past weekend I took some time to rewrite my cam scripts to work on Linux and this is what I ended up with...

OK so it looks more or less the same as it always has, but the scripts are cleaner, more configurable and easier to work with. I've made them all open source and put them up on GitHub, so you can get them here - https://github.com/ikromin/trafficr.

The scripts assume that you have a Linux machine with a webcam connected and you upload frames from that webcam to a website. Frame capture is done with some common packages like FFMPEG/Video4Linux, image processing and watermarking is done using ImageMagick,and uploads are handled via cURL. The uploads are secured out of the box, you just need to make sure you password protect the web site upload script, which is covered in the README.

On the website side there are a couple of scripts that let you upload and retrieve frames. There is also a JavaScript script that fetches all the frames and plays them back in correct order. The sample HTML page shows how that is all set up.

I still want to implement fetching new frames without having to reload, that's something for the future though.

My traffic cam is using these scripts and can be accessed here: Riverside Expressway Cam.

If you do end up using my scripts, please let me know!


A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.