Unifi Protect with Amcrest cameras

Best way to leverage your existing camera(s) on UDR or Unifi Protect is via Unifi Cam Proxy on GitHub.

It will create a dummy Unifi G3 Micro camera and enable you to use your RTSP (Real Time Streaming Protocol) enabled cameras even if they are not Unifi.

Optimal setup of Unifi Cam Proxy is via Docker on Raspberry Pi with the standard Raspbian OS on Pi.

Raspberry Pi Imager

Remember that if you are doing a clean install of OS on Pi, you will need to have keyboard and screen via HDMI to enable SSH, or you can edit the SSH file before you turn PI on.

Putty

Putty is the easiest and best tool to connect to Pi via SSH.

You need to know the IP address of the Pi, check the router screen or if you have it connected via HDMI, just type ifconfig.

Initial Raspberry Pi configuration

Once you have Raspbian OS installed on MicroSD, boot it and make sure you do the basics:

  • Change default password (Pi / Raspberry) = passwd
  • Enable Wifi and connect to your local network = raspi-config
  • Update to latest version = sudo apt update and sudo apt full-upgrade
  • Clean up old packages = sudo apt clean

Install Docker and Docker Compose on Raspberry Pi

  • Check Raspberry Pi OS version = cat /etc/os-release
  • Install Docker using this 1 line command: curl -sSL https://get.docker.com/ | sh
  • Check Docker version = docker version
  • Add user permission to docker group
sudo usermod -aG docker ${USER}
groups ${USER}
  • Install Docker Compose
sudo apt-get install libffi-dev libssl-dev
sudo apt install python3-dev
sudo apt-get install -y python3 python3-pip
sudo pip3 install docker-compose

Enable Docker at startup sudo systemctl enable docker

I suggest a sudo reboot of the Raspberry Pi and a test of Hello World docker run hello-world and you should get “Hello from Docker!”

UniFi Cam Proxy

Pre requirements includes few steps

1. Self-signed certificate generation created from another UniFi camera or directly from Raspberry Pi OS. These are steps to generate /tmp/client.pem certificate:

openssl ecparam -out /tmp/private.key -name prime256v1 -genkey -noout
openssl req -new -sha256 -key /tmp/private.key -out /tmp/server.csr -subj "/C=TW/L=Taipei/O=Ubiquiti Networks Inc./OU=devint/CN=camera.ubnt.dev/emailAddress=support@ubnt.com"
openssl x509 -req -sha256 -days 36500 -in /tmp/server.csr -signkey /tmp/private.key -out /tmp/public.key
cat /tmp/private.key /tmp/public.key > client.pem
rm -f /tmp/private.key /tmp/public.key /tmp/server.csr
cp /tmp/client.pem /home/pi/Documents/client.pem
cd /home/pi/Documents/
ls
Add new Device in UDR

2. Adoption token created in Protect UI page in UDR [valid for 60 minutes from time of generation]

  • Open https://{UDR_IP}/protect/devices/add
  • Login with your Unifi credential
  • Select G3 Micro from “Select device to add” list
  • Select “Continue on Web” and type random text in SSID / Password fields
  • Click “Generate QR Code”
  • Save QR Code as image file
  • Upload QR Code to https://zxing.org/w/decode.jspx
  • Extract the token above UDR IP in the ‘Raw Text’ field
  • Adoption token looks like this: cpZaMhfzmBgAqLIHPR0psvoMp3mvCDtu
Adoption token extraction

3. Confirm RTSP support for your cameras using VideoLan Client VLC -> Network Stream.
For Amcrest cameras, the default local credential is admin / admin and RTSP standard URL has this format rtsp://[username]:password@CAM_IP:554/cam/realmonitor?channel=1&subtype=0

RTSP test in VLC

Docker configuration

Make sure you have all pre requirements completed before you move fwd with the docker configuration file:

  • Certificate /home/pi/Documents/client.pem
  • Adoption Token cpZaMhfzmBgAqLIHPR0psvoMp3mvCDtu
  • RTSP URL for your camera rtsp://[username]:password@CAM_IP:554/cam/realmonitor?channel=1&subtype=0
  • Docker is working properly and you have permission to run container

