How to access multiple video sources from the same camera

I’ve got a camera (Axis P3717) that has four cameras internally. I would like to be able to show snapshots from the different video sources in my cards. Is there some way to do this? The axis integration forces me to chose one when adding the camera, and then there’s only one camera.my-cam entity, which shows that view.

Is it possible to add the same device multiple times with different video sources, so that homeassistant thinks it’s two different devices? When I try to do this from the front-end I get an error about the device already being added, but maybe there’s some hack like create different credentials on the device?

Thanks for any advice.

I do have an rtsp URL I can use to view the other cameras in my camera. Unfortunately, either the Axis integration or something else prevents me from adding a generic camera. If I go to the Integrations page and add a generic camera it just says “Please wait, starting configuration wizard for Generic Camera” and sits there spinning forever. I guess I’ll investigate further. I can’t find any kind of error messages in any log files, so am not sure where to start.

Use blue iris. It can handle any rtsp camera you want, then use the blue iris integration to get it into ha.

That’s kind of silly because I know homeassistant can handle rtsp natively, it’s just some bug preventing the camera integration from loading. Installing blue iris would add a huge amount of complexity to work around the bug, and so could well trigger other bugs, especially since Blue Iris is not even open source and I doubt runs on a Raspberry Pi.

Having the ability to record camera footage is far less silly than your speculation of bugs in a system you clearly know nothing about.

Best of luck with the native live feed. That works like crap on an rpi, promise.

Huh? What does this have to do with recording? My camera recording works just fine and doesn’t require blue iris or homeassistant. However, I like to organize my dashboards such that there’s a camera view above entities that affect that area. This works just fine with seven different cameras right now, and I wanted to add an eighth view which is just a different view from a camera that is already working.

Blue iris could be useful as an NVR and setup console if I didn’t already have 7 working cameras, but it would be silly to switch over just because of some weird bug where I can’t add a generic camera. It’s not like I’m providing the parameters of the camera and it doesn’t work. It’s like I literally can’t even get to the first screen because I’m stuck on this:

For all I know the blue iris integration would have the same problem, but I can’t even test that because it doesn’t come native with homeassistant.

1 Like

Then if you already have an nvr, why are you trying to access the camera directly?

Also - lol @ it doesn’t come native with ha. Of course it doesn’t. But you can still test it for free, you just need to actually go read instead of crap on a good idea.

Because I want to see the camera in the homeassistant front-end. Both the camera and homeassistant are on the same network. Homeassistant has to interact directly with the camera anyway for various other reasons like automations.

I literally have an RTSP URL that will show me what I want to put in a card, which should be simple. Why would I want to depend on an entire third-party integration just to show me a picture or video in software that can already do this? Worst-case, it’s probably easier to configure the generic camera by editing files in .homeassistant than to install a whole local NVR. The problem is generic camera in configuration.yaml has been deprecated, so none of the documentation will tell me what to put in there.

Try restarting or clearing your cache, because you should be able to add it as a generic camera. If you are just getting the please wait dialog for longer than reasonable, something is wrong with your installation. You should get a dialog with a place to set up a still image url, a rtsp etc, like this

1 Like

I’ve restarted homeassistant multiple times. I’ve also tried logging in with a brand new browser with a new home directory, to guarantee nothing weird was being cached browser side.

I guess the problem is that it’s attempting to install software and failing, but then rather than report the error it just hangs forever. These are possibly the relevant syslog entries:

Mar 25 23:44:03 rpi homeassistant[28364]:   ERROR: Failed building wheel for ha-av
Mar 25 23:44:03 rpi homeassistant[28364]: ERROR: Could not build wheels for ha-av, which is required to install pyproject.toml-based projects

It seems to be dying when compiling src/av/container/core.c because of an undeclared identifier AVFMT_FLAG_PRIV_OPT. Hmm… I know C, but I have no idea how to fix things inside pip inside homeassistant.

What is your install method?

Home assistant core. Just “pip install homeassistant” after creating a virtualenv. I know that’s not supported so I can’t file a bug report.

Look like you are missing the AV packages, I don’t have Home Assistant core, but hopefully these links may help.

