Amcrest/Dahua Camera Plugin streaming and PTZ for openLuup/ALTUI
-
-
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. -
Could you provide a screenshot of your attribute screen as well as a list of all your variables? I really have no idea why it isn't working for you. I even just added a camera to my openLuup setup and had no problem so something else is different. Are you seeing the camera control screen? Can you send commands to the camera like pan and tilt? What browser are you using? Can you try a different browser?
-
Ok, youre right, the plugin seems to work. I have tested with an other Amcrest model and that one does work. So the problem lies in the older models I have, that's a pity. I will have to do it through zoneminder then.
The PTZ does not seem to work however for my model.
I'm getting this error:
Unknown control type:js_button. See Debug
-
I'd be happy to improve the plugin to support more cameras if I can.
If the url is correct and the video is not working it is likely because the codec is not supported by the browser. If you tell me what camera it is, I will take a look.The error you are seeing about the button is not normal. I will take a look as well. This command is in javascript and is done by ALTUI. I don't believe it is in the plugin code but will check.