-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[0.x], [1.x] RTSP streaming fails to get DESCRIBE with 404 #2906
Comments
If you find a way to get that working without breaking the existing support, we'd definitely welcome the change! Unfortunately I never encountered such an RTSP server, so I can't replicate nor help myself. |
On your question about which of the two to pursue, I'm personally inclined towards the first approach: reacting to a 404 with the automated fallback would probably result in a needless second attempt the vast majority of times (where the server actually is unreachable). Considering as you said this seems limited to a few implementations, it's easier to address that explicitly. We can always worry about automated mechanisms later on, if needed. |
@lminiero I have put together a quick demo to prove the concept. It was easiest to do the automatic fallback for PoC. jp-bennett@588397b This does work with the quirky IP camera, but hasn't been exhaustively tested yet. For a final solution, what if we did a hybrid of the two approaches? One of the RTSP options could be a boolean rtsp_quirk, default to false. If true, then this code path is enabled. This would allow us (Zoneminder) to support these cameras with less work on the end-user. |
I'm out of the office this morning so I can't check the code right now, but if you submit it as a pull request I'll have a look later today. I like the new name for the property 😄 |
It's not complete, for now the PR attempts a reconnect for any 404 response to a DESCRIBE. I'll add the flag later. #2909 |
Some IP cameras support RTSP, but have a quirk when it comes to their implementation. This has been directly observed with a Vivotek camera, and a possible problem on others. This particular bit of code hasn't changed between the 0.x and 1.x branches, though I've observed in on 0.x.
The quirk is that when the DESCRIBE request is formatted like
DESCRIBE RTSP://192.168.1.89/live.sdp RTSP/1.0
it returns a 404 error. It appears that these cameras actually expectDESCRIBE live.sdp RTSP/1.0
instead. I think this could be accomplished by setting the CURLOPT_RTSP_STREAM_URI curl option to the needed value, instead of the full url. (https://github.com/meetecho/janus-gateway/blob/master/src/plugins/janus_streaming.c#L7183)I see two approaches that could work. The first is an additional RTSP option, maybe rtsp_stream_uri, that when present sets the CURL option explicitly. This would allow a user that knows they have a quirky device to set the override.
The second option would be to catch a 404 response to the DESCRIBE request, and attempt it again with the CURLOPT set to just the path.
I plan to do some testing with this over the next few days, but I'm very curious whether a workaround for this quirk would be welcome in Janus, and which approach would be best.
The text was updated successfully, but these errors were encountered: