Closed nerkn closed 1 year ago
wow, I must be getting old.. I don't even remember writing this repo.
anyway, I glanced over the README.. and see from the error messages in your log that you're hitting the "limitation" it mentions:
limitations (inherited from rtsp-streaming-server library)
- doesn't support RTP/RTSP/TCP
You'll want to see whether ffmpeg can stream using the older protocol (using RTP and RTCP ports). If you find the proper CLI incantation to make it all work, it would be great if you could post an update to this issue (for future reference).
Sorry I couldn't be more help.
Here's a working example using ffmpeg (for both producer and consumer)..
important: order matters
rtsp-relay -pport 5554 -cport 6554 --log 5 >log.txt 2>&1
ffmpeg -re -stream_loop -1 -i test.mp4 -f rtsp -rtsp_transport udp rtsp://127.0.0.1:5554/stream1
ffplay -rtsp_transport udp rtsp://127.0.0.1:6554/stream1
where:
test.mp4
log.txt
update:
here is a slightly more polished example :smiley:
circling back to your initial comment, try running this for your producer:
ffmpeg -re -f alsa -ac 2 -i hw:0 -f v4l2 -i /dev/video3 -c:v mpeg1video -q 15 -pix_fmt yuv420p -preset veryfast -f rtsp -rtsp_transport udp -muxdelay 0.1 rtsp://SERVERIP:5554/PATH
I hope that this message still be able to reach you guys at this moment. I have tried running the setup just as you @warren-bank mentioned above sir but when I start the ffplay command, I encountered disconnection right away. After adding the logs options, this is what happened.
Any help would be much appriciated.
thoughts/comments:
npm install
in both the project root directory, as well as in ./tests
Thank you for your timely response sir. Yes, based on the console log, seems like something is wrong with the port 1008 which is where I got lost since I do not purposely using that port. And I have aslo checked the opening ports on the server at that moment, then saw no 1008 port at all.
And this is the command that I have used to start the server: rtsp-relay -pport 5554 -cport 6554 --log-level 3 I have noticed in your message that you mentioned pulling the project and do npm i which I did not follow. I've just install the package globally as being described in README, may that be the reason?
global install is fine.. i was just testing in a disposable directory
very odd.. -cport
is the "consumer port".. which your log message indicates is trying to bind to 1008.
off-hand.. no idea why this is happening..
darnit.. darnit.. ok, I found the problem.. and it's a bug.. completely my fault:
this defaults --rtp-low-port
to 1,000
.. but the README says that it should default to 10,000
I forgot a zero..
I'll fix it now and push an update to npm. I'll add another quick comment to let you know when you can pull the fix. Thanks for finding this.. and letting me know about it.
No problem sir. Just give me a ping when it's possible.
@warren-bank awesome as it should be.
Best Regards.
I had a little trouble sending from ffmpeg and reading from vlc.
For ffmpeg I made this command, I suggest you to add as example, since path is important
ffmpeg -re -f alsa -ac 2 -i hw:0 -f v4l2 -i /dev/video3 -vcodec libx264 -pix_fmt yuv420p -preset veryfast -f rtsp rtsp://SERVERIP:5554/PATH
But I cant watch from vlc, where I used "rtsp://SERVERIP:6554/robos"
node is running under docker where all ports are exposed with " --network host"