Hey there,
a few weeks ago, I bought a Reolink Cam and integrated it into my setup.
Now i’m trying to build an own cam, based on Raspberry Pi and a PiCam 3, but I cannot get a working setup.
I tried MotioneyeOS, but it was not able to catch the stream, since it doesn’t work with the PiCam3 (afaik).
Currently, i’m experimenting with “raw” libcamera-vid
But also no luck till now.
I would like to have a “dump” cam, that streams via rtsp or anything else, into HA / Frigate.
Anybody here with a working setup like that? Some hints from working concepts would be nice.
Thank you.
Update #1: I was able to create a stream and consume it in VLC with libcamera-vid, but it was very instable and i was not able to get it into HA.
Update#2: I found two ways to make it work:
- I was able to get it work with an mediamtx docker container for pi
- It is possible with motioneye (dev branch, which supports python3) on bullseye and a workaround, currently working on Pi 3B, i will test it on Zero later
If everything works, i will add more details how i got it to work, maybe somebody can use the info
Update #3 - Solution
Motioneye: The motioneye solution does not work good with Pi Zero (i don’t have a Zero 2). Also, the workaround seems to “brick” the WebGui and a had a lot of trouble with that. The last argument is the high cpu usage by motion and motioneye. I would not recommend that way!
got2rtc: During my research i have found another solution. go2rtc is easy to setup and can be used in a few seconds by creating a .yaml and use something like exec:libcamera-vid -t 0 --inline --listen -o -
This will use the PiCam and create different streams you can use anywhere else.
The downside of this solution is that you are not able to add a timestamp so easily. At least i was not able to do it, since you would need to use ffmpeg for that. Also, i read that this way would increase the CPU load a lot, which is not good with a Pi Zero
mediamtx: At the end i went with mediamtx, but without a docker installation. It has default support for PiCam3. You only have to change
paths:
all:
source:publisher
to:
paths:
cam:
source: rpiCamera
and it already works. If you want to add a timestamp, just change
rpiCameraTextOverlayEnable: true # This is false by default
rpiCameraTextOverlay: '%Y-%m-%d %H:%M:%S - Cam1' # This is there by default
That’s it, works good for me. I will test this now long term and see what’s going to happen.