Ullaakut / RTSPAllTheThings

Deprecated RTSP media server -- Use github.com/aler9/rtsp-simple-server instead.
Apache License 2.0
275 stars 72 forks source link
broadcast camera cctv credentials encoding gstreamer media mediaserver rtsp server stream streaming video

RTSPATT: RTSP All The Things [DEPRECATED]

rtspatt logo

A multipurpose RTSP media server that can simulate RTSP cameras, broadcast RTSP streams, webcams and even create test videos or serve video files.

:warning: :warning: This repository is deprecated, please use rtsp-simple-server instead. :warning: :warning:

See this issue for explanations on why this repository was archived and is no longer maintained.

Dependencies

Usage from the official docker repository

You can create a stream by launching the official docker image: docker run --rm -p 8554:8554 ullaakut/rtspatt

With default options, stream will be available at rtsp://0.0.0.0:8554/live.sdp. You can use override options.

Override options

docker run --rm \
       [-e RTSP_ADDRESS=your_address] \
       [-e RTSP_PORT=your_port] -p your_port:your_port \
       [-e RTSP_ROUTE=your_route] \
       [-e RTSP_USERNAME=your_username] \
       [-e RTSP_PASSWORD=your_password] \
       [-e RTSP_RESOLUTION='your_width'x'your_height'] \
       [-e RTSP_FRAMERATE=your_framerate] \
       [-e INPUT=your_input] \
       [-e ENABLE_TIME_OVERLAY=true|false] \
       [-e RTSP_AUTHENTICATION_METHOD=digest|basic] \
       [-e GST_PIPELINE=your_custom_gstreamer_pipeline] \
       [-e GST_DEBUG=your_debug_level] \
       ullaakut/rtspatt
./rtspatt \
      [-l rtsp_address] \
      [-b rtsp_port] \
      [-r rtsp_route] \
      [-u rtsp_username] \
      [-p rtsp_password] \
      [-s rtsp_resolution] \
      [-f rtsp_framerate] \
      [-i input]
      [-t] \
      [-d] \
      [-g gstreamer_pipeline] \

To have GStreamer debug while using the binary, simply run export GST_DEBUG=your_debug_level before using RTSP All The Things.

All of these environment variables and command line arguments override the default parameters:

Examples

animation rtspatt vlc

Serve video using basic auth on rtsp:admin:test@//0.0.0.0:8554/live.sdp

docker run --rm -e RTSP_USERNAME=admin -e RTSP_PASSWORD=test -p 8554:8554 ullaakut/rtspatt

Serve video using digest auth on rtsp:admin:test@//0.0.0.0:8554/live.sdp

docker run --rm -e RTSP_AUTHENTICATION_METHOD=digest -e RTSP_USERNAME=admin -e RTSP_PASSWORD=test -p 8554:8554 ullaakut/rtspatt

Launch an RTSP stream on rtsp://0.0.0.0:8554/live.sdp with a snow pattern and a resolution of 960x600 pixels:

docker run --rm -e INPUT="pattern:snow" -e RTSP_RESOLUTION=960x600 -p 8554:8554 ullaakut/rtspatt or ./rtspatt -i pattern:snow -s 960x600

Broadcast a camera's stream and change its framerate to 12 frames per second:

docker run --rm -e INPUT="rtsp://root:root@camera_ip:554/live.sdp" -e RTSP_FRAMERATE=12 -p 8554:8554 ullaakut/rtspatt or ./rtspatt -i rtsp://root:root@camera_ip:554/live.sdp -f 12

Broadcast a video stream from a connected device:

docker run --rm -e INPUT="/dev/video0" --device=/dev/video0:/dev/video0 -p 8554:8554 ullaakut/rtspatt

Serve a video file on a specific address and route:

docker run --rm -e INPUT="/tmp/video.avi" -e RTSP_ADDRESS=172.100.100.12 -e RTSP_PORT=18554 -v "/path/to/your/video:/tmp/video.avi" -p 18554:18554 ullaakut/rtspatt or ./rtspatt -i /tmp/video.avi -l 172.100.100.12 -b 18554

Serve am H264 video file without transcoding:

docker run --rm -e INPUT="/tmp/video.mp4" -e RTSP_PORT=18554 -e GST_PIPELINE="filesrc location=/tmp/video.mp4 ! qtdemux ! video/x-h264 ! rtph264pay pt=96 name=pay0" -v "/path/to/your/video:/tmp/video.mp4" -p 18554:18554 ullaakut/rtspatt

Build

You can modify RTSPATT and create your own docker image. We use the builder pattern, so you can just modify the sources and run docker build -t rstpatt . to re-compile the sources and rebuild the image.

Once it's done, you can launch RTSPATT with: docker run --rm -p 8554:8554 rtspatt or ./rtspatt.

With default options, stream will be available at rtsp://0.0.0.0:8554/live.sdp. You can use override options.

Patterns

Here is the list of patterns you can use

Ball Bar Checkers
Circular Colors Gamut
Gradient Pinwheel SMPTE
Snow Spokes

FAQ

Does it stream over TCP, UDP or HTTP?

Currently it only streams over TCP.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.