-
Notifications
You must be signed in to change notification settings - Fork 140
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
Incorrect timestamp processing #44
Comments
@mondain I tried to address this one, but this seems to require lots of changes :(( |
@Andy--S I know you've done a lot of work with timestamps; would you like to weigh-in on this? |
It is correct that dropping negatives on a signed integer will limit live streams to 50% or their potential duration if the timestamps start at zero. more if they have an arbitrary start. Ideally red5 wants a zero timestamp for the 'creationTime' of the ClientBroadcastStream. |
Thank you for your responses. Just to clarify, are there any plans on the Red5 team implementing a fix for this? I appreciate @solomax's observation that it would require a lot of changes, but such an issue is unlikely to be properly fixed by first time contributors unfamiliar with the Red5 code basis. Is there any specific reason why Red5 discards RTMP messages if the |
Hello,
We are currently using the Red5 Client module to consume an RTMP input stream and proxy it to a different output destination. Nevertheless, Red5 seems to be ignoring most RTMP messages and streaming is not working as expected. See the following debug logs:
The code responsible for this behaviour is coming from red5-server-common, in the pushMessage method. If an incoming RTMP message has a negative timestamp, it is simply ignored.
Monitoring the source RTMP input with the rtmpdump tool shows that none of the timestamps that are sent to Red5 are negative. However, they have large values, more specifically between 231 and 232. The IRTMPEvent defines the timestamp as
int
, which is a signed data type ranging from -231 and 231 - 1. Any value between 231 and 232 -1 will overflow and be interpreted as a negative timestamp by Red5.Adobe's official RTMP specification states the following:
If my understanding is correct, according to the specification RTMP applications should be using unsigned integer arithmetic and not assume that timestamps start at 0 at the beginning of each stream.
Two of our current encoder vendors currently can't be used in conjunction with Red5 as they don't start the timestamp at 0 and may use a value between 231 and 232. Even for encoder vendors who reset their timestamps to 0, we believe that if the stream has been running for more than 24 days, 20 hours, 31 minutes and 23.648 seconds (231 milliseconds), it will suddenly break down as the timestamps will be interpreted as negative by Red5 past that point.
Thanks in advance for your help!
Regards,
Pyves
The text was updated successfully, but these errors were encountered: