DepthAI camera's video and still image outputs to a RTSP H264 video stream and JPEG HTTP server
565
A script to extract a DepthAI camera's video and still image outputs to a RTSP H264 video stream and JPEG HTTP server. Basic HTTP Authentication is supported. Based on Luxonis' gen2-rtsp-streaming and http-server projects.
If you are looking for a way to re-use your DepthAI camera (e.g. Oak-D Lite) as a security camera, this is the right place! RTSP stream and snapshot JPEG through HTTP can be used to integrate to many home automation platforms such as Homebridge or Scrypted.
docker run --rm --privileged -v /dev/bus/usb:/dev/bus/usb donkeystudio/depthai-rtsp-http:latest
Note: If you are using OAK POE device on Linux host machine, you should add --network=host argument to your docker command, so depthai inside docker will be able to communicate with the OAK POE.
python3 main.py --help
usage: main.py [-h] [-u USER] [-pwd PASSWORD] [-hp HTTP_PORT] [-rp RTSP_PORT] [-wt WIDTH] [-ht HEIGHT] [-qa QUALITY] [-sm SCALE_MODE]
optional arguments:
-h, --help show this help message and exit
-u USER, --user USER Username (default: None)
-pwd PASSWORD, --password PASSWORD Password (default: None)
-hp HTTP_PORT, --http_port HTTP_PORT Port for HTTP Server (default: 8080)
-rp RTSP_PORT, --rtsp_port RTSP_PORT Port for RTSP Server (default: 8554)
-wt WIDTH, --width WIDTH Width of the video/preview size. In multiple of 32 (default: 1920)
-ht HEIGHT, --height HEIGHT Height of the video/preview size. In multiple of 8 (default: 1080)
-qa QUALITY, --quality QUALITY Video quality, from 1 to 100 (default: 100)
-sm SCALE_MODE, --scale_mode SCALE_MODE Scale or crop the video output. Default is scale. Set to false to switch to crop mode (default: True)
Run RTSP server on port 8554, HTTP server on port 8080, Basic HTTP Authentication with user:password as username and password.
python3 main.py -u user -pwd password -hp 8080 -rp 8554
To see the streamed frames, use a RTSP Client (e.g. VLC Network Stream) with the following link
rtsp://localhost:8554/preview
On Ubuntu or Mac OS, you can use ffplay (part of ffmpeg library) to preview the stream
ffplay rtsp://localhost:8554/preview
To see the latest still image, access http://localhost:8080/img
Content type
Image
Digest
sha256:6257fc3df…
Size
970.1 MB
Last updated
about 4 years ago
docker pull donkeystudio/depthai-rtsp-http