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...
trafficr.jpg


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!

-i

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...