iobroker-community-adapters / ioBroker.onvif

ioBroker Adapter for onvif cameras
MIT License
1 stars 1 forks source link

Snapshot from RTSP not working #161

Open alfiriel opened 1 month ago

alfiriel commented 1 month ago

Describe the bug
I have following camera that supports ONVIF: HIKVISION (DS-KD8003-IME2) The Camera does not have an own URL for Snapshots. Only RTSP stream is possible. I wanted to configure the ONVIF adapter so that it can generate an Snapshot URL for me.

It seems to detect the correct RTSP Steam URLs as the obejct onvif.1.192_168_xxx_xxx_80.infos.streamUris.mainStream.live_stream_multicast.uri deliveres following URL: rtsp://192.168.xxx.xxx:554/Streaming/Channels/101?transportmode=mcast&profile=Profile_1 And I can open a rtsp Stream with VLC player with URL: rtsp://192.168.xxx.xxx:554/Streaming/Channels/101

In the instance settings, the options are checked:

Now when I open http://iobrokerIP:8095/192_168_xxx_xxx_80 I see an "page not working" and the log of iobroker says: Error getting snapshot basic: {"data":{"type":"Buffer","data":[60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,13,10,60,101,110,118,58,69,110,118,101,108,111,112,101,32,120,109,108,110,115,58,101,110,118,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,51,47,48,53,47,115,111,97,112,45,101,110,118,101,108,111,112,101,34,32,120,109,108,110,115,58,120,115,105,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,49,47,88,77,76,83,99,104,101,109,97,45,105,110,115,116,97,110,99,101,34,32,120,109,108,110,115,58,120,115,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,49,47,88,77,76,83,99,104,101,109,97,34,32,120,109,108,110,115,58,116,116,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,115,99,104,101,109,97,34,32,120,109,108,110,115,58,116,100,115,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,100,101,118,105,99,101,47,119,115,100,108,34,32,120,109,108,110,115,58,116,114,116,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,109,101,100,105,97,47,119,115,100,108,34,32,120,109,108,110,115,58,116,105,109,103,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,50,48,47,105,109,97,103,105,110,103,47,119,115,100,108,34,32,120,109,108,110,115,58,116,101,118,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,101,118,101,110,116,115,47,119,115,100,108,34,32,120,109,108,110,115,58,116,112,116,122,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,50,48,47,112,116,122,47,119,115,100,108,34,32,120,109,108,110,115,58,116,97,110,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,50,48,47,97,110,97,108,121,116,105,99,115,47,119,115,100,108,34,32,120,109,108,110,115,58,116,115,116,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,115,116,111,114,97,103,101,47,119,115,100,108,34,32,120,109,108,110,115,58,116,101,114,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,101,114,114,111,114,34,32,120,109,108,110,115,58,100,110,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,110,101,116,119,111,114,107,47,119,115,100,108,34,32,120,109,108,110,115,58,116,110,115,49,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,116,111,112,105,99,115,34,32,120,109,108,110,115,58,116,109,100,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,100,101,118,105,99,101,73,79,47,119,115,100,108,34,32,120,109,108,110,115,58,119,115,100,108,61,34,104,116,116,112,58,47,47,115,99,104,101,109,97,115,46,120,109,108,115,111,97,112,46,111,114,103,47,119,115,100,108,34,32,120,109,108,110,115,58,119,115,111,97,112,49,50,61,34,104,116,116,112,58,47,47,115,99,104,101,109,97,115,46,120,109,108,115,111,97,112,46,111,114,103,47,119,115,100,108,47,115,111,97,112,49,50,34,32,120,109,108,110,115,58,104,116,116,112,61,34,104,116,116,112,58,47,47,115,99,104,101,109,97,115,46,120,109,108,115,111,97,112,46,111,114,103,47,119,115,100,108,47,104,116,116,112,34,32,120,109,108,110,115,58,100,61,34,104,116,116,112,58,47,47,115,99,104,101,109,97,115,46,120,109,108,115,111,97,112,46,111,114,103,47,119,115,47,50,48,48,53,47,48,52,47,100,105,115,99,111,118,101,114,121,34,32,120,109,108,110,115,58,119,115,97,100,105,115,61,34,104,116,116,112,58,47,47,115,99,104,101,109,97,115,46,120,109,108,115,111,97,112,46,111,114,103,47,119,115,47,50,48,48,52,47,48,56,47,97,100,100,114,101,115,115,105,110,103,34,32,120,109,108,110,115,58,120,111,112,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,52,47,48,56,47,120,111,112,47,105,110,99,108,117,100,101,34,32,120,109,108,110,115,58,119,115,110,116,61,34,104,116,116,112,58,47,47,100,111,99,115,46,111,97,115,105,115,45,111,112,101,110,46,111,114,103,47,119,115,110,47,98,45,50,34,32,120,109,108,110,115,58,119,115,97,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,53,47,48,56,47,97,100,100,114,101,115,115,105,110,103,34,32,120,109,108,110,115,58,119,115,116,111,112,61,34,104,116,116,112,58,47,47,100,111,99,115,46,111,97,115,105,115,45,111,112,101,110,46,111,114,103,47,119,115,110,47,116,45,49,34,32,120,109,108,110,115,58,119,115,114,102,45,98,102,61,34,104,116,116,112,58,47,47,100,111,99,115,46,111,97,115,105,115,45,111,112,101,110,46,111,114,103,47,119,115,114,102,47,98,102,45,50,34,32,120,109,108,110,115,58,119,115,110,116,119,61,34,104,116,116,112,58,47,47,100,111,99,115,46,111,97,115,105,115,45,111,112,101,110,46,111,114,103,47,119,115,110,47,98,119,45,50,34,32,120,109,108,110,115,58,119,115,114,102,45,114,119,61,34,104,116,116,112,58,47,47,100,111,99,115,46,111,97,115,105,115,45,111,112,101,110,46,111,114,103,47,119,115,114,102,47,114,119,45,50,34,32,120,109,108,110,115,58,119,115,97,119,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,54,47,48,53,47,97,100,100,114,101,115,115,105,110,103,47,119,115,100,108,34,32,120,109,108,110,115,58,119,115,114,102,45,114,61,34,104,116,116,112,58,47,47,100,111,99,115,46,111,97,115,105,115,45,111,112,101,110,46,111,114,103,47,119,115,114,102,47,114,45,50,34,32,120,109,108,110,115,58,116,114,99,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,114,101,99,111,114,100,105,110,103,47,119,115,100,108,34,32,120,109,108,110,115,58,116,115,101,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,115,101,97,114,99,104,47,119,115,100,108,34,32,120,109,108,110,115,58,116,114,112,61,34,104,116,116,112,58,47,47,119,119,119,46,111,110,118,105,102,46,111,114,103,47,118,101,114,49,48,47,114,101,112,108,97,121,47,119,115,100,108,34,32,120,109,108,110,115,58,116,110,115,110,61,34,104,116,116,112,58,47,47,119,119,119,46,101,118,101,110,116,101,120,116,101,110,115,105,111,110,46,99,111,109,47,50,48,49,49,47,101,118,101,110,116,47,116,111,112,105,99,115,34,62,60,101,110,118,58,66,111,100,121,62,60,101,110,118,58,70,97,117,108,116,62,60,101,110,118,58,102,97,117,108,116,99,111,100,101,62,101,110,118,58,83,101,110,100,101,114,60,47,101,110,118,58,102,97,117,108,116,99,111,100,101,62,13,10,60,101,110,118,58,102,97,117,108,116,115,116,114,105,110,103,62,115,112,101,99,105,97,108,95,115,101,114,118,105,99,101,32,104,97,110,100,108,101,32,105,115,32,110,117,108,108,60,47,101,110,118,58,102,97,117,108,116,115,116,114,105,110,103,62,13,10,60,47,101,110,118,58,70,97,117,108,116,62,13,10,60,47,101,110,118,58,66,111,100,121,62,13,10,60,47,101,110,118,58,69,110,118,101,108,111,112,101,62,13,10]},"status":500,"statusCode":500,"statusText":"Internal Server Error","headers":{"date":"Mon, 08 Jul 2024 16:47:15 GMT","server":"webs","content-length":"1927","connection":"keep-alive","keep-alive":"timeout=8, max=99","x-frame-options":"SAMEORIGIN","cache-control":"no-store","pragma":"no-cache","content-type":"text/xml; charset=utf-8"},"url":"http://192.168.xxx.xxx/onvif/snapshot","redirected":false,"requestUrls":["http://192.168.xxx.xxx/onvif/snapshot"],"res":{"status":500,"statusCode":500,"statusText":"Internal Server Error","statusMessage":"Internal Server Error","headers":{"date":"Mon, 08 Jul 2024 16:47:15 GMT","server":"webs","content-length":"1927","connection":"keep-alive","keep-alive":"timeout=8, max=99","x-frame-options":"SAMEORIGIN","cache-control":"no-store","pragma":"no-cache","content-type":"text/xml; charset=utf-8"},"size":1927,"aborted":false,"rt":58.812,"keepAliveSocket":true,"requestUrls":["http://192.168.xxx.xxx/onvif/snapshot"],"timing":{"queuing":11.343,"connected":20.637,"requestHeadersSent":23.578,"requestSent":24.513,"waiting":54.366,"contentDownload":57.516},"socket":{"id":1,"localAddress":"192.168.18.100","localPort":54074,"remoteAddress":"192.168.xxx.xxx","remotePort":80,"remoteFamily":"IPv4","bytesWritten":430,"bytesRead":2204,"handledRequests":1,"handledResponses":1,"connectedTime":"2024-07-08T15:28:19.926Z"},"retries":0,"socketErrorRetries":0}}

