init
This commit is contained in:
commit
3068f4bfd2
8 changed files with 310 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
storage/
|
11
README.md
Normal file
11
README.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
1. wget https://github.com/aler9/rtsp-simple-server/releases/download/v0.16.0/rtsp-simple-server_v0.16.0_linux_amd64.tar.gz
|
||||
|
||||
2. tar -xzvf rtsp-simple-server_v0.16.0_linux_amd64.tar.gz
|
||||
|
||||
3. sudo RTSP_RTSPADDRESS=localhost:554 ./rtsp-simple-server
|
||||
|
||||
4. ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 -f rtsp -rtsp_transport tcp rtsp://localhost:554/mystream
|
||||
|
||||
# Get /dev/videoX devices:
|
||||
v4l2-ctl --list-devices
|
4
config/.gitignore
vendored
Normal file
4
config/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
/*
|
||||
|
||||
!.gitignore
|
||||
!config.yaml
|
71
config/config.yaml
Normal file
71
config/config.yaml
Normal file
|
@ -0,0 +1,71 @@
|
|||
mqtt:
|
||||
enabled: false
|
||||
|
||||
#ffmpeg:
|
||||
# hwaccel_args: preset-vaapi
|
||||
|
||||
record:
|
||||
enabled: true
|
||||
retain:
|
||||
days: 7
|
||||
mode: motion
|
||||
alerts:
|
||||
retain:
|
||||
days: 30
|
||||
detections:
|
||||
retain:
|
||||
days: 30
|
||||
snapshots:
|
||||
enabled: true
|
||||
retain:
|
||||
default: 30
|
||||
|
||||
cameras:
|
||||
good_camera: # <--- this will be changed to your actual camera later
|
||||
enabled: true
|
||||
detect:
|
||||
width: 640
|
||||
height: 480
|
||||
fps: 24
|
||||
ffmpeg:
|
||||
inputs:
|
||||
- path: rtsp://localhost:554/mystream
|
||||
roles:
|
||||
- detect
|
||||
motion:
|
||||
mask:
|
||||
- 0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432
|
||||
|
||||
threshold: 30
|
||||
contour_area: 10
|
||||
improve_contrast: true
|
||||
shit_camera: # <--- this will be changed to your actual camera later
|
||||
enabled: true
|
||||
detect:
|
||||
width: 640
|
||||
height: 480
|
||||
fps: 24
|
||||
ffmpeg:
|
||||
inputs:
|
||||
- path: rtsp://localhost:554/mystream2
|
||||
roles:
|
||||
- detect
|
||||
motion:
|
||||
mask:
|
||||
- 0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432
|
||||
|
||||
shit_camera2: # <--- this will be changed to your actual camera later
|
||||
enabled: true
|
||||
detect:
|
||||
width: 640
|
||||
height: 480
|
||||
fps: 24
|
||||
ffmpeg:
|
||||
inputs:
|
||||
- path: rtsp://localhost:554/mystream3
|
||||
roles:
|
||||
- detect
|
||||
motion:
|
||||
mask:
|
||||
- 0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432
|
||||
version: 0.15-1
|
16
docker-compose.yaml
Normal file
16
docker-compose.yaml
Normal file
|
@ -0,0 +1,16 @@
|
|||
services:
|
||||
frigate:
|
||||
container_name: frigate
|
||||
restart: always
|
||||
image: ghcr.io/blakeblackshear/frigate:stable
|
||||
volumes:
|
||||
- ./config:/config
|
||||
- ./storage:/media/frigate
|
||||
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
|
||||
target: /tmp/cache
|
||||
tmpfs:
|
||||
size: 1000000000
|
||||
ports:
|
||||
- "5000:5000"
|
||||
- "8554:8554" # RTSP feeds
|
||||
network_mode: host
|
BIN
simple-rtsp/rtsp-simple-server
Executable file
BIN
simple-rtsp/rtsp-simple-server
Executable file
Binary file not shown.
207
simple-rtsp/rtsp-simple-server.yml
Normal file
207
simple-rtsp/rtsp-simple-server.yml
Normal file
|
@ -0,0 +1,207 @@
|
|||
|
||||
###############################################
|
||||
# General options
|
||||
|
||||
# sets the verbosity of the program; available values are "warn", "info", "debug".
|
||||
logLevel: info
|
||||
# destinations of log messages; available values are "stdout", "file" and "syslog".
|
||||
logDestinations: [stdout]
|
||||
# if "file" is in logDestinations, this is the file which will receive the logs.
|
||||
logFile: rtsp-simple-server.log
|
||||
|
||||
# timeout of read operations.
|
||||
readTimeout: 10s
|
||||
# timeout of write operations.
|
||||
writeTimeout: 10s
|
||||
# number of read buffers.
|
||||
# a higher number allows a higher throughput,
|
||||
# a lower number allows to save RAM.
|
||||
readBufferCount: 512
|
||||
|
||||
# enable Prometheus-compatible metrics.
|
||||
metrics: no
|
||||
# address of the metrics listener.
|
||||
metricsAddress: :9998
|
||||
|
||||
# enable pprof-compatible endpoint to monitor performances.
|
||||
pprof: no
|
||||
# address of the pprof listener.
|
||||
pprofAddress: :9999
|
||||
|
||||
# command to run when a client connects to the server.
|
||||
# this is terminated with SIGINT when a client disconnects from the server.
|
||||
# the server port is available in the RTSP_PORT variable.
|
||||
runOnConnect:
|
||||
# the restart parameter allows to restart the command if it exits suddenly.
|
||||
runOnConnectRestart: no
|
||||
|
||||
###############################################
|
||||
# RTSP options
|
||||
|
||||
# disable support for the RTSP protocol.
|
||||
rtspDisable: no
|
||||
# supported RTSP stream protocols.
|
||||
# UDP is the most performant, but can cause problems if there's a NAT between
|
||||
# server and clients, and doesn't support encryption.
|
||||
# TCP is the most versatile, and does support encryption.
|
||||
# The handshake is always performed with TCP.
|
||||
protocols: [udp, tcp]
|
||||
# encrypt handshake and TCP streams with TLS (RTSPS).
|
||||
# available values are "no", "strict", "optional".
|
||||
encryption: no
|
||||
# address of the TCP/RTSP listener. This is used only if encryption is "no" or "optional".
|
||||
rtspAddress: :8554
|
||||
# address of the TCP/TLS/RTSPS listener. This is used only if encryption is "strict" or "optional".
|
||||
rtspsAddress: :8555
|
||||
# address of the UDP/RTP listener. This is used only if "udp" is in protocols.
|
||||
rtpAddress: :8000
|
||||
# address of the UDP/RTCP listener. This is used only if "udp" is in protocols.
|
||||
rtcpAddress: :8001
|
||||
# path to the server key. This is used only if encryption is "strict" or "optional".
|
||||
# this can be generated with:
|
||||
# openssl genrsa -out server.key 2048
|
||||
# openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
|
||||
serverKey: server.key
|
||||
# path to the server certificate. This is used only if encryption is "strict" or "optional".
|
||||
serverCert: server.crt
|
||||
# authentication methods.
|
||||
authMethods: [basic, digest]
|
||||
# read buffer size.
|
||||
# this doesn't influence throughput and shouldn't be touched unless the server
|
||||
# reports errors about the buffer size.
|
||||
readBufferSize: 2048
|
||||
|
||||
###############################################
|
||||
# RTMP options
|
||||
|
||||
# disable support for the RTMP protocol.
|
||||
rtmpDisable: no
|
||||
# address of the RTMP listener.
|
||||
rtmpAddress: :1935
|
||||
|
||||
###############################################
|
||||
# HLS options
|
||||
|
||||
# disable support for the HLS protocol.
|
||||
hlsDisable: no
|
||||
# address of the HLS listener.
|
||||
hlsAddress: :8888
|
||||
# number of HLS segments to generate.
|
||||
# increasing segments allows more buffering,
|
||||
# decreasing segments decrease latency.
|
||||
hlsSegmentCount: 3
|
||||
# minimum duration of each segment.
|
||||
# the real segment duration is also influenced by the interval of IDR frames
|
||||
# (since the server edit the segment duration to include at least one IDR frame).
|
||||
hlsSegmentDuration: 1s
|
||||
|
||||
###############################################
|
||||
# Path options
|
||||
|
||||
# these settings are path-dependent.
|
||||
# it's possible to use regular expressions by using a tilde as prefix.
|
||||
# for example, "~^(test1|test2)$" will match both "test1" and "test2".
|
||||
# for example, "~^prefix" will match all paths that start with "prefix".
|
||||
# the settings under the path "all" are applied to all paths that do not match
|
||||
# another entry.
|
||||
paths:
|
||||
all:
|
||||
# source of the stream - this can be:
|
||||
# * record -> the stream is published by a RTSP or RTMP client
|
||||
# * rtsp://existing-url -> the stream is pulled from another RTSP server
|
||||
# * rtsps://existing-url -> the stream is pulled from another RTSP server, with RTSPS
|
||||
# * rtmp://existing-url -> the stream is pulled from a RTMP server
|
||||
# * redirect -> the stream is provided by another path or server
|
||||
source: record
|
||||
|
||||
# if the source is an RTSP or RTSPS URL, this is the protocol that will be used to
|
||||
# pull the stream. available options are "automatic", "udp", "tcp".
|
||||
# the tcp protocol can help to overcome the error "no UDP packets received recently".
|
||||
sourceProtocol: automatic
|
||||
|
||||
# if the source is an RTSPS URL, the fingerprint of the certificate of the source
|
||||
# must be provided in order to prevent man-in-the-middle attacks.
|
||||
# it can be obtained from the source by running:
|
||||
# openssl s_client -connect source_ip:source_port </dev/null 2>/dev/null | sed -n '/BEGIN/,/END/p' > server.crt
|
||||
# openssl x509 -in server.crt -noout -fingerprint -sha256 | cut -d "=" -f2 | tr -d ':'
|
||||
sourceFingerprint:
|
||||
|
||||
# if the source is an RTSP or RTMP URL, it will be pulled only when at least
|
||||
# one reader is connected, saving bandwidth.
|
||||
sourceOnDemand: no
|
||||
# if sourceOnDemand is "yes", readers will be put on hold until the source is
|
||||
# ready or until this amount of time has passed.
|
||||
sourceOnDemandStartTimeout: 10s
|
||||
# if sourceOnDemand is "yes", the source will be closed when there are no
|
||||
# readers connected and this amount of time has passed.
|
||||
sourceOnDemandCloseAfter: 10s
|
||||
|
||||
# if the source is "redirect", this is the RTSP URL which clients will be
|
||||
# redirected to.
|
||||
sourceRedirect:
|
||||
|
||||
# if the source is "record" and a client is publishing, do not allow another
|
||||
# client to disconnect the former and publish in its place.
|
||||
disablePublisherOverride: no
|
||||
|
||||
# if the source is "record" and no one is publishing, redirect readers to this
|
||||
# path. It can be can be a relative path (i.e. /otherstream) or an absolute RTSP URL.
|
||||
fallback:
|
||||
|
||||
# username required to publish.
|
||||
# sha256-hashed values can be inserted with the "sha256:" prefix.
|
||||
publishUser:
|
||||
# password required to publish.
|
||||
# sha256-hashed values can be inserted with the "sha256:" prefix.
|
||||
publishPass:
|
||||
# ips or networks (x.x.x.x/24) allowed to publish.
|
||||
publishIps: []
|
||||
|
||||
# username required to read.
|
||||
# sha256-hashed values can be inserted with the "sha256:" prefix.
|
||||
readUser:
|
||||
# password required to read.
|
||||
# sha256-hashed values can be inserted with the "sha256:" prefix.
|
||||
readPass:
|
||||
# ips or networks (x.x.x.x/24) allowed to read.
|
||||
readIps: []
|
||||
|
||||
# command to run when this path is initialized.
|
||||
# this can be used to publish a stream and keep it always opened.
|
||||
# this is terminated with SIGINT when the program closes.
|
||||
# the path name is available in the RTSP_PATH variable.
|
||||
# the server port is available in the RTSP_PORT variable.
|
||||
runOnInit:
|
||||
# the restart parameter allows to restart the command if it exits suddenly.
|
||||
runOnInitRestart: no
|
||||
|
||||
# command to run when this path is requested.
|
||||
# this can be used to publish a stream on demand.
|
||||
# this is terminated with SIGINT when the path is not requested anymore.
|
||||
# the path name is available in the RTSP_PATH variable.
|
||||
# the server port is available in the RTSP_PORT variable.
|
||||
runOnDemand:
|
||||
# the restart parameter allows to restart the command if it exits suddenly.
|
||||
runOnDemandRestart: no
|
||||
# readers will be put on hold until the runOnDemand command starts publishing
|
||||
# or until this amount of time has passed.
|
||||
runOnDemandStartTimeout: 10s
|
||||
# the runOnDemand command will be closed when there are no
|
||||
# readers connected and this amount of time has passed.
|
||||
runOnDemandCloseAfter: 10s
|
||||
|
||||
# command to run when a client starts publishing.
|
||||
# this is terminated with SIGINT when a client stops publishing.
|
||||
# the path name is available in the RTSP_PATH variable.
|
||||
# the server port is available in the RTSP_PORT variable.
|
||||
runOnPublish:
|
||||
# the restart parameter allows to restart the command if it exits suddenly.
|
||||
runOnPublishRestart: no
|
||||
|
||||
# command to run when a clients starts reading.
|
||||
# this is terminated with SIGINT when a client stops reading.
|
||||
# the path name is available in the RTSP_PATH variable.
|
||||
# the server port is available in the RTSP_PORT variable.
|
||||
runOnRead:
|
||||
# the restart parameter allows to restart the command if it exits suddenly.
|
||||
runOnReadRestart: no
|
BIN
simple-rtsp/rtsp-simple-server_v0.16.0_linux_amd64.tar.gz
Normal file
BIN
simple-rtsp/rtsp-simple-server_v0.16.0_linux_amd64.tar.gz
Normal file
Binary file not shown.
Loading…
Reference in a new issue