Simple CGI MJPEG Streamer in Bash

Posted by – 30/06/2014

This is mainly just for personal reference; I’m posting here since it may help someone else. I am sending images captured in surveillance IP cameras via FTP to some hosting. This is for convenience, since any cheap surveillance IP camera has this facility. So, how to watch in near-real-time without having to refresh the browser or using some javascript trickery? Also, How to watch using common IPcam mobile clients?

Easy enough: just create a MJPEG stream and use a CGI-capable HTTP server for the job. Some quick hacking (and inotify abuse) gave me the following Bash script:

Now, I just have to figure-out how to kill the process afterwards ­čÖé

Leave a Reply

Your email address will not be published. Required fields are marked *