Coder Social home page Coder Social logo

bluenviron / mediamtx Goto Github PK

View Code? Open in Web Editor NEW
10.1K 133.0 1.3K 7.48 MB

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.

License: MIT License

Makefile 1.22% Go 91.36% Dockerfile 0.22% Shell 0.24% C 3.11% C++ 1.44% HTML 2.41%
rtsp rtp rtcp streaming golang go rtsp-server rtsp-proxy rtmp rtmp-server

mediamtx's People

Contributors

aler9 avatar andrew-ld avatar benlocal avatar dantheman827 avatar dbason avatar dependabot[bot] avatar dorinclisu avatar github-actions[bot] avatar jordy84 avatar jsbohnert avatar lionelnicolas avatar mattlamb99 avatar nerdbaggy avatar ph0b avatar ramonrdl avatar rfscheidt avatar rgl avatar rouquinblanc avatar rse avatar sainak avatar sijmenhuizenga avatar sp321 avatar swhig avatar tmatth avatar tnyeanderson avatar udatny avatar vgavro avatar volodymyr-borodin avatar vvitkovsky avatar xieliwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mediamtx's Issues

Is on-demand supported?

I'm running the server on Win10 with ffmpeg as publisher.

Is there a way to support on-demand, i.e. the server/publisher starts only when a player connects?

Feature Request: Publish ip whitelist

Can we have something similar to a --publish-whitelist which can take a list of ips.

ex: --publish-whitelist=127.0.0.1 will let me only publish from the computer that's hosting the server

RTSP proxy fails to connfig - DESCRIBE invalid request / empty header value

Hey, I'm getting two different error when I test with two different IP cameras.

The first camera (test1) is an Amcrest unit, the second (test2) is a no-name IP camera. Both camera paths work fine in ffmpeg and VLC for playback. It seems like the rtsp-simple-server is making some requests that these units don't support and failing hard instead of continuing?

Let me know if I can provide any more debug info, is there a more verbose logging mode or anything?

Output from console:

$ ./rtsp-simple-server test.yaml
2020/07/14 19:31:35 [0/0/0] rtsp-simple-server v0.9.1
2020/07/14 19:31:35 [0/0/0] [UDP/RTP listener] opened on :8000
2020/07/14 19:31:35 [0/0/0] [UDP/RTCP listener] opened on :8001
2020/07/14 19:31:35 [0/0/0] [TCP listener] opened on :8554
2020/07/14 19:31:35 [0/0/0] [streamer test1] initializing with protocol udp
2020/07/14 19:31:35 [0/0/0] [streamer test2] initializing with protocol udp
2020/07/14 19:31:35 [0/0/0] [streamer test2] ERR: DESCRIBE: bad status code: 551 (Invalid Method)
2020/07/14 19:31:35 [0/0/0] [streamer test1] ERR: empty header value
2020/07/14 19:31:40 [0/0/0] [streamer test2] initializing with protocol udp
2020/07/14 19:31:40 [0/0/0] [streamer test2] ERR: DESCRIBE: bad status code: 551 (Invalid Method)
2020/07/14 19:31:40 [0/0/0] [streamer test1] initializing with protocol udp
2020/07/14 19:31:40 [0/0/0] [streamer test1] ERR: empty header value
2020/07/14 19:31:45 [0/0/0] [streamer test2] initializing with protocol udp
2020/07/14 19:31:45 [0/0/0] [streamer test2] ERR: DESCRIBE: bad status code: 551 (Invalid Method)
2020/07/14 19:31:45 [0/0/0] [streamer test1] initializing with protocol udp
2020/07/14 19:31:46 [0/0/0] [streamer test1] ERR: empty header value

Config file:

paths:
  test1:
    source: rtsp://user:pass@camera1:554/cam/realmonitor?channel=1&subtype=0
    sourceProtocol: tcp
  test2:
    source: rtsp://user:pass@camera2:554
    sourceProtocol: tcp

24 hour time incorrect

Hi,

I have noticed a minor issue; that the running log of connected users is reporting 24hr time but it seems to be round the wrong way.

