[RELEASE] Amcrest IPM-721 & IP2M-841 LIVE Video/PTZ/Night Vision/Motion/Video Record/+More IP Camera DTH

Note to @pmjoen, @Chaz, @Awestun, @Roadrider, @e8link, @slapshot25, @thedjm, @jasonrwise77 and anyone else who may be interested.

A update has been published.

I was unable to test the public DDNS name resolution but the code has become pretty common so it should work.

Here are the items added:

2017-01-18: v2.3.0

  • Fixed the HostName resolution
  • Allow user-defined RTSP port
  • Allow for multi-camera HDCVI systems (e.g. 4-camera AMDV7204-4B: just pick channels 0 through 3 and set up as individual cameras, thx to JBethancourt)
  • Updated debugging code for readability (thx to ady624 for the formatting code)
  • Changed the default state of recording to “Auto” instead of “Off”
  • Added a function (queryMotion) to return ON/OFF based on current state.

I will update the first post with the details once I have confirmation that this resolves the issues recently reported (thx for being my beta testers :wink: )

Let me know if you have any issues with this change and thank you for your patience and enjoy!

p.s.
@ElwoodBlues, I tried the test with SHM and confirmed that this is “private” functionality that ST does not expose to the device programmers. It does not appear that this will be free functionality.

2 Likes

Not sure if anyone else is seeing this but with the new version when I tap on the toggle motion detect icon, it changes color (gray/green) like before but the feature doesn’t actually toggle the camera motion detect feature on and off. It did work with the old version.

Found the issue.

There seems to be a few things wrong with the convert to ip address.

You are missing the contenttype from these lines:
uri: “http://dns.google.com/resolve?name=” + hostname,
contentType: ‘application/json’

Also there is a typo in Rboy’s code and

isIPAddress should be isIpAddress.

With those changes I can get snapshots to work but still no live video - probably setup issue although it use to work

Awesome! Thx @jjslegacy!

Changes have been committed.

@jjslegacy, did you go into the configuration in the DTH and enter in the RTSP port? This is a new field so it may be failing on the RTSP port not being set, if that is the stream option you are using.

@Roadrider, same question/suggestion. Try refiling your configuration with the new prompts to make sure everything is entered and try again.

I did add the rtsp port but I don’t have that forwarded - I was just trying mjpeg streams. It just spins forever and nothing obvious in the logs.

Yep… it’s a bug… I’m working on it now…

There is still something wrong with the convert hostname. Too distracted to figure out which line but replace the matching section with this:

if (response.data?.Status == 0) { // Success
            for (answer in response.data?.Answer) { // Loop through results looking for the first IP address returned otherwise it's redirects
                //log.trace "Processing response: ${answer}"
                if (isIpAddress(answer?.data)) {
                    log.trace "Hostname ${answer?.name} has IP Address ${answer?.data}"
                    return answer?.data // We're done here (if there are more ignore it, we'll use the first IP address returned)
                } else {
                    log.trace "Hostname ${answer?.name} redirected to ${answer?.data}"
                }
             }
             }

The problem for that issue is in the return line… I already have that fixed (I believe). I am getting a constant reboot on my camera that I am trying to track down.

Change your version from “return answer?.data” to “return result?.data” and it should be fine.

2017-01-19: v2.3.2

  • Fixed a typo in the return value for ‘convertHostnameToIPAddress’.
  • Also, ST revoked S3 access so snapshots are no longer functional.
  • Also, I separated the camera channel from the video channel, so your configurations must be refiled!

RTSP streaming works on my cameras, but MJPEG does not. I am not sure if this is related to the ST security changes being made right now, but I do know that snapshots will no longer work as ST took away the S3 access.

I have to head out for the night, but I will check back in as time allows.

1 Like

Not that it matters but this needs updated :slight_smile:

def appVersion() {
return “2.3.1”
}

Also why am I still able to see/use snapshots? Shouldn’t that be broke?

LOL! Thx! :wink:

“See” is cached… “use” as in take new snapshots? That should not be working.

Will it work with the AMCREST 8CH DVR?

Installed new DTH and still can’t access video:

e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:01:23 PM: info configure -> Executing
e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:01:23 PM: info ‘updated()’ called…
e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:01:23 PM: info configure -> Executing
e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:01:23 PM: info ‘updated()’ called…
e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:00:38 PM: info ¦¦¦¦ ipIsLocal -> Host IP ‘xx.xxx.x.xxx’ is Public
e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:00:38 PM: info ¦¦¦¦ convertIPtoBinary -> IP address passed in is xx.xxx.x.xxx and the converted binary is xxxxxxxxxxxxxxxxx
e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:00:38 PM: info ¦±- videoStart -> Streaming MJPEG video; apiCommand = /cgi-bin/mjpg/video.cgi?channel=0&subtype=0, IP = xx.xxx.x.xxx, Port = xxxx
e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:00:38 PM: info ±-- videoStart -> camVideoChannel = 0, state.camVideoChannel = 0, camChannelModString =
e3dea4f0-7c1b-4851-aee3-ab9740bb0b8e 1:00:38 PM: info videoStart -> Turning Video Streaming ON

Are you quite sure the video channel is “0”?

Just for giggles, try changing “camVideoChannel” to “1” in the configuration and try again.

Same issue

Try changing to RTSP with channel 1… that is working for me but I can not get MJPEG working at the moment. It is unclear to me if this is a ST issue with MJPEG or not.

I am using an IOS app IP Cam Viewer that allows me to stream MJPEG for this camera.

I have no doubt that MJPEG viewing is possible… the Amcrest Web View app will allow viewing just fine. So will Blue Iris.

My point is that the live streaming is being handled by the ST API and I can not seem to get that to work with MJPEG, but RTSP is working.

Do you know how I make it use RTSP?

Make sure you have a value (typically 554) defined for the “camRTSPPort” parameter then touch the bottom right tile on the DTH screen that says “MJPEG”. It should switch to “RTSP”. Then hit play.

Let me know how you make out.