Create Docker Compose YAML file in /home/pi/Documents/docker-cameras.yaml using VI docker-cameras.yaml

version: "3.9"
services:
  unifi-cam-proxy-1:
    restart: unless-stopped
    image: keshavdv/unifi-cam-proxy
    volumes:
      - "./client.pem:/client.pem"
    command: unifi-cam-proxy --host {UDR_IP} --mac {CAM_MAC1} --cert /client.pem --token {Adoption token} rtsp -s rtsp://[username]:password@CAM_IP1:554/cam/realmonitor?channel=1&subtype=0 --ffmpeg-args '-c:v copy -vbsf "h264_metadata=tick_rate=50"'
  unifi-cam-proxy-2:
    restart: unless-stopped
    image: keshavdv/unifi-cam-proxy
    volumes:
      - "./client.pem:/client.pem"
    command: unifi-cam-proxy --host {UDR_IP} --mac {CAM_MAC2} --cert /client.pem --token {Adoption token} rtsp -s rtsp://[username]:password@CAM_IP2:554/cam/realmonitor?channel=1&subtype=0 --ffmpeg-args '-c:v copy -vbsf "h264_metadata=tick_rate=50"'

Start Docker Compose with docker-compose -f /home/pi/Documents/docker-cameras.yaml up -d --remove-orphans

Wait for download and extract of all the components needed.

Connect to UDR https://{UDR_IP}/protect/devices/ and verify you can see the cameras:

Amcrest cameras added to UniFi Protect

Stop Docker Compose with docker-compose -f docker-cameras.yaml down

Please note that CPU load is high on Raspberry PI during live streaming, monitor it with top command:

Optimize CPU load

Amcrest cameras stream using H.265 codec for video and AAC codec for audio as you can review in VLC -> Tools -> Codec Information:

Amcrest streaming information

Unifi Cam Proxy settings expect H.264 codec which causes a lot of overload on Raspberry Pi CPU and ffmpeg library to transcode from H.265 to H.264 codec.

Unifi G3 Micro streams in H.264 with bi-directional audio as reported in the quick start guide

Unifi G3 Micro Video / Audio specifications

Docker command in YAML file provides arguments to ffmpeg library --ffmpeg-args '-c:v copy -vbsf "h264_metadata=tick_rate=50"' and according to ffmpeg documentation:

  • -c:v copy define the codec name and specifically, set FFmpeg to copy the bitstream of the video to the output
  • -vbsf "h264_metadata=tick_rate=50" set the video bitstream and codec to H264 [deprecated]

Reducing frame rate and resolution

Amcrest cameras have 2 substreams on channel #1 you can connect:

SubStreamResolutionCodecURL
01920×1080
@ 30 fps
H.265 hevc with AAC MP4rtsp://[usr]:psw@CAM_IP:554/cam/realmonitor?channel=1&subtype=0
1640×480 @ 30 fpsH.264 AVC
with AAC MP4
rtsp://[usr]:psw@CAM_IP:554/cam/realmonitor?channel=1&subtype=1
Available SubStream in Amcrest camera

Using SubStream #1 which is VGA, instead of SubStream #0 (Full HD) allows to have PI at ~30% CPU load.

VGA resolution on H264

Sources:

Advertisement

Interno 34 – Night Collection 2012 by Santa Lucia

Armadio SME (9)

http://www.santa-lucia.com/it/armadi/s-mod.aspx

ANTA MOD

VERSIONE SCORREVOLE

SPESSORE ANTE 40mm
MODULARITÀ
Larghezza 1014
Altezza 2530
FINITURA PANNELLO
Essenza Olmo Naturale
FINITURA SPECCHIO
Standard Specchio Bronzato

image

image

 

GRUPPO SPOT

Essenza Olmo Naturale

Comodino L.587 P.442 H.431
Comò L.1243 P.538 H.809

image

Letto Tod – Ring Cassonetto dritto
L.1725 – P.2155 – H.962

 

CATALOGHI ONLINE

Olmo Naturale

Sanyo Xacti VPC-CA100

14M Photo + Full HD Camera in 1 single case released end of June 2010

TECHNICAL DATA

Model: Xacti VPC-CA100

Resolution Photo: 14,3 Megapixel
Video: 11,9 Megapixel

