IpCamera: New IP Camera Binding

Hi people

Thanks for working such a binding.

I have a samsung Smartcam and I was wondering if Ican use this binding to display the feed in basicUI and HabPanel. Do I have to install FFMPEG?

I can see the camera view through VLC from the link below but I couldnt figure out how to configure it in the binding.

rtsp://admin:pass@192.168.1.66:554/profile2/media.smp

Can you guys give me some hand like

  • which thing type should I chose?
  • should I enter the cam port “554” some where?
    *Do I need to create any items or can I just use the sitemap Video url= to see the camera, What would be the url in this case?

thanks

I´ve got run into a very strange problem with my Dahua cam… For some reason I can no longer get it to work with HLS streaming. The stream is no beeing created at all. And I have no idea why.
HLS stream work fine for my Reolink…

What I did:
I dumped my original setup on my Rpi4, cause it was a test setup running on SD. I wanted it to run from a SSD with the official firmware release for the Rpi4 to boot from USB.
I made a fresh openhabian install directly from SSD. Unfortunaly I forgot to create a copy of my things files, for both my Dahua and Reolink cam. So I had to start all over… No problem, I would say just takes a few minutes more…

Now I have struggled with my Dahua cam for days, and I simply cant get it to create the HLS stream at all… The setup is simular to the Reolink setup, except for the username/pw and ofcouse serverport, but still HLS wont work. FFMPEG I would say work fine, since it works from my Reolink cam. I even tried using the output path for the reolink, in case its a security issue… Still no go.
GIF snapshot works fine. JPG streaming work fine. Motion detection switch work fine. Everything seems to run just fine, except HLS streaming. I simply dont get it :unamused:

Atm I use the very latest ipcamera binding (installed yesterday).

Any suggestion on how to troubleshoot this one?

EDIT:
Just enabled Debug logging… This is what happens:

2020-07-27 19:38:39.321 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:/usr/bin/ffmpeg -hide_banner -loglevel warning -rtsp_transport tcp -i rtsp://admin:password@10.4.28.194:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4 /etc/openhab2/html/camera/dahua1/ipcamera.m3u8
2020-07-27 19:38:39.716 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://10.4.28.194/cgi-bin/snapshot.cgi?channel=1
2020-07-27 19:38:39.757 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://10.4.28.194/cgi-bin/snapshot.cgi?channel=1
2020-07-27 19:38:39.757 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [rtsp @ 0x17f8370] method OPTIONS failed: 404 Not Found
2020-07-27 19:38:39.758 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - rtsp://admin:password@10.4.28.194:554/cam/realmonitor?channel=1&subtype=1&unicast=true&proto=Onvif: Server returned 404 Not Found

This is my setup thing file:

Thing ipcamera:DAHUA:DAHUA1 "Front door" @ "Cameras"
[
    IPADDRESS="10.4.28.194",
    USERNAME="admin",
    PASSWORD="password",
    PORT=80,
    ONVIF_PORT=80,
    SERVER_PORT=54318,
    IMAGE_UPDATE_EVENTS=1,
    UPDATE_IMAGE=false,
    GIF_PREROLL=1,
    GIF_POSTROLL=5,
    IP_WHITELIST="DISABLE",

    ONVIF_MEDIA_PROFILE=1,

    FFMPEG_LOCATION="/usr/bin/ffmpeg",
    FFMPEG_GIF_OUT_ARGUMENTS="-r 2 -filter_complex scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse",
    FFMPEG_OUTPUT="/etc/openhab2/html/camera/dahua1/",
    FFMPEG_HLS_OUT_ARGUMENTS="-strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4"
]

Your camera is telling ffmpeg that the url gives a http 404 error code which means the camera is there but reporting the url is wrong. Try rebooting the camera and since you have the media profuile set to 1, make sure the substream is turned on in the cameras setup.
Also some cameras have a limitation on how many times the RTSP can be opened at the same time, if using NVR and other programs I guess that could be the result.

Yes and Yes ffmpeg is needed to do anything with a camera that only has a rtsp feed, see the readme file.

Hello,

Why is the HLS stream rotated on the Google Home Hub Display?
Good on Sitemap and VLC.

Thanks

1 Like

Try rotating it using METADATA so the video is not re-encoded, which an example is given here…

New build 2020-08-01 has these changes:

  • Multiple bug fixes around the filename and serving of gif and mp4 files.
  • New channels for recording the history of the filenames and for using with the new Widget linked below.

Camera-History

1 Like

Is there a way with the FF GIF override string to export both the GIF and individual snapshots?