The following connection was made at 09:48:52 (AM)
2020/07/13 21:48:52 [3/2/0] [client 123.xxx.xxx.x:58957] PLAY

The issue is also apparent in the afternoon/evening when the log file reports the connection as being in the morning.

Tested with v0.9.1

As a side note, I really appreciate this project and how well it is maintained! Consider setting up sponsorship or posting a link so we can buy you a coffee/beer.

Hey, had a few questions around the publishing a stream?

You use ffmpeg as your publisher, I've been looking to find a way to publish images as my streams. Basically I would want to have a process where I stream video via a file or network and capture those frames and do some processing and publish them on the server. Could you please let me know how to achieve this?

Blur when publish streams via UDP

I use ffmpeg to grab the screen and use rtsp to push the stream. When I use TCP, the video is normal, but when using UDP, the received picture will have mosaic and blur

can it put into docker?

I download linux_amd64๏ผŒ then use Dockerfile build a image๏ผŒthen run it๏ผŒI can normally push stream๏ผŒbut when I use vlc to receive stream, it always auto disconnectedใ€‚But I can use windows_amd64 and powershell normallyใ€‚May there will be a docker image?
image

Question: How to change the mount point?

Which version are you using?

rtsp-simple-server_v0.9.3_linux_arm64.tar.gz

Describe the problem

I want to change "mystream" mount point, with some other name if possible.
How to do that?

Service for Debian buster on arm64

Which version are you using?

rtsp-simple-server_v0.9.3_linux_arm64.tar.gz

Here my service for debian10 buster (armbian) that works fine

wget https://github.com/aler9/rtsp-simple-server/releases/download/v0.9.4/rtsp-simple-server_v0.9.4_linux_arm64.tar.gz
tar zxvf rtsp-simple-server_v0.9.4_linux_arm64.tar.gz
install rtsp-simple-server /usr/local/bin/
cp rtsp-simple-server.yml /usr/local/etc/

now create a service with

mcedit /etc/systemd/system/rtsp-simple-server.service

and write:

[Unit]
Description=RTSP Simple Server service on local port 8554
After=network.target

[Service]
User=root
WorkingDirectory=/
ExecStart=/usr/local/bin/rtsp-simple-server /usr/local/etc/rtsp-simple-server.yml
TimeoutStopSec=10

[Install]
WantedBy=multi-user.target

then

systemctl enable rtsp-simple-server.service
systemctl start rtsp-simple-server.service

I hope to help

I will open some questions in other tickets

regards
MaX

ERR: unable to setup authentication: unable to parse key-value

Getting the following issue. I am running using the Docker image and the following yml file

proxied: source: rtsp://user:[email protected]:554/onvif1 # if the source is an RTSP url, this is the protocol that will be used to pull the stream #sourceProtocol: udp

The stream works in ZoneMinder and VLC using the exact same URL.

2020/07/03 13:13:13 [0/0/0] rtsp-simple-server v0.8.1 2020/07/03 13:13:13 [0/0/0] [UDP/RTP listener] opened on :8000 2020/07/03 13:13:13 [0/0/0] [UDP/RTCP listener] opened on :8001 2020/07/03 13:13:13 [0/0/0] [TCP listener] opened on :8554 2020/07/03 13:13:13 [0/0/0] [streamer proxied] initializing with protocol udp 2020/07/03 13:13:14 [0/0/0] [streamer proxied] ERR: unable to setup authentication: unable to parse key-value (,nonce="c7ebda6058fed5422476c9d8667376fb")

Question: Is possible to relay automatically, the stream to youtube/twich/facebook/other rtsp server?

Which version are you using?

rtsp-simple-server_v0.9.3_linux_arm64.tar.gz

Describe the problem

I need to know if it is possible to relay the current stream to other rtsp servers

Imagine that I am using rtsp-simple-server on my server with obs but my line cannot support more than 100 connections at a time, and I want to send users on youtube for example (sent the link in my telegram group for example) and thus reserving my line only for some local users, such as local cable tv.

Can it be done directly from rtps-simple-server? how?

regards
MaX

