This repository contains Docker containers for streaming video from an ESP32 camera module. The project includes two separate containers: one using FFmpeg and the other using GStreamer. These containers are designed to capture an MJPEG stream from an ESP32 camera, re-encode it to H.264, and serve it via an HLS (HTTP Live Streaming) stream that can be accessed in a web browser.
- FFmpeg and GStreamer Support: Two separate containers for each streaming method.
- HLS Streaming: Re-encodes MJPEG to H.264 and serves via HLS for broad compatibility.
- Multi-Architecture Builds: Containers built for both
amd64andarm64architectures. - Configurable Stream Quality: Environment variables to adjust bitrate, frame rate, and resolution.
- Reconnection Logic: Automated reconnection attempts for unstable camera streams.
- Nginx for Web Serving: Includes Nginx to serve the HLS stream and a web interface.
- Docker installed on your machine.
- An ESP32 camera module set up and accessible over the network.
Pull the images from Docker Hub:
docker pull cjgaspard/esp32-hls-ffmpeg
docker pull cjgaspard/esp32-hls-gstreamerRun the FFmpeg container:
docker run -d \
--name esp32-ffmpeg \
-p 8080:80 \
-e ESP32_CAM_URL="http://your_esp32_cam_address" \
cjgaspard/esp32-hls-ffmpegRun the GStreamer container:
docker run -d \
--name esp32-gstreamer \
-p 8081:80 \
-e ESP32_CAM_URL="http://your_esp32_cam_address" \
cjgaspard/esp32-hls-gstreamerYou can customize the stream by setting the following environment variables:
ESP32_CAM_URL: The URL of your ESP32 camera stream.AUDIO_FEED_URL: (Optional) The URL for a separate audio feed.VIDEO_BITRATE: The desired video bitrate (e.g., "800k").AUDIO_BITRATE: The desired audio bitrate (e.g., "96k").FRAME_RATE: The desired frame rate (e.g., "30").RESOLUTION: The desired video resolution (e.g., "1280x720").
After running the container, access the HLS stream through a web browser:
- For FFmpeg container:
http://localhost:8080/ - For GStreamer container:
http://localhost:8081/
Contributions are welcome! Please submit pull requests or open issues for any enhancements, bug fixes, or improvements.