Closed zhbhhh closed 3 years ago
Please provide a log of RTSP messages.
Add logs at
and
The easiest way is to use
Log.d("RTSP", message)
Hey @zhbhhh. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
I've also come across the same exception as shown above, and (at least in my case) it appears to be related to RTSP implementations not strictly adhering to section 4.4.1 of RFC3640. I was attempting to stream from UniFi Protect, which looks to be running an embedded version of EvoStream Media Server.
From a packet capture, I can see that there's a trailing semicolon on the a=fmtp
line as shown below:
a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1408; SizeLength=13; IndexLength=3; IndexDeltaLength=3;
... which then causes the following line to have an empty string as the last array element: https://github.com/google/ExoPlayer/blob/80332f7f1be7f0ea59440b4888560d228f405789/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/MediaDescription.java#L318
...which then means parameterPair
is a single element array, resulting in an out of bounds exception when attempting to access [1]
:
https://github.com/google/ExoPlayer/blob/80332f7f1be7f0ea59440b4888560d228f405789/library/rtsp/src/main/java/com/google/android/exoplayer2/source/rtsp/MediaDescription.java#L322-L323
Although the following format definition does not indicate trailing semicolons are permitted, RFC5691 (section 4.1) does contain an example where a trailing delimiter is present, so there are likely other implementations where this is the case.
a=fmtp:<format> <parameter name>=<value>[; <parameter name>=<value>]
I'm happy to submit a PR for this to optionally handle a trailing ;
, if it's acceptable to deviate slightly from the RFC?
Thanks for providing the detail!
Handling the extra semicolon seems straightforward in this case. For now I don't think we have the intention for support all slightly erroneous RTSP servers. That said, please submit a PR if there are more people complaining about this specific issue.
Thanks @claincly, I've submitted https://github.com/google/ExoPlayer/pull/9247!
When I to play RTSP APP crashed