ERR: not all tracks have been setup

Which version are you using?

rtsp-simple-server v0.9.4

Describe the problem

I could stream a mp4 video in vlc player but after getting connected i am receiving the error message "ERR: not all tracks have been setup" while running the rtsp-simple-server.exe file.Any help!!

ERR: invalid SDP

When streaming I receive this message

ERR: invalid SDP: sdp: invalid syntax `m=`

Followed by a disconnect. This is probably client specific as it works from ffmpeg just not from my ios app.

It may be related to #24 #8 and in that issue you requested a wireshark dump. So I attach it here:

stream_dump.pcap.zip

p.s. sorry its a zip, gitub seems to not like the pcap extention.

Enhancement: Enforce authentication mode

RTSP devices will usually have a field to force the authentication mode it accepts.
Currently the rtsp-simple-server only mode is "encrypted & uncencrypted" aka digest & basic

image

ERR: transport header does not have valid client ports ([RTP/AVP/UDP;unicast;client_port=0-0;mode=RECORD])

Which version are you using?

v0.9.4

Describe the problem

Hi there,
I'm using your rtsp-simple-server package. It's very great and helpful. I'm using good with ffmpeg. But ffmpeg uses a lot of CPU. So I switch to use gstreamer as a publish stream client. And I got this problem:
ERR: transport header does not have valid client ports ([RTP/AVP/UDP;unicast;client_port=0-0;mode=RECORD])
Here is more details in my case.
This is the log from server side:

2020/08/01 04:24:41 [1/0/0] [client ] connected
2020/08/01 04:24:41 [0/0/0] [client ] disconnected
2020/08/01 04:33:53 [1/0/0] [client ] connected
2020/08/01 04:33:53 [1/0/0] [client ] OPTIONS
2020/08/01 04:33:54 [1/0/0] [client ] ANNOUNCE
2020/08/01 04:33:54 [1/0/0] [client ] SETUP
2020/08/01 04:33:54 [1/0/0] [client ] ERR: transport header does not have valid client ports ([RTP/AVP/UDP;unicast;client_port=0-0;mode=RECORD])
2020/08/01 04:33:54 [0/0/0] [client ] disconnected
2020/08/01 04:33:54 [1/0/0] [client ] connected
2020/08/01 04:33:54 [1/0/0] [client ] OPTIONS
2020/08/01 04:33:55 [0/0/0] [client ] disconnected

With publish stream side, I run: gst-launch-1.0 imxv4l2src device=/dev/video0 ! "video/x-raw, width=1280, height=720, framerate=(fraction)30/1" ! rtspclientsink location=rtsp://192.168.1.5:8999/vnet/id-stream=1 sync=false
And this is the log:

====== IMXV4L2SRC: 4.1.6 build on Jul 31 2020 16:13:16. ======
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Progress: (open) Opening Stream
Progress: (connect) Connecting to rtsp://192.168.1.5:8999/vnet/id-stream=1
Progress: (open) Retrieving server options
Progress: (open) Opened Stream
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending RECORD request
Progress: (record) Sending server stream info
Progress: (request) SETUP stream 0
ERROR: from element /GstPipeline:pipeline0/GstRTSPClientSink:rtspclientsink0: Could not write to resource.
Additional debug info:
../../../gst-rtsp-server-1.8.1/gst/rtsp-sink/gstrtspclientsink.c(3952): gst_rtsp_client_sink_setup_streams (): /GstPipeline:pipeline0/GstRTSPClientSink:rtspclientsink0:
Error (400): Bad Request
Execution ended after 0:00:00.720799667
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Can I change client_port manually ? If not, what should I do now to fix this ?
Again, I very like your package.

Logging?

Hey, really like the work you've put it. Super easy and straightforward. I have a question though, is there a way to log the data that outputted to a file or something. I'd like to monitor these interactions. I saw there is a prof setting to monitor performance. Not sure if that's what I'm looking for or not but just dumping the output to a file would suffice.

Thanks for the help!

invalid SDP: failed to decode

