skymaze / pymediasoup

mediasoup python client
MIT License
26 stars 14 forks source link

Media sections in answer do not match offer #5

Closed markblumenau closed 1 year ago

markblumenau commented 2 years ago

Hello! Trying to run the example code I get the following error from aiortc: ValueError: Media sections in answer do not match offer Not sure what exactly causes this problem, but maybe it is possible to find what is wrong. Thanks in advance!

neilyoung commented 1 year ago

I ran into the same issue, which might not be one for you anymore. I came across this, when I subscribed to an audio stream, unsubscribed and later subscribed to a video stream. I could narrow down this to some point, but it seems, that the consumer joins a stale RTP stream, that's why it forms an answer, which doesn't match the offered media...

But I couldn't solve this. If I always stick with the same media type, that problem doesn't happen

neilyoung commented 1 year ago

Oh, a second after my first post I think I found the answer. The reason is the attempt to recycle some old "closedMediaSections".

https://github.com/skymaze/pymediasoup/blob/6fd3564ed690fe59ab886334fe136bca84648a7e/pymediasoup/handlers/sdp/remote_sdp.py#L169

See, if you can comment 170 to 173 and if this solves your problem.

markblumenau commented 1 year ago

Thanks! However, it has been a while since I moved from that project, so I guess it's best to close this issue.

neilyoung commented 1 year ago

May I ask what you did choose in replacement?

markblumenau commented 1 year ago

In my case Jitsi with some minor changes worked just fine

neilyoung commented 1 year ago

So you dropped MediaSoup, I guess? I'm pretty happy with that (replaced Kurento Media Server). Having clients for Web, Android and now for Python. Thanks for the details. Have a nice weekend.

BTW: This lib is pretty good, though

markblumenau commented 1 year ago

Yep, dropped mediasoup. This lib is good, that's true. Have a nice weekend.