RTSP in curl tool. Setting of CURLOPT_RTSP_STREAM_URI in curl tool.
(too old to reply)
Vitaly Zhuravlev
2018-02-26 22:46:47 UTC
I'm trying to do a simple health check of RTSP stream with curl tool.
But command like this always gives me 404 Stream Not Found error:

curl -v --url rtsp:// --user admin:1234
* Trying
* Connected to ( port 554 (#0)
* Server auth using Basic with user 'admin'
CSeq: 1
User-Agent: curl/7.47.0
Authorization: Basic YWRtaW46YWRtaW4=
< RTSP/1.0 404 Stream Not Found
< CSeq: 1
< Date: Tue, Feb 27 2018 01:14:21 GMT
* Connection #0 to host left intact

But it looks like that RTSP_STREAM_URI is not set. so `*` is used instead
`> OPTIONS * RTSP/1.0`

For instance, I tested the same URI with VLC media player and captured
packets with tcpdump. With VLC it works and I can see the video without any
issues and data send in request to RTSP server looks like this as observed
in tcpdump:

OPTIONS rtsp:// RTSP/1.0
CSeq: 2
User-Agent: LibVLC/2.2.2 (LIVE555 Streaming Media v2016.02.09)

It looks that there is an option `CURLOPT_RTSP_STREAM_URI` in libcurl under
the hood of curl tool, but I can't find command line option to set this
parameter so `*` is used as default value according to this:
And it doesn't automatically use value of --url neither.

How to set CURLOPT_RTSP_STREAM_URI in curl tool?
Thank you
Daniel Stenberg
2018-03-04 23:17:57 UTC
Post by Vitaly Zhuravlev
How to set CURLOPT_RTSP_STREAM_URI in curl tool?
There is no way! In fact, not a single CURLOPT_RTSP_* option can be set with
the command line tool.

This is just a sign that nobody has wanted to do that yet bad enough to
actually provide the code to enable it. It chould be easy enough to introduce
a new command line option that lets you set CURLOPT_RTSP_STREAM_URI.

You up for it? You're the one who wants it and possibly even have a good way
to test it out in real life...!
/ daniel.haxx.se
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users