I downloaded this IOS app : https://apps.apple.com/us/app/larix-broadcaster/id1042474385
so i can test rtsp-simple-server. But the server output this when i push from the app:

2020/05/13 17:25:55 [RTSP client 192.168.1.4:63659] connected
2020/05/13 17:25:55 [RTSP client 192.168.1.4:63659] OPTIONS
2020/05/13 17:25:56 [RTSP client 192.168.1.4:63659] ANNOUNCE
2020/05/13 17:25:56 [RTSP client 192.168.1.4:63659] ERR: invalid SDP: failed to decode message: DecodeError in section s: origin address not set
2020/05/13 17:25:56 [RTSP client 192.168.1.4:63659] disconnected

The same app is working fine with Wowza Streaming Engine using RTSP.

Panic on connecting client (vlc and ffplay)

Which version are you using?

v0.9.3

Describe the problem

After your bug fix in #41 I am able to connect the publishing client (an ios app). When attempting to play the stream the following error occurs.

2020/07/20 11:52:55 [2/1/0] [client 127.0.0.1:53142] connected
2020/07/20 11:52:55 [2/1/0] [client 127.0.0.1:53142] OPTIONS
2020/07/20 11:52:55 [2/1/0] [client 127.0.0.1:53142] DESCRIBE
2020/07/20 11:52:55 [2/1/0] [client 127.0.0.1:53142] SETUP
2020/07/20 11:52:55 [2/1/0] [client 127.0.0.1:53142] SETUP
2020/07/20 11:52:55 [2/1/0] [client 127.0.0.1:53142] PLAY
2020/07/20 11:52:55 [2/1/1] [client 127.0.0.1:53142] is receiving on path 'test', 2 tracks via udp
panic: runtime error: slice bounds out of range [:12846] with capacity 2048

goroutine 8 [running]:
main.(*serverUdpListener).write(...)
	/s/server-udpl.go:96
main.(*program).forwardFrame(0xc00022a070, 0xc000292158, 0x4, 0x0, 0x0, 0xc000300000, 0x322e, 0x80000)
	/s/main.go:525 +0x8e4
main.(*program).run(0xc00022a070)
	/s/main.go:408 +0x1e8
created by main.newProgram
	/s/main.go:264 +0xbb1

Please let me know if you need further debugging information

v0.8.5 using TCP results in i/o timeout and re-connect after a minute

I'm running v0.8.5 connecting to v4l2rtspserver cameras. I observe persistent timeouts and re-connects every minute when using TCP. Using UDP works fine.

protocols: [udp, tcp]
rtspPort: 8554
rtpPort: 8000
rtcpPort: 8001
readTimeout: 5s
writeTimeout: 5s
preScript:
postScript:
pprof: false
paths:
all:
source: record
sourceProtocol: udp
publishUser:
publishPass:
publishIps: []
readUser:
readPass:
readIps: []
cam10:
source: rtsp://192.168.14.87:8554/unicast
sourceProtocol: tcp

2020/07/09 21:59:07 [1/0/1] [client 192.168.14.87:40482] ERR: read tcp 172.16.6.16:8554->192.168.14.87:40482: use of closed network connection
2020/07/09 21:59:07 [0/0/0] [client 192.168.14.87:40482] disconnected
2020/07/09 21:59:12 [0/0/0] [streamer cam10] initializing with protocol tcp
2020/07/09 21:59:12 [0/1/0] [streamer cam10] ready

2020/07/09 22:00:22 [0/1/0] [streamer cam10] ERR: read tcp 172.16.6.16:48158->192.168.14.99:8554: i/o timeout
2020/07/09 22:00:22 [0/0/0] [streamer cam10] not ready
2020/07/09 22:00:27 [0/0/0] [streamer cam10] initializing with protocol tcp
2020/07/09 22:00:27 [0/1/0] [streamer cam10] ready

2020/07/09 22:01:37 [0/1/0] [streamer cam10] ERR: read tcp 172.16.6.16:48686->192.168.14.99:8554: i/o timeout
2020/07/09 22:01:37 [0/0/0] [streamer cam10] not ready
2020/07/09 22:01:42 [0/0/0] [streamer cam10] initializing with protocol tcp
2020/07/09 22:01:42 [0/1/0] [streamer cam10] ready

