Closed djehrenr closed 6 years ago
There is no such option (yet). Why does the camera have the id video1 in your setup?
So I’m using v4l2loopback which takes the ffmpeg source video0 and then creates video1 and video2. This allows me to use both the CCTV software MotionEye and the Rpi Camera with HomeKit at the same time. I found a another Homebridge plugin that was similar to yours and allows me to select the source, but your implementation seemed to work better.
I use -input_format h264
so that ffmpeg uses the hardware accelerated encoding of the pi camera. This option might not work with v4l2loopback and if it does it conflicts with motion(eye) which uses mjpeg
.
To test it you could change the id in CameraSource.js
.
May I add that in order to be able to use the HW encoding acceleration, FFmpeg has to be compiled with the omx
parameters (OpenMAX H.264 GPU acceleration driver):
cd /home/pi/
sudo apt-get install libomxil-bellagio-dev -y
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
sudo ./configure --ach=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree
Then if you have an RPi 2 or 3:
sudo make -j4
Or, for RPi 1 or Zero:
sudo make
And finally:
sudo make install
This worked like a charm for me. The video is very smooth in the Home app. As this is not explained in your installation process, I suggest you may add these steps.
This is not required for this setup. OMX is used when ffmpeg does the encoding but this project uses the ability of the camera driver to perform the (accelerated) encoding. This saves the extra dependencys and has the same performance (or better).
@djehrenr any progress on this? Maybe using a omx-ffmpeg based solution (e.g. this) could solve your problem?
So, I had to take a break, I spent all last weekend trying to figure out a solution. Yesterday, I decided to see if I could "stream" the feed from an IP address. This worked using camera-ffmpeg. Normal latency and I can still use motion eye. My next step in all of this is to now make sure I'm doing this securely. Thank you for your help!!!
Is there a parameter in the config file that I could assigned a specific ffmpeg source? It defaults to /dev/video0/ but I would like to change it to /dev/video1.