My point is that there are a LOT of NVRs out there that integrate with HA - BlueIris among them - and then you can view whatever camera you like from the NVR in HA without the need to directly access the camera from HA. In addition, you can get a whole host of other information exposed for use, depending on what is made available by the NVR (motion detection, object detection, ALPR, etc).

Regardless, you seem hellbent on trying to use a deprecated method of getting less information than you otherwise could, possibly even with the NVR you currently have (which I don’t see that you’ve identified).

Best of luck with whatever you choose, I’m out. :slight_smile:

Yes it is supported Installation - Home Assistant

For some reason though it is trying to build a wheel instead of finding a pre-built one for ha-av. What version of python? What architecture?

When was generic camera deprecated?

I’m sure your system works well for you. My system works well for me, except for this new situation where it would be nice to have an extra picture in my cards, and I need to figure out why I can’t install the generic camera integration. I have a very tight integration between home assistant and my cameras. For example, one of my cameras is right near an outdoor PIR curtain detector, so I need to disable IR illumination whenever the alarm is set for that zone, and reenable afterwards when the alarm is disarmed (or alarming). I also have various automations for things like lights when I cross certain lines. The fact that axis fence guard shows up as a native homeassistant entity automatically makes these very easy to set up and debug. When my doorbell rings or people loiter in front of my house, I can send myself an android notification with a picture and pre-selected actions like unlocking the gate (via gpio integration) and playing a recording asking a delivery person to leave the package inside the gate (via shell integration). Some of my automations involve combining state from multiple different integrations. For example, I have a helper input_boolean that’s true if I returned home in the last 5 minutes based on presence detection. If that’s the case, and it’s night, and a particular axis fence guard event has fired, then I turn on a particular set of lights.

I’m sure it’s possible to do all of these things using a closed source NVR. The NVR may even be better at some of them. But the fact is that homeassistant works really well for me, and I know how to use it, and I prefer to use open source when practical. I’m sure there would be other annoyances trying to integrate an NVR with my setup. Your point is noted that Blue Iris is a really nice NVR, and it might work for some people, but it’s not what I’m going to use, and since this is the homassistant forum, let’s get back to talking about how to solve this with homeassistant.

As for which NVR I use, well the cameras themselves already store one copy of the video on their SD cards, so anyone who breaches my house can destroy that copy by destroying the camera (or the house). So it only makes sense for my second copy to be off premises, and since it’s probably not too hard to tie my forum handle to my real identity, I’d rather not disclose the particular service that I use, other than to say I still want homeassistant to work with my cameras when the Internet is down, which wouldn’t be the case with that service. For anyone seeking a service, I don’t really like my service enough to recommend it–just google “axis cloud nvr” to find a bunch of mostly equivalent vendors, probably all of them less slick than Blue Iris–but the point is I hardly need to use it because unless my cameras are destroyed, I get everything I need between homeassistant and the axis firmware itself.

I’m using Python 3.10.10, but the issue is more the C compiler and header files. I’m using archlinux arm on a Raspbery Pi 4b, but in 32-bit mode (armv7l) because a long time ago I couldn’t get the GPIO inputs to work in 64-bit mode. I’m willing to migrate to 64-bit if the raspberry pi gpio integration supports input now. (It used to depend on some deprecated trigger mode configuration through the /sys file system that wasn’t available in the 64-bit kernel.) I could also bite the bullet and just use an esphome for inputs, but I don’t have WiFi when the power is down. (The inputs are for a latch monitor, so I can lock electric strikes as soon as a gate is opened. The stikes are on a UPS, but I could just use a backup timer or something.)

In general, homeassistant always compiles things from C/C++ source when I upgrade. I’m a C++ developer, so could probably fix the issues in the code, but I don’t know that much about the Phython ecosystem unfortunately. In particular, I’d need to be able to restart the build process after editing the source code, and have no idea what’s going on inside homeassistant and pip. I’d love any pointers for this, or for using pre-compiled libraries to speed upgrades. Archlinux arm uses rolling releases, so precompiled binaries might not work. Periodically I have to force homeassistant to recompile everything if I upgrade and no longer have an old shared library it linked against.

It’s possible that if something else is accessing the RTSP stream already that the camera simply isn’t capable of handling another stream. If that’s the case, you can try to use an RTSP proxy like this one and have all the things that need the RTSP stream access the proxy, and only have the proxy connect directly to the camera.