2020/07/09 22:02:52 [0/1/0] [streamer cam10] ERR: read tcp 172.16.6.16:49214->192.168.14.99:8554: i/o timeout
2020/07/09 22:02:52 [0/0/0] [streamer cam10] not ready
2020/07/09 22:02:57 [0/0/0] [streamer cam10] initializing with protocol tcp
2020/07/09 22:02:57 [0/1/0] [streamer cam10] ready

RTSPbee for rtsp-simple-server stress testing

Hi,

I am attempting to use Red5's RTSPbee test tool with rtsp-simple-server in order to load test the server. The RTSPbee tool allows the user to send multiple subscription/play requests to the server in order to monitor health.

While the tool is obviously designed for use with Red5's server, I am hopeful that I can get it running with rtsp-simple-server.

I am running into an error when Rtspbee tries to subscribe to my stream, the rtsp-simple-server returns:
"ERR: transport header does not contain unicast"

root@audioserver1:~# ./rtsp-simple-server
2020/05/17 21:55:05 rtsp-simple-server v0.6.1
2020/05/17 21:55:05 [UDP/RTP listener] opened on :8000
2020/05/17 21:55:05 [UDP/RTCP listener] opened on :8001
2020/05/17 21:55:05 [TCP listener] opened on :8554
2020/05/17 21:55:10 [RTSP client xxx.xxx.48.1:51080] connected
2020/05/17 21:55:10 [RTSP client xxx.xxx.48.1:51080] OPTIONS
2020/05/17 21:55:10 [RTSP client xxx.xxx.48.1:51080] ANNOUNCE
2020/05/17 21:55:10 [RTSP client xxx.xxx.48.1:51080] SETUP
2020/05/17 21:55:10 [RTSP client xxx.xxx.48.1:51080] RECORD
2020/05/17 21:55:10 [RTSP client xxx.xxx.48.1:51080] is publishing on path 'mystream', 1 track via tcp

When I try RTSPbee subscription script

2020/05/17 21:58:59 [RTSP client xxx.xxx.48.1:50641] connected
2020/05/17 21:58:59 [RTSP client xxx.xxx.48.1:50641] OPTIONS
2020/05/17 21:58:59 [RTSP client xxx.xxx.48.1:50641] DESCRIBE
2020/05/17 21:58:59 [RTSP client xxx.xxx.48.1:50641] SETUP
2020/05/17 21:58:59 [RTSP client xxx.xxx.48.1:50641] ERR: transport header does not contain unicast
2020/05/17 21:58:59 [RTSP client xxx.xxx.48.1:50641] disconnected

I am using rtsp-simple-server v0.6.1 and RTSPbee v4.2.1

It would be great to integrate this tool in order to load/stress test rtsp-simple-server.
If you have any ideas on how to address this header issue either with rtspbee or the server, please let me know.

Thanks.

Release management

What about doing a release for more than one fix, feature or even commit? ๐Ÿ™„

What is the purpose / intention of having 3 or more releases on one day? ๐Ÿ˜‰

ipv6 break

Thanks for this software. I've been trying it out for a couple days with great success.

Sometimes when I connect using zeroconf, ipv6 is used to establish a connection but fails to stream:

