Giter Club home page Giter Club logo

docker-mjpg-streamer's Introduction

docker-mjpg-streamer

build status

This is a Dockerfile to set up mjpg-streamer. It supports the following architectures automatically:

  • amd64
  • arm/v6
  • arm/v7
  • arm64

Tested devices

Device Working?
amd64 Untested
Raspberry Pi 2b Untested
Raspberry Pi 3b+ โœ…
Raspberry Pi 4b Untested
Raspberry Pi Zero W Untested

Please let me know if you test any others, would love to increase the compatibility list!

Usage

$ docker run \
  --device=/dev/video0 \
  -p 8080:8080 \
  patsoffice/mjpg-streamer

Environment Variables

Variable Description Default Value
CAMERA_DEV The camera device node /dev/video0
MJPEG_STREAMER_INPUT Flags to pass to mjpg_streamer -y -n -r 640x480

Webcam integration

USB Webcam

  1. Bind the camera to the docker using --device=/dev/video0:/dev/videoX
  2. Optionally, change MJPEG_STREAMER_INPUT to your preferred settings (ex: input_uvc.so -y -n -r 1280x720 -f 10)

Raspberry Pi camera module

  1. The camera module must be activated (sudo raspi-config -> interfacing -> Camera -> set it to YES)
  2. Memory split must be at least 128mb, 256mb recommended. (sudo raspi-config -> Advanced Options -> Memory Split -> set it to 128 or 256)
  3. You must allow access to device: /dev/vchiq
  4. Change MJPEG_STREAMER_INPUT to use input_raspicam.so (ex: input_raspicam.so -fps 25)

Octoprint integration

Use the following settings in octoprint:

webcam:
  stream: http://name-of-your-docker-host:8080/?action=stream
  snapshot: http://name-of-mjpg-streamer-container:8080/?action=snapshot
  ffmpeg: /opt/ffmpeg/ffmpeg

The steam URL needs to be able to connect from your web browser but the snapshots can connect over the internal docker network. If you are using the official Octoprint container, the path to the ffmpeg binary is /opt/ffmpeg/ffmpeg.

License

MIT

docker-mjpg-streamer's People

Contributors

patsoffice avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.