Amcrest/Dahua Camera Plugin streaming and PTZ for openLuup/ALTUI
-
Good question. I never thought about putting it up there because nobody asked. I certainly could post it there.
The setup is very straightforward. Just put in the IP of the camera (it's a device attribute) and the credentials (these are variables) and it should work after a luup reload:
I am using it to control preset positions PTZ so it changes position depending on time of the day. -
-
Ohh my gosh, shame on me... It turns out the version posted on github is not even the latest version I am running. I will be reposting in a few minutes.
Edit: And now it should be much better. I also published the plugin on the AltAppStore.
-
Ok, I think I have now a pretty good idea of what happened. It would be helpful if you could look at your logs to find out what the error is though.
The issue seems to be that my installation of openLuup is not quite "vanilla" as I have made a few minor modifications to it and am also running it on LuaJIT along with some additional libraries instead of the standard Lua5.1 interpreter. I will make a minor edit to try to fix it.
Please try it and report back with what error you see in the logs if any.You can look into the openLuup section of the forum to see what changes I made to my openLuup installation. I basically decreased the CPU load by >75%
https://smarthome.community/topic/151/rapidjson-instead-of-cjson-and-dkjson
https://smarthome.community/topic/179/luajitOnly change is to the L_Amcrest.lua file so you can just replace that file in your installation and reload.
-
Ok, I think I have now a pretty good idea of what happened. It would be helpful if you could look at your logs to find out what the error is though.
The issue seems to be that my installation of openLuup is not quite "vanilla" as I have made a few minor modifications to it and am also running it on LuaJIT along with some additional libraries instead of the standard Lua5.1 interpreter. I will make a minor edit to try to fix it.
Please try it and report back with what error you see in the logs if any.You can look into the openLuup section of the forum to see what changes I made to my openLuup installation. I basically decreased the CPU load by >75%
https://smarthome.community/topic/151/rapidjson-instead-of-cjson-and-dkjson
https://smarthome.community/topic/179/luajitOnly change is to the L_Amcrest.lua file so you can just replace that file in your installation and reload.
-
@rafale77 said in Amcrest/Dahua Camera Plugin streaming and PTZ for openLuup/ALTUI:
I basically decreased the CPU load by >75%
...although, it has to be said, from a pretty small starting level anyway?
-
Ok, I think I have now a pretty good idea of what happened. It would be helpful if you could look at your logs to find out what the error is though.
The issue seems to be that my installation of openLuup is not quite "vanilla" as I have made a few minor modifications to it and am also running it on LuaJIT along with some additional libraries instead of the standard Lua5.1 interpreter. I will make a minor edit to try to fix it.
Please try it and report back with what error you see in the logs if any.You can look into the openLuup section of the forum to see what changes I made to my openLuup installation. I basically decreased the CPU load by >75%
https://smarthome.community/topic/151/rapidjson-instead-of-cjson-and-dkjson
https://smarthome.community/topic/179/luajitOnly change is to the L_Amcrest.lua file so you can just replace that file in your installation and reload.
-
Ok, we are a step further. All variables are there now. Firstly, there is a small error in the DirectStreamingURL though. The brackets should not be there.
I have removed them, but still no image.
This is the only thing I get in the log:
2020-11-22 09:56:05.011 luup.variable_set:: 93.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 0 now: 0 #hooks:0 2020-11-22 09:56:05.011 openLuup.scheduler:: [93] Lobo device startup completed: status=true, msg=Ready, name=Lobo 2020-11-22 09:56:05.011 openLuup.scheduler:: [297] Amcrest Dahua device startup 2020-11-22 09:56:05.011 luup.set_failure:: status = false 2020-11-22 09:56:05.011 luup.variable_set:: 297.urn:micasaverde-com:serviceId:HaDevice1.CommFailure was: false now: false #hooks:0 2020-11-22 09:56:05.011 luup.variable_set:: 297.urn:micasaverde-com:serviceId:HaDevice1.CommFailureTime was: 1606035145 now: 1606035365 #hooks:0 2020-11-22 09:56:05.011 luup.variable_set:: 297.urn:micasaverde-com:serviceId:HaDevice1.Commands was: camera_full_screen,camera_left,camera_right,camera_up,camera_down,camera_preset,camera_zoom_in,camera_zoom_out now: camera_full_screen,camera_left,camera_right,camera_up,camera_down,camera_preset,camera_zoom_in,camera_zoom_out #hooks:0 2020-11-22 09:56:05.011 openLuup.scheduler:: [297] Amcrest Dahua device startup completed: status=, msg=, name= 2020-11-22 09:56:05.012 luup_log:3: ALTUI: UPNPregisterDataProvider(3,Vera@192.168.1.14,http://127.0.0.1:3480/data_request?id=lr_HTTP_VeraBridgeMirror_192.168.1.14,[{ "default":"device.serviceId.name", "key":"mirror", "label":"Mirror", "type":"text" }]) 2020-11-22 09:56:05.012 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.DataStorageProviders was: {"emoncms":{"url":"","callback":"sendValueToStorage_emoncms","parameters":[{"default":1,"type":"number","key":"node... now: {"Vera@192.168.1.14":{"url":"http://127.0.0.1:3480/data_request?id=lr_HTTP_VeraBridgeMirror_192.168.1.14","callback... #hooks:0 2020-11-22 09:56:05.012 luup_log:3: ALTUI: UPNPregisterPlugin(3,urn:schemas-toggledbits-com:device:SiteSensor:1,J_SiteSensor1_ALTUI.js,SiteSensor_ALTUI.DeviceDraw,,,,SiteSensor_ALTUI.Favorite) 2020-11-22 09:56:05.016 luup.variable_set:: 3.urn:upnp-org:serviceId:altui1.PluginConfig was: {"urn:schemas-micasaverde-com:device:PowerMeter:1":{"DeviceDrawFunc":"ALTUI_PluginDisplays.drawPowerMeter","ScriptF... now: {"urn:schemas-micasaverde-com:device:PowerMeter:1":{"ScriptFile":"J_ALTUI_plugins.js","DeviceDrawFunc":"ALTUI_Plugi... #hooks:0 2020-11-22 09:56:05.017 luup_log:3: ALTUI: UPNPregisterPlugin(3,u
BTW I have tried the complete URL in the browser and that works.
-
Good news is that the plugin code is executing.
Stating the obvious but, did you check that the ip address and the credentials are setup?
It is working fine here (with the brackets). The display of the stream/snapshot is actually done by ALTUI. depending on the browser you use, it may buffer a bit strangely.