rtsp-simple-server --rtsp-port=554
2020/05/01 05:34:40 rtsp-simple-server v0.5.3
2020/05/01 05:34:40 [UDP/RTP listener] opened on :8000
2020/05/01 05:34:40 [UDP/RTCP listener] opened on :8001
2020/05/01 05:34:40 [TCP listener] opened on :554
2020/05/01 05:35:07 [RTSP client 127.0.0.1:53242] connected
2020/05/01 05:35:07 [RTSP client 127.0.0.1:53242] OPTIONS
2020/05/01 05:35:07 [RTSP client 127.0.0.1:53242] ANNOUNCE
2020/05/01 05:35:07 [RTSP client 127.0.0.1:53242] SETUP
2020/05/01 05:35:07 [RTSP client 127.0.0.1:53242] RECORD
2020/05/01 05:35:07 [RTSP client 127.0.0.1:53242] is publishing on path 'mystream', 1 track via udp
2020/05/01 05:35:55 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] connected
2020/05/01 05:35:55 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] OPTIONS
2020/05/01 05:35:55 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] DESCRIBE
2020/05/01 05:35:55 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] SETUP
2020/05/01 05:35:55 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] PLAY
2020/05/01 05:35:55 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(string=mystream)th0]:34088] is receiving on path '%!s(int=1)', %!d(string=track) udp via %!s(MISSING)
2020/05/01 05:36:05 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] PAUSE
2020/05/01 05:36:05 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] paused
2020/05/01 05:36:05 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] SETUP
2020/05/01 05:36:05 [RTSP client [fe80::dc4b:a4c9:f63e:e05b&{%!e(string=client want to send tracks with different protocols)}th0]:34088] ERR: %!s(MISSING)
2020/05/01 05:36:05 [RTSP client [fe80::dc4b:a4c9:f63e:e05b%!e(MISSING)th0]:34088] disconnected

Not familiar with Go, else I'd do a PR.
Consider adding an optional address to the port argument:
--rtsp-port=[ADDRESS:]PORT

This could allow binding to ipv4 only and force use a specific interface in multi-homed systems.
"0.0.0.0" would binding to all ipv4 interfaces but no ipv6.

Thanks

Problems when publishing more than 1 stream

Which version are you using?

v0.9.9 & v.0.9.8

Describe the problem

When publishing more than 2 streams with ffmpeg the streams break down after about 20 secs. I tried different setups and double cheked my ffmpeg script. Then i tried v0.9.4 and there i have no problems. So it looks like a problem with the new versions.

service Active: inactive (dead)

I downloaded the arm6l binary from release and put it in raspberry pi 0. I use the server file below to start rasp-simple-server in systemd in. but it always shows inactive. I can use systemctl restart rasp_server to successfully start the service. I did the same thing in raspberry pi 3B and everything is OK.

Anyone can help?

thx

sudo systemctl status rtsp_server
โ— rtsp_server.service - rtsp_server
Loaded: loaded (/etc/systemd/system/rtsp_server.service; disabled; vendor preset: enabled)
Active: inactive (dead)

[Unit]
Description=rtsp_server
After=network.target rc-local.service
[Service]
Restart=always
RestartSec=1s
User=pi
ExecStart=/usr/local/bin/rtsp-simple-server
[Install]
WantedBy=multi-user.target

Feature Request: add option to control compression

Hi,

Currently I'm using rtspatt as my RTSP server for testing purposes, and it's working pretty good. One of the things that I'm missing is an option to control the compression level. Out of the box the rtspatt compression level is a bit too much for my purposes, so I wish to have a simple RTSP server with an option to control the compression level.

Is it possible to add this option?

Thank you :)

Cant debug the code

Which version are you using?

v0.9.8

Describe the problem

When im trying to debug the code I am getting the following error:
.\main.go:37:12: undefined: metricsData
.\main.go:50:10: undefined: client
.\main.go:56:10: undefined: client
.\main.go:64:13: undefined: client
.\main.go:74:11: undefined: client
.\main.go:83:10: undefined: client
.\main.go:90:10: undefined: client
.\main.go:97:10: undefined: client
.\main.go:104:10: undefined: client
.\main.go:111:10: undefined: client
.\main.go:111:10: too many errors

using mod - can run the exe

Question: UDP Socket/Buffer size

Which version are you using?

v0.9.04

Question:

I am trying to run a very low latency audio only server using opus encoded via ffmpeg. Publishing and subscription are both using UDP only. Are you able to provide any insights on the affects of UDP buffer read/write sizes in the go code and what affects raising or lowering this will/could have on latency? I remember you adjusting these in a version a few weeks ago and I think this may have caused my average latency to increase by 20ms or so.

Ideally I would have a number of cloud vm's running to facilitate 1000's of audio only subscribers (split across a number of rtsp-simple-server instances) utilising the proxy functionality.

