Closed bingbing720 closed 5 years ago
Hi @bingbing720 - you need to PUBLISH streams on the PublishServer
port, and then PLAY streams on the ClientServer
port . Can you show your rtsp.js
file?
It's totally same with sample code. I don't know how to implement two features and also couldn't any document about them. Would you share some code ? Thank you.
const RtspServer = require('rtsp-streaming-server').default
const server = new RtspServer({ serverPort: 7004, clientPort: 8004, rtpPortStart: 10000, rtpPortCount: 10000 });
async function run () { try { await server.start(); } catch (e) { console.error(e); } }
run();
So first of all, you need to send a stream into the RTSP server using an application that supports RTSP ANNOUNCE (like ffmpeg):
ffmpeg -re -i video.mp4 -c:v copy -f rtsp rtsp://127.0.0.1:7004/stream1
And then you can watch your stream:
ffplay rtsp://127.0.0.1:8004/stream1
Thank you. I did it. and then when I tried to play rtsp url using vlc player the above issue happened.
What RTSP url did you use in VLC?
it's some snippet of python code. .... command = ['ffmpeg', '-f', 'rawvideo', '-pix_fmt','bgr24', '-s', cam_res, '-r', str(cam_fps), '-i', '-', '-f', 'rtsp', 'rtsp://172.16.1.22:7004/cam1',
#'-f', 'mpegts', 'output.mp4'
]
proc = sp.Popen(command, stdin=sp.PIPE) ...... proc.stdin.write(frame.tobytes())
After it I opened 'rtsp://172.16.1.22:7004/cam1' through as VLC player network stream. 172.16.1.22 is localhost IP address.
You're using the wrong RTSP port in VLC. Note that there is a port to publish and a port to play
Open rtsp://172.16.1.22:8004/cam1
in VLC (note the 8004 port)
It's working now. Appreciate your help. Thank you so much.
You’re welcome! I realised the documentation was wrong too
Hello. I have implemented simple rtsp server based on your library. I am getting error 'unknown PlublishServer request 'DESCRIBE' and 'PLAY'.
'DESCRIBE' and 'PLAY' are standard protocol directives but are they not implemented yet? if so rtsp server is working properly?