Stream a webcam through the network
4.3K
This is a docker file that utilizes mjpg-streamer to stream a webcam through the local network. The docker file of this image is available below and on github, feel free to adapt and use it based on your setup...
FROM alpine:3.20 AS base
ARG REPO='https://github.com/jacksonliam/mjpg-streamer.git'
RUN apk add --no-cache cmake jpeg-dev gcc g++ git make libjpeg-turbo-dev linux-headers
WORKDIR /opt/
RUN git clone ${REPO}
RUN mv ./mjpg-streamer/* ./
WORKDIR /opt/mjpg-streamer-experimental/
RUN make
RUN make install
FROM base
ENV RES='640x480'
ENV FRAME_RATE='30'
ENV INPUT_ARGS=''
ENV OUTPUT_ARGS=''
WORKDIR /opt/mjpg-streamer-experimental/
RUN export LD_LIBRARY_PATH=.
CMD sh -c "./mjpg_streamer -i './input_uvc.so -n -f echo ${FRAME_RATE} -r ${RES} -d /dev/video0 ${INPUT_ARGS}' -o './output_http.so -w ./www -p 8080 ${OUTPUT_ARGS}'"
Proposed docker-compose file (I used this config with a PS3 eye camera):
services:
mjpg-streamer:
restart: always
image: mnapps/mjpeg-streamer
devices:
- /dev/video0:/dev/video0
ports:
- 8080:8080
environment:
- RES=640x480
- INPUT_ARGS=-y
Content type
Image
Digest
sha256:b3e3c4a05…
Size
110.3 MB
Last updated
almost 2 years ago
docker pull mnapps/mjpeg-streamer