Emulate webcam streaming by showing a sequence of snapshots
The default video streamer in the OctoPi image is mjpg-streamer. It works by fairly simply stitching the jpeg images from the webcam into a stream that can be displayed by the browser. You may want to avoid this stitching and just have javascript display the jpg images every few hundred milliseconds instead.
A couple of reasons might be:
-
You want to use a browser that doesn’t support mjpeg streams (IE).
-
You want to reduce your bandwidth and cpu usage on your host.
You can reduce bandwidth and cpu usage by reducing the frame rate on mjpg-streamer, but perhaps the plugin is even lighter weight, try it out on your hardware and see.
Settings
The plugin has a couple of settings you can change:
-
Frames per second.
The plugin uses javascript to update the snapshot so the frames are really limited by the browsers ability/willingness to call a timer interval function. Probably best to stay in the slow, reliable, but choppy end of things: 1, 2 or 4 or something like that.
-
Fallback mode only.
The plugin only takes over and uses snapshots when the stream fails to load.