I don’t know you would need to read the ffmpeg options on their website. You can do it easily by setting the preroll and that is explained In the readme under section on snapshot methods.

Does the preroll need the snapshot url to be correct? I haven’t had any luck with preroll on this particular camera.

That is possible as the answer was yes in the past but I have been changing a lot of code that means RTSP Only cameras are getting more features. Try setting the snapshot URL to be ‘ffmpeg’ with the override and switch the update image now channel to on. If that does not work I will have to look it over.

Wow, you saved me a lot of time and headache. So I set the SNAPSHOT_URL_OVERRIDE parameter equal to FFMPEG_INPUT and adjusted the GIF_PREROLL to 1. Now the GIF and snapshots are created each time Update GIF is toggled. Thanks for your help!

Marty

That’s the whole point of this binding, not forcing every user to spend hours working out how to do something with scripts and hacks. Out of interest, why does your camera not default to using a correct snapshot url? Does the camera give a non working link? For Onvif cameras it should auto setup the url, and if you leave it blank for all cameras, it should warn you in the logs and fall back to ffmpeg. What camera and why did it not default to using ffmpeg by itself?

New build 2020-08-05 has these changes:

  • @tat I added the space for you to hopefully fix motion arguments, thanks for reporting and if you can let me know if it is fixed as I have not tested it.
  • Gif and mp4 history channels now delete the oldest and add the newest to keep a max of the latest 50.
  • MP4 recordings now have audio in them by default and you can add your own ffmpeg filters to a new config. https://github.com/Skinah/IpCamera/issues/62 If you want no audio just enter -an -vcodec copy to go back to what it was in older builds.

@matt1 Thanks for acting so quickly. I can confirm that the command line is now right with the filter arguments included.

1 Like

why my camera stuck after 2 second?

So it turned out that my cameras did auto detect the correct URLs, but I think I discovered a different issue. I have two new model Hikvision Cameras (DS-2CD2385G1-I and DS-2CD2563G0-IS) both running firmware V5.6.3 build 190923, and the alarms don’t seem to come in. In the logs I see the cameras are responding as “Device Busy”, and I also see an video loss alarm that doesn’t seem to be handled properly. This log pattern is repeated every few seconds.

2020-08-07 13:25:23.869 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://10.1.1.207/ISAPI/Streaming/channels/101/picture
2020-08-07 13:25:23.890 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - Camera at IP:10.1.1.207 gave a reply with a response code of :503
2020-08-07 13:25:23.890 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<requestURL>/ISAPI/Streaming/channels/101/picture</requestURL>
<statusCode>2</statusCode>
<statusString>Device Busy</statusString>
<subStatusCode>deviceBusy</subStatusCode>
</ResponseStatus>
:


2020-08-07 13:25:55.761 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://10.1.1.202/ISAPI/Streaming/channels/101/picture
2020-08-07 13:25:55.869 [TRACE] [ing.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://10.1.1.207/ISAPI/Streaming/channels/101/picture
2020-08-07 13:25:55.895 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - Camera at IP:10.1.1.207 gave a reply with a response code of :503
2020-08-07 13:25:55.895 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:<?xml version="1.0" encoding="UTF-8"?>
<ResponseStatus version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<requestURL>/ISAPI/Streaming/channels/101/picture</requestURL>
<statusCode>2</statusCode>
<statusString>Device Busy</statusString>
<subStatusCode>deviceBusy</subStatusCode>
</ResponseStatus>
:
2020-08-07 13:25:56.092 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:--boundary
Content-Type: application/xml; charset="UTF-8"
Content-Length: 834

:
2020-08-07 13:25:56.092 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:<EventNotificationAlert version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<ipAddress>10.1.1.207</ipAddress>
<portNo>80</portNo>
<protocol>HTTP</protocol>
<macAddress>98:8b:0a:3b:7b:b7</macAddress>
<channelID>1</channelID>
<dateTime>2020-08-07T13:25:48-6:00</dateTime>
<activePostCount>0</activePostCount>
<eventType>videoloss</eventType>
<eventState>inactive</eventState>
<eventDescription>videoloss alarm</eventDescription>
<channelName></channelName>
<Extensions version="1.0" xmlns=":
2020-08-07 13:25:56.092 [TRACE] [g.ipcamera.internal.HikvisionHandler] - HTTP Result back from camera is 	:urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2563G0-IS20190331AAWRD03427750</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&amp;&amp;DS-2CD2563G0-IS20190331AAWRD03427750,2020-08-07T13:25:48-6:00,1.0</eventPush>
</Extensions>
</EventNotificationAlert>

2020-08-07 13:25:56.092 [DEBUG] [g.ipcamera.internal.HikvisionHandler] - Unhandled reply-urn:psialliance-org">
<serialNumber xmlns="urn:selfextension:psiaext-ver10-xsd">DS-2CD2563G0-IS20190331AAWRD03427750</serialNumber>
<eventPush xmlns="urn:selfextension:psiaext-ver10-xsd">IO&amp;&amp;DS-2CD2563G0-IS20190331AAWRD03427750,2020-08-07T13:25:48-6:00,1.0</eventPush>
</Extensions>
</EventNotificationAlert>
.

Is this a known issue or is something configured improperly?  I also have older Amcrest and Dahua cameras that are working as expected.

Marty

I’m trying to figure out why my binding is slow to register an intrusion alert. It works, but it just seems delayed, compared to my NVR. The only errors I’ve been able to find is the following:

11:55:40.536 [TRACE] [ding.ipcamera.handler.IpCameraHandler] - Sending camera: GET: http://<ipaddress>/ISAPI/System/IO/inputs/1/status
11:55:40.538 [DEBUG] [ng.ipcamera.internal.HikvisionHandler] - Unhandled reply-<!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>

(IP address masked)

If I open that URL in a browser, sure enough it requires username and password. If I supply the credentials, I’m presented with the following:

<IOPortStatus xmlns="http://www.hikvision.com/ver20/XMLSchema" version="2.0">
<ioPortID>1</ioPortID>
<ioPortType>input</ioPortType>
<ioState>inactive</ioState>
</IOPortStatus>

This reply is seen many times in the log also, which makes me believe that somehow it tries without credentials, fails, and then tries with credentials and gets the reply. Is that a correct behavior?

OBS. I have tried setting the authentication method to digest/basic based on a previous reply.

If you change the camera to use basic instead of digest you may find the camera does not work correctly until you restart the binding or openhab. This is because the binding will not answer for security reasons if a device or hacker downgrades the authentication to the less strong basic method.

To fault find it further you should enter in the event stream that the binding will log when first started. See if the event stream is delayed when the URL is opened in any web browser.

It may be that the camera is simply busy talking to your nvr so worth turning off the nvr to test what happens.

Hi @matt1
Can you spend a minute to look at this… I have no idea howcome I can no longer get HSL streaming to work with my Dahua cam… It used to work, but I have probably done something wrong, and now I cant get it to work anymore. My Reolink works fine.

This is what I get when have traced logged during start up of openhab:

2020-08-09 19:07:45.801 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Header/><s:Body><tds:GetSystemDateAndTimeResponse><tds:SystemDateAndTime><tt:DateTimeType>Manual</tt:DateTimeType><tt:DaylightSavings>false</tt:DaylightSavings><tt:TimeZone><tt:TZ>GMT+08:00</tt:TZ></tt:TimeZone><tt:UTCDateTime><tt:Time><tt:Hour>11</tt:Hour><tt:Minute>6</tt:Minute><tt:Second>52</tt:Second></tt:Time><tt:Date><tt:Year>2020</tt:Year><tt:Month>8</tt:Month><tt:Day>9</tt:Day></tt:Date></tt:UTCDateTime><tt:LocalDateTime><tt:Time><tt:Hour>19</tt:Hour><tt:Minute>6</tt:Minute><tt:Second>52</tt:Second></tt:Time><tt:Date><tt:Year>2020</tt:Year><tt:Month>8</tt:Month><tt:Day>9</tt:Day></tt:Date></tt:LocalDateTime></tds:SystemDateAndTime></tds:GetSystemDateAndTimeResponse></s:Body></s:Envelope>
2020-08-09 19:07:45.804 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Sending ONVIF request:GetCapabilities
2020-08-09 19:07:45.815 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - Cameras  UTC time is : 11:6:52
2020-08-09 19:07:45.818 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - Cameras  UTC date is : 2020-8-9
2020-08-09 19:07:45.824 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - Openhabs UTC dateTime is:2020-08-09T17:07:45.822Z
2020-08-09 19:07:45.877 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Header/><s:Body><tds:GetCapabilitiesResponse><tds:Capabilities><tt:Analytics><tt:XAddr>http://10.4.28.194/onvif/analytics_service</tt:XAddr><tt:RuleSupport>true</tt:RuleSupport><tt:AnalyticsModuleSupport>true</tt:AnalyticsModuleSupport></tt:Analytics><tt:Device><tt:XAddr>http://10.4.28.194/onvif/device_service</tt:XAddr><tt:Network><tt:IPFilter>false</tt:IPFilter><tt:ZeroConfiguration>false</tt:ZeroConfiguration><tt:IPVersion6>false</tt:IPVersion6><tt:DynDNS>false</tt:DynDNS><tt:Extension><tt:Dot11Configuration>false</tt:Dot11Configuration></tt:Extension></tt:Network><tt:System><tt:DiscoveryResolve>false</tt:DiscoveryResolve><tt:DiscoveryBye>true</tt:DiscoveryBye><tt:RemoteDiscovery>false</tt:RemoteDiscovery><tt:SystemBackup>false</tt:SystemBackup><tt:SystemLogging>true</tt:SystemLogging><tt:FirmwareUpgrade>true</tt:FirmwareUpgrade><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>0</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>10</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>20</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>30</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>40</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>42</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>16</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:Extension><tt:HttpFirmwareUpgrade>true</tt:HttpFirmwareUpgrade><tt:HttpSystemBackup>false</tt:HttpSystemBackup><tt:HttpSystemLogging>false</tt:HttpSystemLogging><tt:HttpSupportInformation>false</tt:HttpSupportInformation></tt:Extension></tt:System><tt:IO><tt:InputConnectors>0</tt:InputConnectors><tt:RelayOutputs>0</tt:RelayOutputs><tt:Extension><tt:Auxiliary>false</tt:Auxiliary><tt:Extension></tt:Extension></tt:Extension></tt:IO><tt:Security><tt:TLS1.1>false</tt:TLS1.1><tt:TLS1.2>false</tt:TLS1.2><tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration><tt:AccessPolicyConfig>false</tt:AccessPolicyConfig><tt:X.509Token>false</tt:X.509Token><tt:SAMLToken>false</tt:SAMLToken><tt:KerberosToken>false</tt:KerberosToken><tt:RELToken>false</tt:RELToken><tt:Extension><tt:TLS1.0>false</tt:TLS1.0><tt:Extension><tt:Dot1X>false</tt:Dot1X><tt:SupportedEAPMethod>0</tt:SupportedEAPMethod><tt:RemoteUserHandling>false</tt:RemoteUserHandling></tt:Extension></tt:Extension></tt:Security></tt:Device><tt:Events><tt:XAddr>http://10.4.28.194/onvif/event_service</tt:XAddr><tt:WSSubscriptionPolicySupport>false</tt:WSSubscriptionPolicySupport><tt:WSPullPointSupport>false</tt:WSPullPointSupport><tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport></tt:Events><tt:Imaging><tt:XAddr>http://10.4.28.194/onvif/imaging_service</tt:XAddr></tt:Imaging><tt:Media><tt:XAddr>http://10.4.28.194/onvif/media_service</tt:XAddr><tt:StreamingCapabilities><tt:RTPMulticast>true</tt:RTPMulticast><tt:RTP_TCP>true</tt:RTP_TCP><tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP></tt:StreamingCapabilities><tt:Extension><tt:ProfileCapabilities><tt:MaximumNumberOfProfiles>6</tt:MaximumNumberOfProfiles></tt:ProfileCapabilities></tt:Extension></tt:Media><tt:Extension><tt:DeviceIO><tt:XAddr>http://10.4.28.194/onvif/deviceIO_service</tt:XAddr><tt:VideoSources>1</tt:VideoSources><tt:VideoOutputs>0</tt:VideoOutputs><tt:AudioSources>1</tt:AudioSources><tt:AudioOutputs>0</tt:AudioOutputs><tt:RelayOutputs>0</tt:RelayOutputs></tt:DeviceIO><tt:Extensions><tt:TelexCapabilities><tt:XAddr>http://10.4.28.194/onvif/telecom_service</tt:XAddr><tt:TimeOSDSupport>true</tt:TimeOSDSupport><tt:TitleOSDSupport>true</tt:TitleOSDSupport><tt:PTZ3DZoomSupport>true</tt:PTZ3DZoomSupport><tt:PTZAuxSwitchSupport>true</tt:PTZAuxSwitchSupport><tt:MotionDetectorSupport>true</tt:MotionDetectorSupport><tt:TamperDetectorSupport>true</tt:TamperDetectorSupport></tt:TelexCapabilities></tt:Extensions></tt:Extension></tds:Capabilities></tds:GetCapabilitiesResponse></s:Body></s:Envelope>
2020-08-09 19:07:45.880 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - deviceXAddr:/onvif/device_service
2020-08-09 19:07:45.883 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - eventsXAddr:/onvif/event_service
2020-08-09 19:07:45.886 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - mediaXAddr:/onvif/media_service
2020-08-09 19:07:45.888 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - We hit an issue parsing url:
2020-08-09 19:07:45.891 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Camera must not support PTZ, it failed to give a <tt:PTZ><tt:XAddr>:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Header/><s:Body><tds:GetCapabilitiesResponse><tds:Capabilities><tt:Analytics><tt:XAddr>http://10.4.28.194/onvif/analytics_service</tt:XAddr><tt:RuleSupport>true</tt:RuleSupport><tt:AnalyticsModuleSupport>true</tt:AnalyticsModuleSupport></tt:Analytics><tt:Device><tt:XAddr>http://10.4.28.194/onvif/device_service</tt:XAddr><tt:Network><tt:IPFilter>false</tt:IPFilter><tt:ZeroConfiguration>false</tt:ZeroConfiguration><tt:IPVersion6>false</tt:IPVersion6><tt:DynDNS>false</tt:DynDNS><tt:Extension><tt:Dot11Configuration>false</tt:Dot11Configuration></tt:Extension></tt:Network><tt:System><tt:DiscoveryResolve>false</tt:DiscoveryResolve><tt:DiscoveryBye>true</tt:DiscoveryBye><tt:RemoteDiscovery>false</tt:RemoteDiscovery><tt:SystemBackup>false</tt:SystemBackup><tt:SystemLogging>true</tt:SystemLogging><tt:FirmwareUpgrade>true</tt:FirmwareUpgrade><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>0</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>10</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>20</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>30</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>40</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>42</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>16</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:Extension><tt:HttpFirmwareUpgrade>true</tt:HttpFirmwareUpgrade><tt:HttpSystemBackup>false</tt:HttpSystemBackup><tt:HttpSystemLogging>false</tt:HttpSystemLogging><tt:HttpSupportInformation>false</tt:HttpSupportInformation></tt:Extension></tt:System><tt:IO><tt:InputConnectors>0</tt:InputConnectors><tt:RelayOutputs>0</tt:RelayOutputs><tt:Extension><tt:Auxiliary>false</tt:Auxiliary><tt:Extension></tt:Extension></tt:Extension></tt:IO><tt:Security><tt:TLS1.1>false</tt:TLS1.1><tt:TLS1.2>false</tt:TLS1.2><tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration><tt:AccessPolicyConfig>false</tt:AccessPolicyConfig><tt:X.509Token>false</tt:X.509Token><tt:SAMLToken>false</tt:SAMLToken><tt:KerberosToken>false</tt:KerberosToken><tt:RELToken>false</tt:RELToken><tt:Extension><tt:TLS1.0>false</tt:TLS1.0><tt:Extension><tt:Dot1X>false</tt:Dot1X><tt:SupportedEAPMethod>0</tt:SupportedEAPMethod><tt:RemoteUserHandling>false</tt:RemoteUserHandling></tt:Extension></tt:Extension></tt:Security></tt:Device><tt:Events><tt:XAddr>http://10.4.28.194/onvif/event_service</tt:XAddr><tt:WSSubscriptionPolicySupport>false</tt:WSSubscriptionPolicySupport><tt:WSPullPointSupport>false</tt:WSPullPointSupport><tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport></tt:Events><tt:Imaging><tt:XAddr>http://10.4.28.194/onvif/imaging_service</tt:XAddr></tt:Imaging><tt:Media><tt:XAddr>http://10.4.28.194/onvif/media_service</tt:XAddr><tt:StreamingCapabilities><tt:RTPMulticast>true</tt:RTPMulticast><tt:RTP_TCP>true</tt:RTP_TCP><tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP></tt:StreamingCapabilities><tt:Extension><tt:ProfileCapabilities><tt:MaximumNumberOfProfiles>6</tt:MaximumNumberOfProfiles></tt:ProfileCapabilities></tt:Extension></tt:Media><tt:Extension><tt:DeviceIO><tt:XAddr>http://10.4.28.194/onvif/deviceIO_service</tt:XAddr><tt:VideoSources>1</tt:VideoSources><tt:VideoOutputs>0</tt:VideoOutputs><tt:AudioSources>1</tt:AudioSources><tt:AudioOutputs>0</tt:AudioOutputs><tt:RelayOutputs>0</tt:RelayOutputs></tt:DeviceIO><tt:Extensions><tt:TelexCapabilities><tt:XAddr>http://10.4.28.194/onvif/telecom_service</tt:XAddr><tt:TimeOSDSupport>true</tt:TimeOSDSupport><tt:TitleOSDSupport>true</tt:TitleOSDSupport><tt:PTZ3DZoomSupport>true</tt:PTZ3DZoomSupport><tt:PTZAuxSwitchSupport>true</tt:PTZAuxSwitchSupport><tt:MotionDetectorSupport>true</tt:MotionDetectorSupport><tt:TamperDetectorSupport>true</tt:TamperDetectorSupport></tt:TelexCapabilities></tt:Extensions></tt:Extension></tds:Capabilities></tds:GetCapabilitiesResponse></s:Body></s:Envelope>
2020-08-09 19:07:45.894 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Sending ONVIF request:GetProfiles
2020-08-09 19:07:46.088 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Header/><s:Body><trt:GetProfilesResponse><trt:Profiles token="MediaProfile000" fixed="true"><tt:Name>MediaProfile_Channel1_MainStream</tt:Name><tt:VideoSourceConfiguration token="000"><tt:Name>VideoSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>000</tt:SourceToken><tt:Bounds x="0" y="0" width="2048" height="1536"/></tt:VideoSourceConfiguration><tt:AudioSourceConfiguration token="000"><tt:Name>AudioSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>000</tt:SourceToken></tt:AudioSourceConfiguration><tt:VideoEncoderConfiguration token="000"><tt:Name>VideoEncoderConfig_Channel1_MainStream</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>H264</tt:Encoding><tt:Resolution><tt:Width>3072</tt:Width><tt:Height>2048</tt:Height></tt:Resolution><tt:Quality>4.000000</tt:Quality><tt:RateControl><tt:FrameRateLimit>20</tt:FrameRateLimit><tt:EncodingInterval>1</tt:EncodingInterval><tt:BitrateLimit>4096</tt:BitrateLimit></tt:RateControl><tt:H264><tt:GovLength>40</tt:GovLength><tt:H264Profile>High</tt:H264Profile></tt:H264><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.0</tt:IPv4Address></tt:Address><tt:Port>40000</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:AudioEncoderConfiguration token="000"><tt:Name>AudioEncoderConfig_Channel1_MainStream</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>AAC</tt:Encoding><tt:Bitrate>64</tt:Bitrate><tt:SampleRate>16</tt:SampleRate><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.0</tt:IPv4Address></tt:Address><tt:Port>40002</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:AudioEncoderConfiguration><tt:VideoAnalyticsConfiguration token="000"><tt:Name>VideoAnalyticsConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:AnalyticsEngineConfiguration><tt:AnalyticsModule Name="MyCellMotion" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="20"/><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="-1.000000"/><tt:Scale x="0.006250" y="0.008340"/></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule><tt:AnalyticsModule Name="MyTamper" Type="tt:TamperEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="48"/><tt:ElementItem Name="Field"><tt:PolygonConfiguration><tt:Polygon><tt:Point x="0" y="240"/><tt:Point x="0" y="0"/><tt:Point x="320" y="0"/><tt:Point x="320" y="240"/></tt:Polygon></tt:PolygonConfiguration></tt:ElementItem><tt:ElementItem Name="Transformation"><tt:Transformation><tt:Translate x="-1.000000" y="-1.000000"/><tt:Scale x="0.006250" y="0.008340"/></tt:Transformation></tt:ElementItem></tt:Parameters></tt:AnalyticsModule></tt:AnalyticsEngineConfiguration><tt:RuleEngineConfiguration><tt:Rule Name="Region1" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="4"/><tt:SimpleItem Name="AlarmOnDelay" Value="1000"/><tt:SimpleItem Name="AlarmOffDelay" Value="1000"/><tt:SimpleItem Name="ActiveCells" Value="0P8A8A=="/></tt:Parameters></tt:Rule><tt:Rule Name="MyTamperDetector" Type="tt:TamperDetector"><tt:Parameters><tt:ElementItem Name="Field"><tt:PolygonConfiguration><tt:Polygon><tt:Point x="0" y="240"/><tt:Point x="0" y="0"/><tt:Point x="320" y="0"/><tt:Point x="320" y="240"/></tt:Polygon></tt:PolygonConfiguration></tt:ElementItem></tt:Parameters></tt:Rule></tt:RuleEngineConfiguration></tt:VideoAnalyticsConfiguration><tt:MetadataConfiguration token="000" CompressionType="None"><tt:Name>MetadataConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.2.0.0</tt:IPv4Address></tt:Address><tt:Port>40020</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration></trt:Profiles><trt:Profiles token="MediaProfile001" fixed="true"><tt:Name>MediaProfile_Channel1_SubStream1</tt:Name><tt:VideoSourceConfiguration token="000"><tt:Name>VideoSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>000</tt:SourceToken><tt:Bounds x="0" y="0" width="2048" height="1536"/></tt:VideoSourceConfiguration><tt:AudioSourceConfiguration token="000"><tt:Name>AudioSourceConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>000</tt:SourceToken></tt:AudioSourceConfiguration><tt:VideoEncoderConfiguration token="001"><tt:Name>VideoEncoderConfig_Channel1_SubStream1</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>H264</tt:Encoding><tt:Resolution><tt:Width>704</tt:Width><tt:Height>576</tt:Height></tt:Resolution><tt:Quality>4.000000</tt:Quality><tt:RateControl><tt:FrameRateLimit>20</tt:FrameRateLimit><tt:EncodingInterval>1</tt:EncodingInterval><tt:BitrateLimit>1024</tt:BitrateLimit></tt:RateControl><tt:H264><tt:GovLength>40</tt:GovLength><tt:H264Profile>High</tt:H264Profile></tt:H264><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.1</tt:IPv4Address></tt:Address><tt:Port>40008</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:AudioEncoderConfiguration token="001"><tt:Name>AudioEncoderConfig_Channel1_SubStream1</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>AAC</tt:Encoding><tt:Bitrate>64</tt:Bitrate><tt:SampleRate>16</tt:SampleRate><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.0.1</tt:IPv4Address></tt:Address><tt:Port>40010</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:AudioEncoderConfiguration><tt:VideoAnalyticsConfiguration token="000"><tt:Name>VideoAnalyticsConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:AnalyticsEngineConfiguration><tt:AnalyticsModule Name="MyCellMotion" Type="tt:CellMotionEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="20"/><tt:ElementItem Name="Layout"><tt:CellLayout Columns="22" Rows="18"><tt:Transformation><tt:Translate x="-1.000000" y="-1.000000"/><tt:Scale x="0.006250" y="0.008340"/></tt:Transformation></tt:CellLayout></tt:ElementItem></tt:Parameters></tt:AnalyticsModule><tt:AnalyticsModule Name="MyTamper" Type="tt:TamperEngine"><tt:Parameters><tt:SimpleItem Name="Sensitivity" Value="48"/><tt:ElementItem Name="Field"><tt:PolygonConfiguration><tt:Polygon><tt:Point x="0" y="240"/><tt:Point x="0" y="0"/><tt:Point x="320" y="0"/><tt:Point x="320" y="240"/></tt:Polygon></tt:PolygonConfiguration></tt:ElementItem><tt:ElementItem Name="Transformation"><tt:Transformation><tt:Translate x="-1.000000" y="-1.000000"/><tt:Scale x="0.006250" y="0.008340"/></tt:Transformation></tt:ElementItem></tt:Parameters></tt:AnalyticsModule></tt:AnalyticsEngineConfiguration><tt:RuleEngineConfiguration><tt:Rule Name="Region1" Type="tt:CellMotionDetector"><tt:Parameters><tt:SimpleItem Name="MinCount" Value="4"/><tt:SimpleItem Name="AlarmOnDelay" Value="1000"/><tt:SimpleItem Name="AlarmOffDelay" Value="1000"/><tt:SimpleItem Name="ActiveCells" Value="0P8A8A=="/></tt:Parameters></tt:Rule><tt:Rule Name="MyTamperDetector" Type="tt:TamperDetector"><tt:Parameters><tt:ElementItem Name="Field"><tt:PolygonConfiguration><tt:Polygon><tt:Point x="0" y="240"/><tt:Point x="0" y="0"/><tt:Point x="320" y="0"/><tt:Point x="320" y="240"/></tt:Polygon></tt:PolygonConfiguration></tt:ElementItem></tt:Parameters></tt:Rule></tt:RuleEngineConfiguration></tt:VideoAnalyticsConfiguration><tt:MetadataConfiguration token="000" CompressionType="None"><tt:Name>MetadataConfig_Channel1</tt:Name><tt:UseCount>2</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.2.0.0</tt:IPv4Address></tt:Address><tt:Port>40020</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration></trt:Profiles></trt:GetProfilesResponse></s:Body></s:Envelope>
2020-08-09 19:07:46.093 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - String was found:MediaProfile000
2020-08-09 19:07:46.096 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - String was found:MediaProfile001
2020-08-09 19:07:46.099 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - no more to find
2020-08-09 19:07:46.102 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Sending ONVIF request:GetSnapshotUri
2020-08-09 19:07:46.111 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Sending ONVIF request:GetStreamUri
2020-08-09 19:07:46.154 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Header/><s:Body><trt:GetSnapshotUriResponse><trt:MediaUri><tt:Uri>http://10.4.28.194/onvifsnapshot/media_service/snapshot?channel=1&amp;subtype=1</tt:Uri><tt:InvalidAfterConnect>true</tt:InvalidAfterConnect><tt:InvalidAfterReboot>true</tt:InvalidAfterReboot><tt:Timeout>PT0S</tt:Timeout></trt:MediaUri></trt:GetSnapshotUriResponse></s:Body></s:Envelope>
2020-08-09 19:07:46.158 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - GetSnapshotUri:/onvifsnapshot/media_service/snapshot?channel=1&amp;subtype=1
2020-08-09 19:07:46.168 [TRACE] [nding.ipcamera.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Header/><s:Body><trt:GetStreamUriResponse><trt:MediaUri><tt:Uri>rtsp://10.4.28.194:554/cam/realmonitor?channel=1&amp;subtype=1&amp;unicast=true&amp;proto=Onvif</tt:Uri><tt:InvalidAfterConnect>true</tt:InvalidAfterConnect><tt:InvalidAfterReboot>true</tt:InvalidAfterReboot><tt:Timeout>PT0S</tt:Timeout></trt:MediaUri></trt:GetStreamUriResponse></s:Body></s:Envelope>
2020-08-09 19:07:46.171 [DEBUG] [nding.ipcamera.onvif.OnvifConnection] - GetStreamUri:rtsp://10.4.28.194:554/cam/realmonitor?channel=1&amp;subtype=1&amp;unicast=true&amp;proto=Onvif

It seems okay. But when I start HLS streaming I get:

2020-08-09 19:17:56.445 [DEBUG] [pcamera.internal.StreamServerHandler] - Stream Server recieved request 	GET:/ipcamera.m3u8
2020-08-09 19:17:56.460 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:/usr/bin/ffmpeg -hide_banner -loglevel warning -rtsp_transport tcp -i rtsp://admin:password@10.4.28.194:554/cam/realmonitor?channel=1&amp;subtype=1&amp;unicast=true&amp;proto=Onvif -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4 /etc/openhab2/html/camera/dahua1/ipcamera.m3u8

==> /var/log/openhab2/events.log <==

2020-08-09 19:17:56.467 [vent.ItemStateChangedEvent] - Dahua1Stream changed from NULL to ON

==> /var/log/openhab2/openhab.log <==

2020-08-09 19:17:56.939 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [rtsp @ 0x55a41959e0] method OPTIONS failed: 404 Not Found
2020-08-09 19:17:56.947 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - rtsp://admin:None010101@10.4.28.194:554/cam/realmonitor?channel=1&amp;subtype=1&amp;unicast=true&amp;proto=Onvif: Server returned 404 Not Found

This is my setup

Thing ipcamera:DAHUA:Frontdoor "Front door" @ "Cameras"
[
    IPADDRESS="10.4.28.194",
    USERNAME="admin",
    PASSWORD="password",
    PORT=80,
    ONVIF_PORT=80,
    ONVIF_MEDIA_PROFILE=1,

    SERVER_PORT=54318,
    IMAGE_UPDATE_EVENTS=1,
    UPDATE_IMAGE=false,
    GIF_PREROLL=1,
    GIF_POSTROLL=5,
    IP_WHITELIST="DISABLE",



    FFMPEG_LOCATION="/usr/bin/ffmpeg",
    FFMPEG_GIF_OUT_ARGUMENTS="-r 2 -filter_complex scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse",
    FFMPEG_OUTPUT="/etc/openhab2/html/camera/dahua1/",
    FFMPEG_HLS_OUT_ARGUMENTS="-strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4"
]

I know 100% sure the RTSP port is 554…

Btw… updateGif works fine as well as picture shapshot. Its just HSL which fails… And I simply cant seem to find the reason :frowning:

Does your camera auto reboot?
Try to
Reboot the camera and openhab both at the same time, does that fix it?
The logs show ffmpeg is telling you the RTSP is getting a error 404 back from the camera. This is the reason so this is camera related and may be a security feature of the camera.

Since you are using a preroll for gif that means it does not use RTSP and is using the snapshots as the source.