I'm just interested in your thoughts on optimising UDP buffers/latency if I was to modify and compile the code myself.
Thanks

Errors out when streaming mp4

Commands to recreate

docker run --rm -it -v $PWD/rtsp-simple-server.yml:/rtsp-simple-server.yaml -p 8554:8554 aler9/rtsp-simple-server
shkr@Blade:~/Documents/repos/rtsp_server/rtsp-rtp-stream/data$ ffmpeg -framerate 1 -i /dev/video0 -f rtsp rtsp://127.0.0.1:8554/mystream
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
[video4linux2,v4l2 @ 0x5563f5fd8900] The driver changed the time per frame from 1/1 to 1/10
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 58202.087847, bitrate: 147456 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 147456 kb/s, 10 fps, 10 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
Output #0, rtsp, to 'rtsp://127.0.0.1:8554/mystream':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 200 kb/s, 10 fps, 90k tbn, 10 tbc
    Metadata:
      encoder         : Lavc57.107.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
av_interleaved_write_frame(): Broken pipe00:00:14.60 bitrate=N/A dup=1 drop=0 speed=0.994x    
frame=  151 fps= 10 q=19.5 Lsize=N/A time=00:00:15.00 bitrate=N/A dup=1 drop=0 speed=0.998x    
video:595kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
shkr@Blade:~/Documents/repos/rtsp_server/rtsp-rtp-stream/data$ 
# supported stream protocols (the handshake is always performed with TCP)
protocols: [tcp]
# port of the TCP RTSP listener
rtspPort: 8554
# port of the UDP RTP listener
rtpPort: 8000
# port of the UDP RTCP listener
rtcpPort: 8001
# command to run when a client connects.
# this is terminated with SIGINT when a client disconnects.
runOnConnect:
# timeout of read operations
readTimeout: 5s
# timeout of write operations
writeTimeout: 5s
# time after which a stream is considered dead
streamDeadAfter: 15s
# supported authentication methods
authMethods: [basic, digest]
# enable pprof on port 9999 to monitor performance
pprof: false

# these settings are path-dependent. The settings under the path 'all' are
# applied to all paths that do not match a specific entry.
paths:
  all:
    # source of the stream - this can be:
    # * record -> the stream is provided by a client through the RECORD command (like ffmpeg)
    # * rtsp://original-url -> the stream is pulled from another RTSP server
    source: record
    # if the source is an RTSP url, this is the protocol that will be used to pull the stream
    sourceProtocol: udp

    # username required to publish
    publishUser:
    # password required to publish
    publishPass:
    # IPs or networks (x.x.x.x/24) allowed to publish
    publishIps: []

    # username required to read
    readUser:
    # password required to read
    readPass:
    # IPs or networks (x.x.x.x/24) allowed to read
    readIps: []

    # command to run when a client starts publishing.
    # This is terminated with SIGINT when a client stops publishing.
    runOnPublish:

    # command to run when a clients starts reading.
    # This is terminated with SIGINT when a client stops reading.
    runOnRead:

Please help. Just share instructions on how to push mp4 file as rtsp stream using docker

Enhancement: Allow wildcard paths and reference to path in runOn* calls

If I have ondemand rooms for a conference streaming server, it will be nice if the path can be used as a parameter for the runOnDemand call, which will call a helper script that redirects the correct stream to the server.

For example, the config script may look like this:

paths:
conf*:
source: record
sourceProtocol: udp
runOnDemand: redirectStream.sh $1

So a client connecting via rtsp://example.com/conf1234
Will spawn redirectStream.sh 1234, which redirects the necessary rtsp stream over to the server.

Alternatively, the path can be passed as an environment variable to the script, if trying to parse the parameter identifier might be troublesome.

I'm a beginner at Go, but will try implementing a patch to do this over the week. Opening this issue in case others are potentially working on this.

Weird error

Had the server working fine and recently a specific stream keeps erroring with:

ERR: wrong magic byte (0x54)

sourceOnDemand doesn't appear to work in v0.9.6

Which version are you using?

v0.9.6

Describe the problem

