Node-Media-Server icon indicating copy to clipboard operation
Node-Media-Server copied to clipboard

Acked sequence number wrong(?) after wrap around

Open eerimoq opened this issue 11 months ago • 1 comments

Hi!

My RTMP client uses the acknowledged sequence number in the Acknowledgement control message to keep track of how much data that is in flight. It works well when streaming to Twitch and Youtube, but when streaming to this server it does not. The acked sequence number wraps at i32-max or u32-max in those services, and the next acked sequence number is the rest (modulus). In this server it wraps at 0xf0000000, and the next acked sequence number is always 0. So seems impossibly to kow exactly how much data is acked.

https://github.com/illuspas/Node-Media-Server/blob/master/src/node_rtmp_session.js#L498-L506

I can't find anything about this in the RTMP specification unfortunately.

Looks like GStreamer expects it to wrap at u32-max. https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/gst-plugins-bad/gst/rtmp2/rtmp/rtmpconnection.c?ref_type=heads#L973

eerimoq avatar Feb 25 '24 05:02 eerimoq

Any comments on this?

eerimoq avatar Mar 26 '24 07:03 eerimoq