A Python-based MJPEG (Motion JPEG) HTTP server that streams images from a folder as a continuous video feed. Use this to simulate an IP camera for testing OpenALPR RekorScout with your own license plate images instead of a physical camera.
This image streamer acts as a virtual IP camera that feeds images to Rekor Scout for ALPR processing:
📁 Your Images → 📹 Image Streamer → 🤖 Rekor Scout → 🖥️ Local Dashboard
Perfect for:
- Testing ALPR setups without a physical camera
- Replaying captured license plate images
- Development and debugging
- Training and demonstrations
- 📹 MJPEG Stream - Standard Motion JPEG over HTTP format
- 🎥 OpenALPR Compatible - Works with RekorScout and other ALPR software
- 📺 1080p Output - Streams at 1920x1080 resolution
- ⏱️ Configurable Timing - Set display duration per image
- 🔄 Loop Control - Continuous loop or stop at end
- 🖼️ Multi-Format Support - Accepts PNG and JPG/JPEG files
- 🎯 Smart Resizing - Maintains aspect ratio with letterboxing
- 📊 Natural Sorting - Images sorted numerically (1, 2, 3...10)
- 🖤 Fallback Image - Default image when no content available
pip install -r requirements.txtThis installs: opencv-python, Pillow, and numpy
Create an images folder and add your images:
mkdir imagesAdd PNG or JPG images to this folder. Images will be streamed in natural numerical order.
Optional: Add a default.jpg file in the same directory as the script to serve as a fallback image when no images are available.
Use the included sample downloader to quickly get test images:
# Download 10 sample images
python download_samples.py --download 10
# Download 50 images
python download_samples.py --download 50
# Clear all sample images
python download_samples.py --clearBasic usage (2 seconds per image, looping):
python http_image_stream.pyCustom duration:
python http_image_stream.py --duration 5.0No looping (stops at end, shows default image):
python http_image_stream.py --duration 3.0 --no-loopCustom port:
python http_image_stream.py --port 8080Custom images folder:
python http_image_stream.py --images ./my_images --duration 2.5| Option | Description | Default |
|---|---|---|
--images FOLDER |
Path to folder containing images | images |
--duration SECONDS |
Time to display each image | 2.0 |
--loop |
Loop through images continuously | Enabled |
--no-loop |
Stop at end and show default image | Disabled |
--default PATH |
Path to fallback image | default.jpg |
--port PORT |
HTTP server port | 8000 |
--host HOST |
HTTP server host | 0.0.0.0 |
Open in any browser:
http://localhost:8000
Or from another device on your network:
http://<your-ip-address>:8000
Follow these steps to use the image streamer as a camera source for Rekor Scout ALPR processing:
python http_image_stream.py --duration 3.0 --loopThe server will start on http://localhost:8000. Keep this terminal window open.
-
Open Rekor Scout on your Windows machine
-
Click "Add Camera" in the main interface
-
Select camera type: Choose
IP Camera (Manual)from the dropdown -
Enter camera URL: Use one of these URLs:
- Primary:
http://localhost:8000/video.mjpeg - Alternative:
http://localhost:8000/stream - Alternative:
http://localhost:8000/mjpeg
Note: Replace
localhostwith your computer's IP address if Rekor Scout is running on a different machine - Primary:
-
Click "Test" to verify the stream is working
-
Click "Save Camera" and give it a name (e.g., "Image Stream Test")
-
Start services when prompted (click "Yes")
If you're using the local ALPR dashboard server, configure Rekor Scout to send detections there:
- In Rekor Scout, go to Configure → Data Destinations
- Select "Other HTTP Server"
- Enter URL:
http://localhost:5000/alpr - Click "Save"
Now your complete pipeline is:
📁 Images → 📹 Image Streamer → 🤖 Rekor Scout → 🖥️ Local Dashboard
See the main project README for full instructions on setting up the local dashboard server.
| Endpoint | Description |
|---|---|
/ |
Web viewer with stream information |
/video.mjpeg |
MJPEG stream (recommended for ALPR) |
/stream |
MJPEG stream (alternative URL) |
/mjpeg |
MJPEG stream (alternative URL) |
/video.mjpg |
MJPEG stream (alternative URL) |
- Images are resized to fit within 1080p (1920x1080) while maintaining aspect ratio
- Smaller images are centered on a black background (letterboxing)
- Larger images are scaled down proportionally
- JPEG quality optimized at 55% for efficient streaming and ALPR compatibility
- Format: MJPEG (Motion JPEG over HTTP)
- Resolution: 1920x1080 (1080p)
- Update Rate: ~30 FPS
- Boundary:
--jpgboundary - MIME Type:
multipart/x-mixed-replace
.jpg/.jpeg(case-insensitive).png(case-insensitive)
The default.jpg is displayed when:
- No images exist in the images folder
- Using
--no-loopand all images have been shown - An error occurs loading an image
If default.jpg is not found, a black frame is displayed.
# Download test images
python download_samples.py --download 20
# Start streaming with 3-second intervals
python http_image_stream.py --duration 3.0
# Access at http://localhost:8000# Prepare your license plate images in the images folder
# Start the server
python http_image_stream.py --duration 2.0 --loop
# In RekorScout, add camera:
# URL: http://<server-ip>:8000/video.mjpeg# Play through images once, then stop
python http_image_stream.py --duration 4.0 --no-loopStream not connecting to RekorScout:
- Ensure the server is accessible from RekorScout's machine
- Try the different endpoint URLs (
/video.mjpeg,/stream,/mjpeg) - Check firewall settings on port 8000
- Verify the server is running with
--host 0.0.0.0for network access
Images not in correct order:
- The server uses natural sorting - ensure filenames have consistent numbering
- Examples:
image_1.jpg,image_2.jpg,image_10.jpg(notimage1.jpg,image02.jpg)
Stream quality issues:
- JPEG quality is set to 55% for optimal ALPR performance and bandwidth
- Modify
IMWRITE_JPEG_QUALITYin code if higher quality is needed
Press Ctrl+C to gracefully stop the server.