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
11.64k stars 1.47k forks source link

Cannot open rtsp stream from VLC #223

Closed wwortel closed 2 years ago

wwortel commented 3 years ago

rtsp-simple-server v0.14.2 VLC version 3.0.12

A rtsp audio stream is published to a remote server (VPS) running Debian10 Linux and rtsp-simple-server. The publishing is done using ffmpeg from Linux and the command 'ffmpeg -ac 1 -f alsa -i hw:CARD=CODEC,DEV=0 -acodec libmp3lame -ab 32k -content_type audio/mpeg -vn -f rtsp rtsp://\<uname>:\<pwd>@\<Stream URL>:8554/\<path label>'. ( \< .... > is a confidential string of the type indicated between \< >)

I can connect to the stream using ffmpeg and a command 'ffmpeg -i rtsp://\<Stream URL>:8554/\<path label> -c copy stream.mp3' Problem: Opening the stream from VLC (comand 'Open Network Stream') with the network URL rtsp://\<Stream URL>:8554/\<path label> does not work. Logging results: Debug logging on VLC: ..... main debug: connection succeeded (socket = 35) main debug: net: opening 0.0.0.0 datagram port 9258 main debug: net: opening 0.0.0.0 datagram port 9259 satip error: Failed to play RTSP session satip error: read error: Operation now in progress satip error: Failed to teardown RTSP session main debug: net: connecting to \<Stream IP Address> port 8554 main debug: connection succeeded (socket = 35) access_realrtsp warning: Cseq mismatch, got 1, assumed 0 access_realrtsp debug: rtsp connected access_realrtsp warning: only real/helix rtsp servers supported for now main debug: no access modules matched main debug: dead input qt debug: IM: Deleting the input main debug: changing item without a request (current 0/1) main debug: nothing to play main: end of playlist, exiting main debug: exiting ..... The rtsp-simple server log gives: ..... [client :50028] connected (plain) [client :50028] ERR: path has changed, was '\<path label>', now is 'stream=0' [client :50028] disconnected ..... Any suggestion how to get VLC to open the stream?

wwortel commented 3 years ago

strange: using VLC from a Windows10 computer the stream does start. So this appears to be something VLC/Linux <>rtsp-simple-server specific or perhaps a plain VLC/Linux bug.

aler9 commented 3 years ago

Hello, to fix this i need a dump of the data exchanged between the server and the target (network dump), that can be generated in this way: 1) Download wireshark (https://www.wireshark.org/) 2) Start capturing on the interface used for exchanging RTSP (if the server and the target software are both installed on your pc, the interface is probably "loopback", otherwise it's the one of your network card) 3) Start the server and replicate the issue 4) Stop capturing, save the result in .pcap format 5) Attach

Cramac commented 3 years ago

I will join the question. version 0.16.0 VLC does not show video https://paste.pics/c7efcab613b4ba09e1b43634b4e8431d ffmpeg shows this:

[h264 @ 0x562ca8a47e80] non-existing PPS 0 referenced Last message repeated 1 times [h264 @ 0x562ca8a47e80] decode_slice_header error [h264 @ 0x562ca8a47e80] no frame! [h264 @ 0x562ca8a47e80] cabac decode of qscale diff failed at 46 1 [h264 @ 0x562ca8a47e80] error while decoding MB 46 1, bytestream 11779 [h264 @ 0x562ca8a47e80] concealing 3523 DC, 3523 AC, 3523 MV errors in I frame [h264 @ 0x562ca8a47e80] concealing 68 DC, 68 AC, 68 MV errors in P frame [h264 @ 0x562ca8a47e80] error while decoding MB 2 25, bytestream -10 [h264 @ 0x562ca8a47e80] concealing 1647 DC, 1647 AC, 1647 MV errors in P frame [h264 @ 0x562ca8a47e80] cabac decode of qscale diff failed at 33 13 [h264 @ 0x562ca8a47e80] error while decoding MB 33 13, bytestream -6 [h264 @ 0x562ca8a47e80] concealing 2576 DC, 2576 AC, 2576 MV errors in P frame Guessed Channel Layout for Input Stream #0.1 : mono Input #0, rtsp, from 'rtsp://127.0.0.1:8554/proxied1': Metadata: title : Stream Duration: N/A, start: -0.341667, bitrate: N/A Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1280x720, 25 tbr, 90k tbn, 180k tbc Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s

./rtsp-simple-server 2021/05/11 13:23:08 I [0/0] rtsp-simple-server v0.16.0 2021/05/11 13:23:08 I [0/0] [RTSP] UDP/RTP listener opened on :8000 2021/05/11 13:23:08 I [0/0] [RTSP] UDP/RTCP listener opened on :8001 2021/05/11 13:23:08 I [0/0] [RTSP] TCP listener opened on :8554 2021/05/11 13:23:08 I [0/0] [RTMP] listener opened on :1935 2021/05/11 13:23:08 I [0/0] [HLS] listener opened on :8888 2021/05/11 13:23:08 I [0/0] [path proxied1] [rtsp source] started 2021/05/11 13:23:08 I [0/0] [path proxied1] [rtsp source] ready 2021/05/11 13:23:43 I [0/0] [RTSP] [conn 127.0.0.1:55868] opened 2021/05/11 13:23:43 I [0/0] [RTSP] [session 3346231606] opened by 127.0.0.1:55868 2021/05/11 13:23:43 I [0/1] [RTSP] [session 3346231606] is reading from path 'proxied1', 2 tracks with UDP

config (all config is default):

paths: proxied1: source: rtsp://admin:cam@172.20.2.236/Streaming/channels/1

aler9 commented 3 years ago

Regarding corrupted frames, in the configuration try increasing these parameters

readBufferCount: 512
readBufferSize: 2048
gherlein commented 2 years ago

I seem to have a similar problem. This is happening only 3.0.12 - same source stream works fine on 3.0.11. Logs:

err.txt

PCAP: vlc.pcap.zip

Broken: gherlein@alien:~$ cvlc --version VLC media player 3.0.12 Vetinari (revision 3.0.12-1-0-gd147bb5e7e)

VLC version 3.0.12 Vetinari (3.0.12-1-0-gd147bb5e7e) Compiled by buildd on lgw01-amd64-039.buildd (Mar 9 2021 16:42:00) Compiler: gcc version 10.2.1 20210306 (Ubuntu 10.2.1-21ubuntu1)

Working: gherlein@mars:~$ cvlc --version VLC media player 3.0.11.1 Vetinari (revision 3.0.11.1-0-g52483f3ca2) VLC version 3.0.11.1 Vetinari (3.0.11.1-0-g52483f3ca2) Compiled by buildd on lgw01-amd64-035.buildd (Sep 22 2020 21:11:26) Compiler: gcc version 10.2.0 (Ubuntu 10.2.0-9ubuntu2)

sborn commented 2 years ago

Similar break in VLC (and temp solution) with the 5.10.63-v7l+ kernel: https://github.com/SvenVD/rpisurv/issues/136

aler9 commented 2 years ago

not a rtsp-simple-server issue.

github-actions[bot] commented 1 year ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.