-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple streams #20
base: master
Are you sure you want to change the base?
Conversation
Hi there! Thanks a lot for the contribution ❤️ I really like the idea of being able to also support audio - historically, all my work is 100% on video, but as you've seen, the low level is not too far from being capable of supporting multiple streams. I'm going on vacation now (posting from the airport!), so please expect some delays, but here is what I can already say.
I will need to test this against the different models of cameras I have as well as proxies like Mediamtx, but that's definitely a good start, thx! |
Thank you for the quick feedback @RouquinBlanc
sadly, the veezoom cameras that I have only send back media on the last socket pair chosen in SETUP
Reolink uses different session id per stream
In terms of backward compatiblity: the reader itself would still work as it used to. the only exception is that we pass an array of the media_types (by default ['video'] instead of 'video') Thanks, |
ac42099
to
fdfd76e
Compare
fdfd76e
to
3d5c11c
Compare
Hey @RouquinBlanc, thank you for this nice library.
disclaimer: I started learning RTSP last week, so please forgive any stupid mistakes.
I needed to support video and audio (or just audio) for a project and I found that I might be able to extend your work and the pending PR #13
I basically ran a test with ffmpeg, recorded the rtsp messages exchanged, and read a little bit of the various RFCs and tried to replicate that behavior with the building blocks you have provided us with.
I have tested this running examples/camera_feed.py on two Veezoom Cameras and so far, the results are good. I can use ffmpeg to play the h264 video, and the raw PCM audio samples.
stream_tcp.log
stream_udp.log
this work is mainly motivated by the fact that the veezoom cameras, when requested for audio only, they would still send video on interleaved channel 0-1, and audio on interleaved channel 2-3 (even though the acknowledge the setup request for audio only on interleaved 0-1)
I am ordering a couple of new cameras by another vendor just to confirm things work as expected.
some of the unit tests were modified on separate commits to replicate this multi stream scenario, but even without changes, they all passed. so if you don't like them, I can drop them from this PR.
There's definitely room for improvement on this; for instance, on the fact that if a camera has two audio channels (stereo), we only select the first. it could be addressed later if you're content with these changes.
I appreciate your feedback on this