LCD-Monitor: 230 000 Pixels
Flash Modes: Auto-Flash Flash off Forced Flash
Selftimer: 10-second delay 2-second delay

Image File Format Still images: JPEG, DCF, DPOF, Exif Ver2.2
Videoclip: ISO standard MPEG-4 AVC/H.264 (.MP4)

Data Storage Media:

  • SD Card (max 4 Gb)
  • SDHC Card compliant (max 32 Gb)
  • SDXC Card compliant (64 Gb)
  • Internal memory: 50 MB

Image Sensor: 1/2,33-inch CMOS 230.000 pixels

Recording Resolution:

  • 1920 x 1080 (Movie Clips Full HD)
  • 1280 x 720 pixels (HD-Movie clips)
  • 640 x 480 (Movie Clips)
  • 4640 x 3480 pixels (still images)
  • 4608 x 2592 pixels (still images)
  • 4352 x 3264 pixels (still images)
  • 4352 x 2448 pixels (still images)
  • 1920 x 1080 pixels (still images)
  • 1600 x 1200 pixels (still images)
  • 1280 x 720 pixels (still images)

Videoclip Frame Rate: 30 frames per second 60 fields per second

White Balance: Full-auto TTL manual setting possible (5 modes)

Lens

  • Optical: 5.0x zoom lens
  • Video: f= 40-240 mm (on a 35 mm camera)
  • Video: f= 80-480 mm (on a 35 mm camera)
  • Photo: f= 38-190 mm (on a 35 mm camera)

Aperture Open F=3,5(Wide) to 3,7(Tele)

Exposure Control Type +/- 1.8 EV (in 0.3 EV steps)
Range super macro: 1cm (wide) 50 cm to infinity (wide)
Shutter (still pictures) 1/2 to 1/1,500
Shutter (movie clips) 1/30 to 1/10000s
Sensitivity Still: Auto (ISO 50-400) manual (ISO 50/100/200/400/800/1600)

Monitor 2.7 inch TFT color LCD 230.000 pixels

General Dimensions and weight: 225g, 92×40,8×123 mm (WxDxH)

Interface AV output (video: HDMI, composite video (NTSC/PAL); audio: stereo)

USB 2.0 full speed

Standard Accessories:

  • USB and AV cable
  • Charging AC Adapter
  • hand strap
  • Lithium-ion battery

Ambient Environment
Temperature 0 to 40º (operation)
Humidity 30 to 90% (operation)

Olympus µ 1030 SW – First bath

Above the first underwater test
&
Below the camera is still running! 🙂

Here is a photo of the “Testing Box” after the underwater check of the camera
(done with camera!):

About the case, I found online on the Europe website of Olympus a good one: Neoprene Case for all SW models. I can’t find that specific model on Ebay
Exclusive neoprene case for all water sports activities with µ[mju:] digital camera. Equipped with a belt attachment for the arm-belt (delivered with the case), safety metal hook, snorkelling hand-strap and safety cord from camera to case.

About the cover, only in the US store it’s available a Silicon Clear Skin for Stylus 1030 SW
It’s available on eBay only for US buyers, so I need to check.
Durable, silicon protective skin protects your Stylus 1030 SW against dust, bumps and scratches while giving you complete control of all the camera functions. The built-in feet stabilize the camera on uneven surfaces

Olympus µ 1030 SW

Official description is available at Olympus Website or click on the above image to see the 360° tour.

Basic Information
  • 10.1 Megapixels
  • Movie VGA with infinite lenght (size of memory card)
  • Waterproof to 10m
  • Shockproof up to 2.0m
  • Crushproof up to 100kg
  • Compatible MicroSD expansion card with MASD-1 adapter

Total Cost of Ownership

Reviews:

Full Technical details:

Image Sensor
Effective pixels = 10.1 Megapixels
Filter array = Primary colour filter (RGB)
Full resolution = 10.7 Megapixels
Type = 1/2.33 ” CCD sensor

Lens
Optical zoom = 3.6 x
Aspherical glass elements = 4
Focal length = 5.0 – 18.2 mm
Focal length (equiv. 35mm) = 28 – 102 mm
Structure = 10 lenses / 8 groups
Maximum aperture = 3.5 – 5.1

