aiortsp icon indicating copy to clipboard operation
aiortsp copied to clipboard

Support multiple streams

Open berysaidi opened this issue 10 months ago • 2 comments

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 https://github.com/marss/aiortsp/pull/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

berysaidi avatar Apr 24 '24 03:04 berysaidi