Based on the repo, https://github.com/aler9/rtsp-simple-server. A rtsp-simple-server_ is a ready-to-use and zero-dependency server and proxy that allows users to publish, read and proxy live video and audio streams through various protocols:
| protocol | description | publish | read | proxy |
|---|---|---|---|---|
| RTSP | fastest way to publish and read streams | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| RTMP | allows to interact with legacy software | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| HLS | allows to embed streams into a web page | :x: | :heavy_check_mark: | :heavy_check_mark: |
The setup is based on the configuration files
The video files are not included in the repo due to size, but can be download from the ftp using the URL https://ftp.subcservices.com/list/Other/Sample_Videos.
The sample videos included are:
| Location | Filename | Type |
|---|---|---|
| /videos/ | Seafloor_1080 | MP4 |
| /videos/ | Seafloor_720 | MP4 |
| /videos/ | Seafloor_SD | MP4 |
| /videos/ | GreenlandShark_1080 | MP4 |
| /videos/ | GreenlandShark_720 | MP4 |
| /videos/ | GreenlandShark_SD | MP4 |
| /videos/ | Spiny_Lobster_2012 | MP4 |
| /videos/ | Swimming_Crinoid_ROVLine_2014 | MP4 |
| /videos/ | Dolphins | MP4 |
| /videos/ | Lava_Tubes | MP4 |
| /videos/ | Acid_Horizons | MP4 |
| /videos/ | UWash_Ocean_2020 | MP4 |
| /videos/ | Shark_Egg | MP4 |
| /videos/ | Titantic_2021 | MP4 |
For help with configuration of the file, check out the link, https://github.com/aler9/rtsp-simple-server/blob/main/README.md#configuration. The main usage for us would be related to video on demand(VOD) is https://github.com/aler9/rtsp-simple-server/blob/main/README.md#on-demand-publishing.
A modified sample for us is:
paths:
all:
readUser: subcstreams
readPass: 9jxnpPIl
GreenlandShark_1080:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/GreenlandShark_1080.mp4 -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
GreenlandShark_720:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/GreenlandShark_720.mp4 -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
GreenlandShark_SD:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/GreenlandShark_SD.mp4 -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
Spiny_Lobster_2012:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Spiny_Lobster_2012.mp4 -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
Swimming_Crinoid_ROVLine_2014:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Swimming_Crinoid_ROVLine_2014.mp4 -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
Dolphins:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Dolphins.mp4 -c copy -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
LavaTubes:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Lava_Tubes_HD.mp4 -c copy -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
AcidHorizons:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Acid_Horizons_HD.mp4 -c copy -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
UWashOcean2020:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/UWash_Ocean_2020_HD.mp4 -c copy -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
SharkEgg:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Shark_Egg.mp4 -c copy -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
Titantic2021:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Titantic_2021_HD.mp4 -c copy -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
Seafloor_1080:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Seafloor_1080.mp4 -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
Seafloor_720:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Seafloor_720.mp4 -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
Seafloor_SD:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Seafloor_SD.mp4 -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
What is happening with the code is we have several labels starting with all, which includes the readonly username and password. Next, we have our VOD setup's.
Dolphins:
runOnDemand: ffmpeg -re -stream_loop -1 -i /videos/Dolphins.mp4 -c copy -preset ultrafast -vcodec libx264 -tune zerolatency -b 1000k -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH
runOnDemandRestart: yes
You can modify the ffmpeg command to make it work the best possible for the video source your using. The example shown takes the input of /videos/Dolphins.mp4, encodes it into h264 at a bitrate of 1k.
Streaming at the original bitrate or high bitrates can cause issues. Also, streaming at bitrates that are too low will not work within the IP camera setup's on SubC applications.
As part of the setup, each time you make a change you need to update the docker image online. The steps below will assist..
"docker_build dev". But when everything is working correctly, upload to the live image using the command "docker_build live"Checkout Docker Hub at https://hub.docker.com/repository/docker/subc/aler9_rtsp_vod_server to see all available versions and any notes.
The command or batch file preforms all the needed commands to compile, upload and allows for testing the docker image locally if you wish. Checkout the contents of the batch file to learn more.
I have found this image can cause increase CPU needs when using it, best to keep the VOD limited to one(1) feed for local testing.
Once the docker image is updated, you can download them to a Windows or Linux machine using the docker run command. Checkout the steps below.
Linux
sudo docker run --name rtspserver -p 10554:10554/tcp -d subc/aler9_rtsp_vod_server:dev or sudo docker run --name rtspserver -p 10554:10554/tcp -d subc/aler9_rtsp_vod_server:livesudo docker psto check if the image is runningTo test if any of the VOD's are working, open one of the below RTSP feeds in SubC Stream, SubC DVR+O, VLC or any other program able to open a RTSP streaming video feed.
| Name | Filename | RTSP URL | Description |
|---|---|---|---|
| Ocean Seafloor | /videos/Seafloor_1080.mp4 | rtsp://subcstreams:[email protected]:10554/Seafloor_1080 | Demo video of the ocean seafloor. |
| Ocean Seafloor | /videos/Seafloor_720.mp4 | rtsp://subcstreams:[email protected]:10554/Seafloor_720 | Demo video of the ocean seafloor. |
| Ocean Seafloor | /videos/Seafloor_SD.mp4 | rtsp://subcstreams:[email protected]:10554/Seafloor_SD | Demo video of the ocean seafloor. |
| Greenland Shark | /videos/GreenlandShark_1080.mp4 | rtsp://subcstreams:[email protected]:10554/GreenlandShark_1080 | Demo video of a shark off Greenland. |
| Greenland Shark | /videos/GreenlandShark_720.mp4 | rtsp://subcstreams:[email protected]:10554/GreenlandShark_720 | Demo video of a shark off Greenland. |
| Greenland Shark | /videos/GreenlandShark_SD.mp4 | rtsp://subcstreams:[email protected]:10554/GreenlandShark_SD | Demo video of a shark off Greenland. |
| Spiny Lobster | /videos/Spiny_Lobster_2012.mp4 | rtsp://subcstreams:[email protected]:10554/Spiny_Lobster_2012 | Demo video of a lobster. |
| Swimming Crinoid ROVLive 2014 | /videos/Swimming_Crinoid_ROVLine_2014.mp4 | rtsp://subcstreams:[email protected]:10554/Swimming_Crinoid_ROVLine_2014 | Demo video ROV line from 2014. |
| Dolphins | /videos/Dolphins.mp4 | rtsp://subcstreams:[email protected]:10554/Dolphins | Demo video with Dolphins. |
| Lava Tubes | /videos/Lava_Tubes.mp4 | rtsp://subcstreams:[email protected]:10554/LavaTubes | Demo video with Lava tubes. |
| Acid Horizons | /videos/Acid_Horizons.mp4 | rtsp://subcstreams:[email protected]:10554/AcidHorizons | Demo video with Acid Horizons. |
| UWash Ocean 2020 | /videos/UWash_Ocean_2020.mp4 | rtsp://subcstreams:[email protected]:10554/UWashOcean2020 | Demo video with UWash Ocean from 2020. |
| Shark Egg | /videos/Shark_Egg.mp4 | rtsp://subcstreams:[email protected]:10554/SharkEgg | Demo video with Shark egg. |
| Titantic 2021 | /videos/Titantic_2021.mp4 | rtsp://subcstreams:[email protected]:10554/Titantic2021 | Demo video with Titantic 2021. |
Inside of the docker container, the system is generating a log file which can be view from the Linux console. You can view the log by getting console access to the docker container and then using the cat command see the output.
Steps from Linux Console
sudo docker exec -it rtspserver /bin/shcat rtsp-simple-server.logThis project is not setup with docker compose at this time. But you can stop and restart the docker container from the console.
To do so, follow the steps below..
Steps
sudo docker stop rtspserversudo docker rm rtspserversudo docker run --name rtspserver -p 10554:10554/tcp -d subc/aler9_rtsp_vod_server:dev or sudo docker run --name rtspserver -p 10554:10554/tcp -d subc/aler9_rtsp_vod_server:live to startup the server again.You can also remove all images that are stopped from the system by using the command
sudo docker system prune -a -f.
| Date | Version | Description |
|---|---|---|
| 2022-May | 1.0 | Init version |
| 2022-Aug-08 | 1.1 | Added new videos at the request of sales. Videos added are Shark_Egg.mp4, Lava_Tubes_HD.mp4, UWash_Ocean_2020_HD.mp4, Acid_Horizons_HD.mp4 and Titantic_2021_HD.mp4. |
| 2022-Aug-22 | 1.2 | New versions of Greenland Shark created. 720p and SD version are now available. |
| 2022-Aug-22 | 1.3 | Ocean seafloor video's added. |
Content type
Image
Digest
sha256:4d1c6d289…
Size
2.2 GB
Last updated
4 months ago
docker pull subc/aler9_rtsp_vod_server:live