rtsp streaming from webcamera

tom tomschuring at gmail.com
Tue Aug 17 02:37:41 UTC 2021


Been doing some tcp-dumping

so vlc works fine with my camera, and gstreamer now  (after i added ""
around the location ) times out ..

first request from gstreamer:
OPTIONS rtsp://
192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
RTSP/1.0
CSeq: 1
User-Agent: GStreamer/1.14.5
User-Agent: RealMedia Player Version 6.0.9.1235
(linux-2.0-libc6-i386-gcc2.95)
ClientChallenge: 9e26d33f2984236010ef6253fb1887f7
CompanyID: KnKV4M4I/B2FjJ1TToLycw==
GUID: 00000000-0000-0000-0000-000000000000
RegionData: 0
PlayerStarttime: [28/03/2003:22:50:23 00:00]
ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586
Date: Tue, 17 Aug 2021 01:57:59 GMT

first request from vlc:
OPTIONS rtsp://
192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
RTSP/1.0
CSeq: 2
User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)


then they both receive a response from the camera like:
RTSP/1.0 401 Unauthorized
CSeq: 2
WWW-Authenticate: Digest realm="Login to
DF402EB32420A830",nonce="637fd510-1343-4036-b53c-8a2ecd29d992"


gstreamer -> camera:

<OPTIONS rtsp://
192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
RTSP/1.0
CSeq: 2
User-Agent: GStreamer/1.14.5
User-Agent: RealMedia Player Version 6.0.9.1235
(linux-2.0-libc6-i386-gcc2.95)
ClientChallenge: 9e26d33f2984236010ef6253fb1887f7
CompanyID: KnKV4M4I/B2FjJ1TToLycw==
GUID: 00000000-0000-0000-0000-000000000000
RegionData: 0
PlayerStarttime: [28/03/2003:22:50:23 00:00]
ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586
User-Agent: RealMedia Player Version 6.0.9.1235
(linux-2.0-libc6-i386-gcc2.95)
ClientChallenge: 9e26d33f2984236010ef6253fb1887f7
CompanyID: KnKV4M4I/B2FjJ1TToLycw==
GUID: 00000000-0000-0000-0000-000000000000
RegionData: 0
PlayerStarttime: [28/03/2003:22:50:23 00:00]
ClientID: Linux_2.4_6.0.9.1235_play32_RN01_EN_586
Authorization: Digest username="admin", realm="Login to DF402EB32420A830",
nonce="6d062b3c-8bfc-4673-93d1-0bc95d0c7bbc", uri="rtsp://
192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
response="51790ca8f65c888dbfef80af89b56b69"
Date: Tue, 17 Aug 2021 01:57:59 GMT
— after this i hear nothing from the camera until gstreamer times out


vlc ->camera:

OPTIONS rtsp://
192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
RTSP/1.0
CSeq: 3
Authorization: Digest username="admin", realm="Login to DF402EB32420A830",
nonce="637fd510-1343-4036-b53c-8a2ecd29d992", uri="rtsp://
192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
response="61f572072b3309ddf167eb2f76d4618a"
User-Agent: LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)

and vlc keeps getting responses of DESCRIBE SETUP and starts playing after
this.
so the only difference i can see is the extra parameters that gstreamer is
sending..

is there a way to make rtspsrc respond in a much simpler way ?

