This service allows us to mock out the full ffserver + ffmpeg stream with a simple HTTP server and static files.
To use this create a data directory of the form:
data/
bottom/
live.mp4
images/
image1.jpg
image2.jpg
...
top/
live.mp4
images/
image1.jpg
image2.jpg
...
Note: If video or images are not available for a resource, the playback server will serve a blank video or image.
Now we can run the server with:
go build
./playback-server -data /path/to/data
We've also packaged this as a Docker image which can be run with:
docker run -ti -p 8090:8090 -v /path/to/data:/data:ro waggle/playback-server
Data will be available at:
# serves mp4 video stream
ffplay http://localhost:8090/bottom/live.mp4
ffplay http://localhost:8090/top/live.mp4
# serves sequence of images from data directory
wget http://localhost:8090/bottom/image.jpg
wget http://localhost:8090/top/image.jpg