I've set the sourceOnDemand setting to both no and yes but my streams don't start unless someone tries to listen.

This is my config.

protocols: [udp, tcp]
rtspPort: 8554
runOnConnect:
readTimeout: 10s
writeTimeout: 5s
authMethods: [basic, digest]
pprof: false

paths:
  all:
    sourceOnDemand: no
  garage:
    source: rtsp://192.168.1.142/live/ch0
  back:
    source: rtsp://192.168.1.143/stream1
    sourceProtocol: tcp
  porch:
    source: rtsp://192.168.1.120:8554/unicast

sourceOnDemand: no

2020/07/31 08:18:09 [0/0/0] rtsp-simple-server v0.9.6
2020/07/31 08:18:09 [0/0/0] [UDP/RTP listener] opened on :8000
2020/07/31 08:18:09 [0/0/0] [UDP/RTCP listener] opened on :8001
2020/07/31 08:18:09 [0/0/0] [TCP listener] opened on :8554
2020/07/31 08:18:09 [0/0/0] [source garage] started
2020/07/31 08:18:09 [0/0/0] [source garage] connecting
2020/07/31 08:18:09 [0/0/0] [source back] started
2020/07/31 08:18:09 [0/0/0] [source porch] started
2020/07/31 08:18:09 [0/0/0] [source porch] connecting
2020/07/31 08:18:09 [0/0/0] [source back] connecting
2020/07/31 08:18:09 [0/0/0] [source porch] ready
2020/07/31 08:18:09 [0/0/0] [source back] ready
2020/07/31 08:18:10 [0/0/0] [source garage] ready
2020/07/31 08:18:14 [0/0/0] [source garage] stopping since we're not requested anymore
2020/07/31 08:18:14 [0/0/0] [source back] stopping since we're not requested anymore
2020/07/31 08:18:14 [0/0/0] [source porch] stopping since we're not requested anymore
2020/07/31 08:18:14 [0/0/0] [source back] not ready
2020/07/31 08:18:14 [0/0/0] [source porch] not ready
2020/07/31 08:18:14 [0/0/0] [source garage] not ready
2020/07/31 08:18:14 [0/0/0] [source porch] stopped
2020/07/31 08:18:14 [0/0/0] [source garage] stopped
2020/07/31 08:18:14 [0/0/0] [source back] stopped

sourceOnDemand: yes

2020/07/31 08:20:46 [0/0/0] rtsp-simple-server v0.9.6
2020/07/31 08:20:46 [0/0/0] [UDP/RTP listener] opened on :8000
2020/07/31 08:20:46 [0/0/0] [UDP/RTCP listener] opened on :8001
2020/07/31 08:20:46 [0/0/0] [TCP listener] opened on :8554
2020/07/31 08:20:46 [0/0/0] [source porch] started
2020/07/31 08:20:46 [0/0/0] [source porch] connecting
2020/07/31 08:20:46 [0/0/0] [source back] started
2020/07/31 08:20:46 [0/0/0] [source back] connecting
2020/07/31 08:20:46 [0/0/0] [source garage] started
2020/07/31 08:20:46 [0/0/0] [source garage] connecting
2020/07/31 08:20:46 [0/0/0] [source porch] ready
2020/07/31 08:20:46 [0/0/0] [source back] ready
2020/07/31 08:20:47 [0/0/0] [source garage] ready
2020/07/31 08:20:51 [0/0/0] [source garage] stopping since we're not requested anymore
2020/07/31 08:20:51 [0/0/0] [source back] stopping since we're not requested anymore
2020/07/31 08:20:51 [0/0/0] [source porch] stopping since we're not requested anymore
2020/07/31 08:20:51 [0/0/0] [source garage] not ready
2020/07/31 08:20:51 [0/0/0] [source porch] not ready
2020/07/31 08:20:51 [0/0/0] [source back] not ready
2020/07/31 08:20:51 [0/0/0] [source garage] stopped
2020/07/31 08:20:51 [0/0/0] [source back] stopped
2020/07/31 08:20:51 [0/0/0] [source porch] stopped

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.