current cmd (i'm trying to fool the camera with the user-agent):

gst-launch-1.0  --gst-debug=rtspsrc:5 rtspsrc location='rtsp://
192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true'
user-id=admin user-pw=L2E8C359 latency=150 onvif-mode=false
user-agent="LibVLC/3.0.16 (LIVE555 Streaming Media v2016.11.28)" !
decodebin max-size-time=30000000000 ! videoconvert ! autovideosink

On Mon, 16 Aug 2021 at 21:05, tom <tomschuring at gmail.com> wrote:

> Hello,
>
> I have a IMOU IPC-F22AP PoE webcam that i can stream from using
>
> vlc rtsp://
> admin:L2E8C359 at 192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
> latency=150 onvif-mode=true
>
> However if i try gstreamer:
>
> ~$ gst-launch-1.0  --gst-debug=rtspsrc:5 rtspsrc location=rtsp://
> admin:L2E8C359 at 192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
> latency=150 onvif-mode=true ! decodebin max-size-time=30000000000 !
> videoconvert ! autovideosink
>
> I receive a
>
> 0:00:00.142907259 32612   0x558a3461e0 WARN                 rtspsrc
> gstrtspsrc.c:6112:gst_rtspsrc_send:<rtspsrc0> error: Not Found (404)
> -- full log below --
>
> I noted that at
> https://gstreamer.freedesktop.org/documentation/rtsp/rtspsrc.html?gi-language=c
> it says:
> rtspsrc strictly follows RFC 2326 and therefore does not (yet) support
> RealMedia/Quicktime/Microsoft extensions.
>
> Is this what it looks like when the stream doesn't follow RFC 2326 ?
>
> If so, is there a way around this ?
>
> Kind Regards,
> Tom
>
>
> --- log -----
> ~$ gst-launch-1.0  --gst-debug=rtspsrc:5 rtspsrc location=rtsp://
> admin:L2E8C359 at 192.168.2.8:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
> latency=150 onvif-mode=true ! decodebin max-size-time=30000000000 !
> videoconvert ! autovideosink
> [1] 32612
> [2] 32613
> [3] 32614
> bash: onvif-mode=true: command not found
> [2]-  Done                    subtype=0
> [3]+  Done                    unicast=true
> yoda at yoda-desktop:~$ 0:00:00.063119666 32612   0x558a42ba10 DEBUG
>        rtspsrc gstrtspsrc.c:8617:gst_rtspsrc_uri_set_uri:<rtspsrc0> parsing
> URI
> 0:00:00.063195294 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:8624:gst_rtspsrc_uri_set_uri:<rtspsrc0> configuring URI
> 0:00:00.063229566 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:8640:gst_rtspsrc_uri_set_uri:<rtspsrc0> set uri: rtsp://
> admin:L2E8C359 at 192.168.2.8:554/cam/realmonitor?channel=1
> 0:00:00.063251181 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:8642:gst_rtspsrc_uri_set_uri:<rtspsrc0> request uri is: rtsp://
> 192.168.2.8:554/cam/realmonitor?channel=1
> Setting pipeline to PAUSED ...
> 0:00:00.063501293 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:8391:gst_rtspsrc_start:<rtspsrc0> starting
> 0:00:00.063658121 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd OPEN
> 0:00:00.063717237 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:5598:gst_rtspsrc_loop_send_cmd:<rtspsrc0> not interrupting
> busy cmd unknown
> Pipeline is live and does not need PREROLL ...
> 0:00:00.063937244 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:8346:gst_rtspsrc_thread:<rtspsrc0> got command OPEN
> 0:00:00.063999069 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
> 0:00:00.064036466 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:4614:gst_rtsp_conninfo_connect:<rtspsrc0> creating connection
> (rtsp://admin:L2E8C359@192.168.2.8:554/cam/realmonitor?channel=1)...
> Progress: (open) Opening Stream
> 0:00:00.064489554 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:4625:gst_rtsp_conninfo_connect:<rtspsrc0> sanitized uri rtsp://
> 192.168.2.8:554/cam/realmonitor?channel=1
> 0:00:00.064558202 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:4659:gst_rtsp_conninfo_connect:<rtspsrc0> connecting (rtsp://
> admin:L2E8C359 at 192.168.2.8:554/cam/realmonitor?channel=1)...
> Progress: (connect) Connecting to rtsp://
> admin:L2E8C359 at 192.168.2.8:554/cam/realmonitor?channel=1
> 0:00:00.098391258 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:7342:gst_rtspsrc_retrieve_sdp:<rtspsrc0> create options...
> (async)
> 0:00:00.098442406 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:7351:gst_rtspsrc_retrieve_sdp:<rtspsrc0> send options...
> 0:00:00.098543971 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
> 0:00:00.098585119 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
> 0:00:00.098602202 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5964:gst_rtspsrc_try_send:<rtspsrc0> sending message
> Progress: (open) Retrieving server options
> 0:00:00.107064139 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5866:gst_rtsp_src_receive_response:<rtspsrc0> received
> response message
> 0:00:00.107110494 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5885:gst_rtsp_src_receive_response:<rtspsrc0> got response
> message 401
> 0:00:00.107148829 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5785:gst_rtspsrc_setup_auth:<rtspsrc0> Attempting
> authentication using credentials from the URL
> 0:00:00.107169194 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5814:gst_rtspsrc_setup_auth:<rtspsrc0> Attempting Digest
> authentication
> 0:00:00.107204560 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
> 0:00:00.107227738 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
> 0:00:00.107248936 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5964:gst_rtspsrc_try_send:<rtspsrc0> sending message
> 0:00:00.131234908 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5866:gst_rtsp_src_receive_response:<rtspsrc0> received
> response message
> 0:00:00.131283920 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5885:gst_rtsp_src_receive_response:<rtspsrc0> got response
> message 200
> 0:00:00.131317255 32612   0x558a3461e0 INFO                 rtspsrc
> gstrtspsrc.c:7364:gst_rtspsrc_retrieve_sdp:<rtspsrc0> Now using version: 1.0
> 0:00:00.131349599 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:7371:gst_rtspsrc_retrieve_sdp:<rtspsrc0> create describe...
> 0:00:00.131380694 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:7388:gst_rtspsrc_retrieve_sdp:<rtspsrc0> send describe...
> 0:00:00.131457311 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
> 0:00:00.131512730 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:476:default_before_send:<rtspsrc0> default handler
> Progress: (open) Retrieving media info
> 0:00:00.131558564 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5964:gst_rtspsrc_try_send:<rtspsrc0> sending message
> 0:00:00.142655741 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5866:gst_rtsp_src_receive_response:<rtspsrc0> received
> response message
> 0:00:00.142705326 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:5885:gst_rtsp_src_receive_response:<rtspsrc0> got response
> message 404
> 0:00:00.142733868 32612   0x558a3461e0 WARN                 rtspsrc
> gstrtspsrc.c:5829:gst_rtspsrc_setup_auth:<rtspsrc0> error: No supported
> authentication protocol was found
> 0:00:00.142851268 32612   0x558a3461e0 WARN                 rtspsrc
> gstrtspsrc.c:6112:gst_rtspsrc_send:<rtspsrc0> error: Not found
> 0:00:00.142907259 32612   0x558a3461e0 WARN                 rtspsrc
> gstrtspsrc.c:6112:gst_rtspsrc_send:<rtspsrc0> error: Not Found (404)
> ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not
> open resource for reading.
> Additional debug info:
> gstrtspsrc.c(5829): gst_rtspsrc_setup_auth ():
> /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0:
> No supported authentication protocol was found
> 0:00:00.142977574 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:7514:gst_rtspsrc_retrieve_sdp:<rtspsrc0> free connection
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to PAUSED ...
> 0:00:00.143045284 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:4715:gst_rtsp_conninfo_close:<rtspsrc0> closing connection...
> Setting pipeline to READY ...
> 0:00:00.143136642 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:4721:gst_rtsp_conninfo_close:<rtspsrc0> freeing connection...
> 0:00:00.143163934 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd CLOSE
> 0:00:00.143174664 32612   0x558a3461e0 WARN                 rtspsrc
> gstrtspsrc.c:7548:gst_rtspsrc_open:<rtspsrc0> can't get sdp
> 0:00:00.143195914 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:5585:gst_rtspsrc_loop_send_cmd:<rtspsrc0> cancel previous
> request LOOP
> 0:00:00.143251749 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:5593:gst_rtspsrc_loop_send_cmd:<rtspsrc0> connection flush
> busy WAIT
> 0:00:00.143271021 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 1
> 0:00:00.143300449 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:8346:gst_rtspsrc_thread:<rtspsrc0> got command CLOSE
> 0:00:00.143321179 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 0
> 0:00:00.143344356 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:7569:gst_rtspsrc_close:<rtspsrc0> TEARDOWN...
> 0:00:00.143362795 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:7574:gst_rtspsrc_close:<rtspsrc0> not ready, doing cleanup
> 0:00:00.143379462 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:7637:gst_rtspsrc_close:<rtspsrc0> closing connection...
> 0:00:00.143396077 32612   0x558a3461e0 DEBUG                rtspsrc
> gstrtspsrc.c:2058:gst_rtspsrc_cleanup:<rtspsrc0> cleanup
> Setting pipeline to NULL ...
> 0:00:00.143477382 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:8422:gst_rtspsrc_stop:<rtspsrc0> stopping
> 0:00:00.143507487 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:5567:gst_rtspsrc_loop_send_cmd:<rtspsrc0> sending cmd WAIT
> 0:00:00.143527852 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:5593:gst_rtspsrc_loop_send_cmd:<rtspsrc0> connection flush
> busy WAIT
> 0:00:00.143546446 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:4748:gst_rtspsrc_connection_flush:<rtspsrc0> set flushing 1
> 0:00:00.143600927 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:7569:gst_rtspsrc_close:<rtspsrc0> TEARDOWN...
> 0:00:00.143622334 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:7574:gst_rtspsrc_close:<rtspsrc0> not ready, doing cleanup
> 0:00:00.143640199 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:7637:gst_rtspsrc_close:<rtspsrc0> closing connection...
> 0:00:00.143657596 32612   0x558a42ba10 DEBUG                rtspsrc
> gstrtspsrc.c:2058:gst_rtspsrc_cleanup:<rtspsrc0> cleanup
> Freeing pipeline ...
>
>
> --
> ☕𝓉𝓈
>


-- 
☕𝓉𝓈
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210817/2459568b/attachment-0001.htm>


More information about the gstreamer-devel mailing list