Luke Hoersten
Aug 24 · 2 min read

Wyze Cams are inexpensive and awesome web cams. Unfortunately Wyze wont support Apple HomeKit on the current cameras. An alternative is to use Homebridge on a Raspberry Pi to “bridge” the cameras into HomeKit.

The key to a successful setup is hardware accelerated video transcoding on the Raspberry Pi GPU.

Hardware Acceleration Notes

  • The Raspberry Pi supports hardware accelerated video processing on GPU using OpenMAX (omx).
  • The RTSP video stream needs to be transcoded on the Pi to make it work with HomeKit.
  • Homebridge uses ffmpeg to transcode the video stream and ffmpeg comes compiled with omx support on Raspbian Buster.
  • The Raspberry Pi 4 has a lot of hardware updates to support higher bandwidth video processing. This may also work on older Raspberry Pis. The RPi 4 supports H.265 (4kp60 decode) and H264 (1080p60 decode, 1080p30 encode).
  • While live streaming with the setup described here, memory usage peaked at 200Mb and CPU peaked at 50% on a single core.

Prerequisites

  1. Install the Wyze Cam RTSP firmware
  2. Get a Raspberry Pi 4 B 1GB with Raspbian Buster or newer
  3. Install Homebridge

Setup

This is where experimentation was needed to find a successful setup.

On the Raspbian Buster apt repos all dependencies are ready to go with no custom compiling required.

Install the following packages with the respective package manager:

  • apt: libavahi-compat-libdnssd-dev
  • apt: ffmpeg — on Raspbian Buster, this package is already compiled with the OMX video codec needed for GPU support.
  • npm: homebridge-camera-ffmpeg — The fork homebridge-camera-ffmpeg-omx is not needed because the main package supports OMX natively.

Finally, configure Homebridge for each Wyze Cam. The key here is using the h264_omx codec for GPU acceleration as to not push transcoding load onto the CPU.

This config also has the combination found to work best with both streaming and snapshotting for HomeKit. Check out the homebridge-camera-ffmpeg docs and defaults before adding unnecessary configuration options.

Confirmation

At this point, it should be possible to add the accessories to the Home app and see both smooth live streaming and preview snapshots from the cameras.

On the Raspberry Pi, run top or htop to confirm the load is not on the CPU while sreaming.

Dirigible

Home automation and smart home with Raspberry Pi and 3D printing

Luke Hoersten

Written by

Founder, CEO of @Bitnomial. Previously Partner at @AllstonTrading. Member of @ChicagoHaskell.

Dirigible

Dirigible

Home automation and smart home with Raspberry Pi and 3D printing

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade