chriswiggins / rtsp-streaming-server

Lightweight RTSP/RTP streaming media server written in Javascript
GNU General Public License v3.0
106 stars 21 forks source link

TypeError: Cannot read property 'clients' of undefined when used with VLC #4

Closed cdebost closed 5 years ago

cdebost commented 5 years ago

VLC client fails reading from an rstp source.

Steps to Reproduce

Run the example rtsp-streaming-server program in test/index.js.

ffmpeg -i "rtmp://184.72.239.149/vod/mp4:bigbuckbunny_1500.mp4" -f rtsp "rtsp://127.0.0.1:5554/test"

Open rtsp://127.0.0.1:6554/test in VLC.

Server program reports a TypeError at lib/Client.js:94:15.

Playback with ffplay -i rtsp://127.0.0.1:6554/test works fine.

My first hint is that ffplay and VLC make different calls to the streaming server.

ffplay does the following:

OPTIONS rtsp://127.0.0.1:6554/test DESCRIBE rtsp://127.0.0.1:6554/test SETUP rtsp://127.0.0.1:6554/test/streamid=0 SETUP rtsp://127.0.0.1:6554/test/streamid=1 PLAY rtsp://127.0.0.1:6554/test

Whereas VLC does the following:

OPTIONS rtsp://127.0.0.1:6554/test DESCRIBE rtsp://127.0.0.1:6554/test SETUP rtsp://127.0.0.1:6554/test/streamid=0 SETUP rtsp://127.0.0.1:6554/test/streamid=1 SETUP rtsp://127.0.0.1:6554/test PLAY rtsp://127.0.0.1:6554/stream=0

There's an extra SETUP call that is probably related to the error I'm seeing.

chriswiggins commented 5 years ago

Hi @cdebost

Firstly apologies for the delays on this - turns out GitHub doesn't auto subscribe you to notifications of your own repositories!

I've just published 1.0.2 which should solve the VLC issues. We weren't setting a session header and VLC was expecting one. I've fixed this and verified it works. Do you want to give it another go?

chriswiggins commented 5 years ago

Closing this for now - please re-open if you still get stuck!