What's The Dealio with Amcrest Cameras?

Also having the same issue. Any ideas other than forcing aiohttp back to 1.2? I’m running on snapstream right now and it’s just not snappy enough at all.

Guys, I filed a new issue with the Amcrest cameras with the live streaming.

It seems that the new firmware requires HttpDigestAuth however the streaming is using aoihttp.HttpBasiAuth which is causing 401 errors on the streaming url.

I created this issue https://github.com/home-assistant/home-assistant/issues/7398 to check if we can modify it.

Currently using the newer firmware, I’m using snapshot as streaming for now too. Not perfect, but it is a workaround.

@pvizeli do you know if is possible to do HttpDigestAuth on aiohttp?

Guys, I spent some time trying to make it work, however after some researching it seems that due to the HTTPDigest auth, aiohttp cannot be used yet. Please let me know if I’m wrong here.

Looking other codes like camera/generic.py, camera/mjpeg.py it seems to behave the same way.

Having said this, I kept the sensor/amcrest configured for the automation and motion_sensor but for the camera component I’m using camera/ffmpeg which is working great. Basically the configuration was:

# camera.yaml
#- platform: amcrest
#  name: "Amcrest Backyard"
#  host: !secret amcrest_backyard_host
#  username: !secret amcrest_backyard_username
#  password: !secret amcrest_backyard_password
#  port: 80
#  resolution: high
#  stream_source: snapshot

- platform: ffmpeg
  name: "Amcrest Backyard"
  input: !secret amcrest_backyard_ffmpeg_url

Where the input will look like this:

rtsp://:@/cam/realmonitor?channel=1&subtype=1

Sorry about this guys. Let’s keep working to make it transparent for Amcrest component, but I think we will need to wait a little bit.

I’ve updated the https://github.com/home-assistant/home-assistant/issues/7398 as well.

1 Like

Thanks tchellomello for the continued support!

I’ll update tonight or tomorrow and report back. I’m also playing with HADashboard as well so that’s giving me fits :rage:

Well…

I can’t get my AT&T gateway to work via UPnP so no rtsp for me. Googling for a bit shows this gateway does not support UPnP and all my attempts to port forward TCP & RTSP have been unsuccessful. I setup the port forwarding and return to the configuration for Amcrest and hit refresh for UPnP and receive “Mapping Failed” every time.

I can however use the following:

http://admin:[email protected]/cgi-bin/mjpg/video.cgi?[channel=0]&subtype=1

With this though, I only receive the substream via MJPG and is limited to 640x480, not ideal.

Any suggestions?

hm… why do you need uPNP when you have direct access internally on your network?

No DigestAuth will not work with aioHTTP. I hope some one will add this. That is a big point of my wishlist.

When I try to access the RTSP URL nothing works. So i looked into the Amcrest settings and found the UPnP setup and figured I needed to this.

But that’s what i see, mapping failed. I’m at a loss.

Hello guys,

The support to rtsp was introduced on version 0.45.

You can check the docs at https://home-assistant.io/components/camera.amcrest/ . The configuration for rtsp streaming would be something similar with below:

- platform: amcrest
  name: "Amcrest Driveway"
  host: !secret amcrest_driveway_host
  username: !secret amcrest_driveway_username
  password: !secret amcrest_driveway_password
  port: 80
  resolution: high
  stream_source: rtsp

Thanks everyone

Did you ever get this working? I’m having a similar problem.

I just updated to 0.45 and setup this configuration in my yaml file. I get the still image for the camera, but when I click on the still I get a broken image icon for the stream. I checked my UPnP settings on the camera and it shows “Mapping Failed” just like FrenchToast. Is there additional setup that needs to be done on the camera side to get RTSP working?

Hello guys,

I don’t think you need UPNP enabled for the RTSP to work especially if you are on the same network.

Did you guys try to run the command directly via ffmpeg on the shell? Try also using the low resolution.

mmello

Sorry guys, been a little absent lately.

I did not get the RTSP working prior to the 0.45 release. I’ve yet to upgrade to the latest release but I plan to this week.

@shivan
Did you follow the FFMPEG instructions tchellomello hinted at in the amcrest component page?

I have rtsp setup working on my Amcrest IP2M-841W with this config, not using the specific component.

It is still very slow to update the feed though. It helps a bit on lower settings as defined in the camera stream setup in the camera itself.

ffmpeg:
  ffmpeg_bin: /usr/bin/avconv

camera:
  - platform: ffmpeg
    input: rtsp://user:password@cameraIP:554/cam/realmonitor?channel=1&subtype=0
    name: lounge
1 Like

@skptic Is your camera on WiFi? If so, try to set the subtype=1 to a lower resolution which should help to render the image faster.

My wifi cameras take a long time to render when using the subtype=0.

Nope, hadn’t done that. Got it going now.

RTSP for Amcrest wasn’t supported before 0.45, so hopefully updating to that will get you going.

Got it working after FrenchToast pointed out the ffmpeg note to me. Thanks for your hard work getting something that works going.

1 Like

Great news!

I got busy last night and still haven’t updated but plan to tonight as well as changing configuration to ffmpeg.

@skptic

Why are you using the ffmpeg camera component rather than the amcrest via rtsp? I thought the ffmpeg binary install took care of the dependencies?

@FrenchToast I get this error constantly in my HA logs using the component:

2017-05-23 13:07:44 WARNING (Thread-3) [requests.packages.urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', BadStatusLine("''",))': /cgi-bin/snapshot.cgi?channel=1

However it seems fine when using the generic camera and specifying the address myself.

@tchellomello I tried with both Ethernet and WiFi and still find the response slow to load. Running on RPi3.
BTW, your HA sensor integration for the motion is super useful :thumbsup:

1 Like

Welllll.

I updated to 0.45.1 and installed the dependencies for ffmpeg. I then updated my configuration for high resolution and rtsp and was super stoked to see a nice image. That lasted for 3 seconds and the image turned green and froze.

I then reduced image quality to low and was greeted by a SUPER blurry image. I played around with a few other settings and ultimately returned back to high resolution snapshot.

I’m running an IPM-HX1B as just an indoor camera monitoring my great room as well as a few entry/exit points to the house. I’d like to be able to stream via rtsp on high with little lag as I had played with an Android IP cam and worked flawlessly, but I’ll wait for some replies and outside insight.

@skptic I also get weird errors in my log related to the amcrest component but ignore them.