Generic camera wasn’t deprecated, just configuring generic camera in the configuration.yaml file. I thought that my issue was just a front-end issue and that I could use the generic camera by bypassing the web and configuring the rtsp stream directly. However, I now understand that the problem was that a python package was failing to install because of a C compilation problem.
Is there a way to use an RTSP stream (or motion jpeg) that doesn’t involve the generic camera integration? Because the one thing I know for sure is that the RTSP stream for the second camera works fine when I test it outside of homeassistant.
I tested the RTSP outside of homeassistant and it works fine. My problem is that the generic camera integration doesn’t work for me, because it relies on a deprecated and now removed constant AVFMT_FLAG_PRIV_OPT in ffmpeg. Because I’m using a rolling release distribution (arch linux arm), I probably have too new a version of ffmpeg.
Well, I made some progress, but am not there yet. First issue was getting generic camera to allow me to attempt to add one, which means getting ha-av to install on arch linux arm. ha-av is not compatible with ffmpeg 6, so I downloaded ffmpeg-2:5.1.2-2-armv7h.pkg.tar.xz from the ad24 arch linux arm archive and installed it with the command sudo pacman -U ffmpeg-2:5.1.2-2-armv7h.pkg.tar.xz. [If you are reading this post significantly after March, 2023, or not running arch linux arm, or if the integrations page will let you add a geneneric camera, you can skip this step and proceed with ffmpeg 6 or whatever is installed on your system.]
The next issue was just getting an RTSP stream that worked for me. I checked this on my desktop by running mpv rtsp://username:password@my-cam.lan/axis-media/media.amp?camera=2 until I found the camera number that I wanted (2 in this case). More information on URLs for accessing Axis cameras is available in Axis’s VAPIX documentation. I was similarly able to get a still image by visiting http://my-cam.lan/axis-cgi/jpg/image.cgi?camera=2 in my browser.
Unfortunately, now when I go to add the generic camera, no matter which options I try (and to anyone reading I highly recommend you not try basic authentication rather than digest), the dialog comes back with “Unknown error occurred.” I’m using the same URLs I tested with my browser and mpv, just without the username and password which have their own fields in the dialog.
Yup, and that one works great, so we have a winner. Thank you!
Just for the record, the video URL is http://my-cam.lan/axis-cgi/mjpg/video.cgi?camera=2 and the still URL is http://my-cam.lan/axis-cgi/jpg/image.cgi?camera=2.