Digital Zoomc
Enlargment factor = 5 x / 18 x combined with optical zoom

LCD
Resolution = 230000 dots
BrightCapture = Yes
Monitor size = 6.9 cm / 2.7 ”
LCD type = HyperCrystal II LCD

Focusing System
Method = TTL iESP auto focus with contrast detection
Face Detection AF = Yes
Spot focusing = Yes
Standard mode = 0.5m – ∞ (wide) / 0.5m – ∞ (tele)
Macro mode = 0.1m – ∞ (wide) / 0.3m – ∞ (tele)
Super Macro mode = Closest focusing distance: 2 cm

Light Metering
ESP light metering = Yes
Spot metering = Yes
Histogram in shooting mode = Yes

Exposure System
Enhancement function = Image Stabilisation Mode & Shadow Adjustment Technology
Shutter speed = 1/2 – 1/1000 s / < 4 s (Night scene)
Exposure compensation = +/- 2 EV / 1/3 steps

Scene Modes
Number of scene modes = 24

Sensitivity
Auto = ISO 80 – 1600 Automatically selected
Manual = ISO 80, 100, 200, 400, 800, 1600

White Balance
White balance adjustment = Yes
Sunlight = Yes
Tungsten = Yes
Overcast = Yes
Flourescent 1 = Yes
Flourescent 2 = Yes
Flourescent 3 = Yes

Internal Flash
Working range (wide) = 0.1 – 4.1 m (ISO 800)
Working range (tele) = 0.3 – 2.7 m (ISO 800)
AUTO = Yes
Red-eye reduction = Yes
Fill-in = Yes
Off = Yes

Sequence Shooting
Sequential shooting mode (high speed) = 5.2 fps / 11 frames (in 3MP mode)
Sequential shooting mode = 0.7 fps / 7 frames

Image Processing
Pixel mapping = Yes
Noise reduction = Yes
TruePic III = Yes

Function Processing
Panorama = Yes (only with optional Olympus xD-Picture Card)

Image Editing
Black & White = Yes
Sepia = Yes
Resize = Yes
Attach a frame = Yes
Attach a title = Yes
Attach a calendar = Yes
Correction of saturation = Yes
Red-eye reduction = Yes
Shadow Adjustment Technology = Yes

Movie Edit
Index = Yes

View Images
Calendar = Yes
Index = 4, 9, 16, 25 frames
Zoom = 1.1 – 10 x
Slide show = Yes
Rotation = Yes
Favorite = Yes
Image protect mode = Yes
Histogram in playback mode = Yes
Voice playback = Yes

View Movie
Frame by frame = Yes
Fast forward = Yes
Reverse playback = Yes

Still Image Recording
DCF = Yes
EXIF = 2.2
PIM = III
DPS = PictBridge
DPOF = Yes

Movie Recording System
Recording format = AVI Motion JPEG®
Sound recording = Yes , format: WAV
Movie quality =

  • 640 x 480 / 30 fps
  • 320 x 240 / 15 fps

Voice Recording
Recording format = Wave format

Memory
Internal memory = 14.7 MB

Image Size
10M = 3648 x 2736
5M = 2560 x 1920
4M = 2304 x 1728
3M = 2048 x 1536
2M = 1600 x 1200
1M = 1280 x 960
VGA = 640 x 480
16:9 = 1920 x 1080

Menu
Menu languages in camera = 38 languages

Interface
DC input = Yes
Combined A/V & USB output = Yes
USB 2.0 High Speed = Yes

Size
Dimensions (WxHxD) = 93.2 x 61.4 x 21.3 mm
Weight = 173 g (without battery and card)

Other Features
Shock resistant = Shock-proof from heights of up to 2m (MIL Standard MIL-STD 810F)
Waterproof = Waterproof up to a water pressure equivalent to 10m depth (IEC standard publication 529 IPX8)
Crushproof = Crushproof up to 100kg
Freezeproof = Freezeproof up to -10°C
Pre-Capturing Movie = Yes
Perfect Shot Preview = Yes
Self timer = Yes
In-Camera Panorama = Yes
Guide function = Yes
Face Detection Technology = Yes
LED Illuminator = Yes
Manometer = Yes