gortsplib icon indicating copy to clipboard operation
gortsplib copied to clipboard

Support for stream change announcements from server side

Open zonque opened this issue 4 years ago • 1 comments

Is there a way to react to server stream changes?

Quoting RFC2326, section 9

Unlike HTTP, RTSP allows the media server to send requests to the media client. However, this is only supported for persistent connections, as the media server otherwise has no reliable way of reaching the client. Also, this is the only way that requests from media server to client are likely to traverse firewalls.

The RTSP server I've tried do in fact support that, but I see no way to dispatch such updates in the client. Worse yet, with persistent connections and periodic invocations of Describe() I'm currently getting ERR: expected 'RTSP/1.0', got 'ANNOUNCE' when the server actually did notify the client on a change.

The only option I currently see is to periodically poll Describe() and close the connection after each run, which is a bit nasty. Is there a better way I'm not aware of?

zonque avatar Jul 09 '21 07:07 zonque

Hello, you're right, this is a missing feature that can be added in the future. The only server->client request that i was aware of was REDIRECT, but you rightly pointed out that also ANNOUNCE can be sent in this direction.

aler9 avatar Aug 07 '21 17:08 aler9