MJPEG Bottle GStreamer

with No Comments

Streaming MJPEG with GStreamer and Bottle

Several projects of mine have used this technique. By leveraging bottle for the server and GStreamer for video, this model is clean and extremely extendable. In this stripped down example, a video test pattern is streamed to the browser. By changing the gstreamer pipeline, you could easily stream live video from your Raspberry Pi robot, or stream video from your server.

Install Requirements

pygst isn’t “pipable” so, I’m pulling it from another package manager. Everything else I’m doing in a python virtual environment.

Create Server

Bottle keeps the server code clean and simple. Here, the root page serves a bare page with an image tag. Inside the image tag is a link to our other route which will serve the images.

  • Note: This MJPG through img tag technique will not work in IE.
MJPEG Video Source

Here is where we actually generate the jpeg frames. Update the PIPELINE to your liking.

Thats it really. Just run the server and open the page in your browser.