When I open the URL from the log message http://192.168.xxx.xxx/onvif/snapshot, than I receive: `This XML file does not appear to have any style information associated with it. The document tree is shown below.

env:Sender special_service handle is null ` **Expected behavior** I want to have an screenshot of the rtsp stream when I ofen the URL http://iobrokerIP:8095/192_168_xxx_xxx_80 **Versions:** - Adapter version: 1.1.4 - JS-Controller version: 5.0.19 - Node version: v20.15.0 - Operating system: ubuntu server
TA2k commented 1 month ago

It looks like the profile has set a snapshot url. please provide a screenshot oft the profile under objects

alfiriel commented 1 month ago

Which object path do you need exactly?

TA2k commented 1 month ago

stream profiles

alfiriel commented 1 month ago

Sorry, I have not found a object which names contain something with stream profile Attached is a file with all exported objects if that helps?

alfiriel commented 1 month ago

Camera is on the latest firmware. In an other topic I read that this firmware does not support snapshot via onvif if that information helps?

TA2k commented 1 month ago

die kamer gibt eine snapshot url zurück die anscheinend nicht geht bitte mal die GitHub version testen

alfiriel commented 1 month ago

Tested github version, receiving a blank white page with http://ioBroker:8095/192_168_xxx_xxx_80 With F12 in the explorer it also seems that there is no content

alfiriel commented 1 month ago

And the log Shows following: An ffmpeg error occurred: ffmpeg exited with code 1: rtsp://admin:password@192.168.xxx.xxx:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1: Server returned 401 Unauthorized (authorization failed)

alfiriel commented 1 month ago

And I cannot open the described rtsp stream from the log. Can only open the Stream If I shorten the URL:

TA2k commented 1 month ago

rtsp://admin:password@192.168.xxx.xxx:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_2 is this working Please check all uri values if this includes working urls

alfiriel commented 1 month ago

rtsp://admin:password@192.168.xxx.xxx:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_2 is this working

No it is not

Checked all rtsp:// streams in the objects - none of them working. Only if I manually shorten them to rtsp://admin:password@192.168.xxx.xxx:554/Streaming/Channels/101?transportmode=unicast or to rtsp://admin:password@192.168.xxx.xxx:554/Streaming/Channels/101

TA2k commented 1 month ago

GitHub version has an option to overwrite snapshot url