Skip to content
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 for multiple media streams #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

m4reko
Copy link

@m4reko m4reko commented Aug 10, 2022

I needed to get RTSP with multiple media streams working in native Python so I made an attempt to extend this library with that functionality. Works well in my implementation but I have not been able to run the tests locally or implement new ones for my extension. If you find it promising I can attempt that.

I'm not sure if the implementation is completely correct according to the RTSP protocol either. I'm pretty new to this stuff...

@RouquinBlanc
Copy link
Collaborator

Hi, thx for your contribution!

The changes look need, the only thing I could think of on a first look is about multiple sessions; the way you have implemented it, both SETUPs are using the same "Session" ID (the additional ones using the first one), however (see RFC 2326 - section 14.1) it is also possible to SETUP different streams with different sessions, which means in turn several keep alive, with possibly different session timeouts, and require individual TEARDOWN.

What you do instead is what is represented in section 14.2: Streaming of a Container file and uses a single session to control all streams (which is what you generally want if playing synchronized video / metadata or video / audio). But when doing so, the following PLAY request and other control request should use the container URL (as per the example in that section), which is currently not handled in your PR.

Support of video + audio or video + metadata is something I wanted to add in the future (especially working toward a v2), so this is definitely a helpful start; I will need to find myself a set of different cameras providing different multi-stream support (aggregated or not) and test how it works.

What type of camera do you use, and can you share the RTSP exchanges please ? It's always helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants