bluenviron / mediamtx

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.
MIT License
10.69k stars 1.39k forks source link

Can't read RTMP source: not enough bytes / Can I push a stream via SRT? #3401

Open tomasz-lasko opened 1 month ago

tomasz-lasko commented 1 month ago

Which version are you using?

v1.8.2

Which operating system are you using?

Run on OpenWRT without problems except this one.

Describe the issue

  1. mediamtx can't read RTMP, because of error [RTMP source] not enough bytes

This is a stream that I have been using for years with all normal RTMP clients (VLC, OBS, vMix, ...) and it works just fine.

  1. By the way a question: can I somehow make mediamtx push by itself that stream via SRT to a remote SRT listener? If yes then how

Describe how to replicate the issue

Don't have nor use ffmpeg, but just run MediaMTX with the following config (based on sample mediamtx.yml, downloaded from releases, just added these three lines):

paths:
  src_cam:
    source: rtmp://server/app/stream

And then I have the problem. But for exampel I don't have a problem if I put an RTSP source to some other camera, so mediamtx pulls it, and then it connect from VLC to mediamtx via SRT and can read it (but it would be nice to make mediamtx push it via SRT to somewhere)

Did you attach the server logs?

Log level debug:

2024/05/27 17:33:15 INF MediaMTX v1.8.2
2024/05/27 17:33:15 INF configuration loaded from mediamtx.yml
2024/05/27 17:33:15 DEB [path src_cam] created
2024/05/27 17:33:15 DEB path manager created
2024/05/27 17:33:15 INF [path src_cam] [RTMP source] started
2024/05/27 17:33:15 DEB [path src_cam] [RTMP source] connecting
2024/05/27 17:33:15 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)
2024/05/27 17:33:15 INF [RTMP] listener opened on :1935
2024/05/27 17:33:15 INF [SRT] listener opened on :8890 (UDP)
2024/05/27 17:33:15 ERR [path src_cam] [RTMP source] not enough bytes
2024/05/27 17:33:20 DEB [path src_cam] [RTMP source] connecting
2024/05/27 17:33:22 ERR [path src_cam] [RTMP source] not enough bytes
<here I press Control-C>
^C2024/05/27 17:33:26 INF shutting down gracefully
2024/05/27 17:33:26 INF [SRT] listener is closing
2024/05/27 17:33:26 INF [RTMP] listener is closing
2024/05/27 17:33:26 INF [RTSP] listener is closing
2024/05/27 17:33:26 DEB path manager is shutting down
2024/05/27 17:33:26 INF [path src_cam] [RTMP source] stopped: path is closing
2024/05/27 17:33:26 DEB [path src_cam] destroyed: terminated
2024/05/27 17:33:26 INF waiting for running hooks

Did you attach a network dump?

no - it is a private network, so I would not to attach a dump publically :)

But I made the dump myself, and there is something that looks like pretty nice RTMP connect command > success reply > createStream, play > onStatus reply > and there is some data, but after a short while (sending 3429 and receiving 16927 bytes) mediamtx closes the TCP connection via a reset!