Barrskogen Tails ~ Setup of a Garden Wildlife Cam

This summer my mum started feeding the hedgehog that regularly visits their garden. Word spread through the neighbourhood, and on even evening seven hedgehogs showed up to feast the cat food. My mum has long been feeding birds and squirrels through the winter, and occasionally a couple of deer wander by too. For Christmas I wanted to gift her a camera setup to capture all this wildlife, but my dad beat me to it. The first thing he said when I arrived this summer was “I have a project for you”.

And so, Barrskogen Tails was born. (Barrskogen means “the pine forest” in Swedish.)

With some help from o3 I chose an IP camera for the job and how to setup everything up. We started on a low budget with a repurposed laptop, just to see how—and if—it would work.

Setup

flowchart LR
    Camera[📹 Wildlife Camera] -->|RTSP| WiFi{📶 WiFi Network}
    WiFi --> Laptop[💻 Old Laptop]
    
    FlaskApp[🌐 Flask App<br/>Web Controller]
    FFmpeg[🎬 Bash Script: FFmpeg Processing]
    
    FFmpeg --> SaveDisk[💾 Save to Disk<br/>Local Storage]
    FFmpeg -->|RTMP| YouTube[📺 Stream to YouTube<br/>Live Feed]
    
    FlaskApp -.->|Start/Stop| FFmpeg
    
    subgraph Laptop["💻 Old Laptop"]
        FFmpeg
        FlaskApp
        SaveDisk
        Tailscale[🔐 Tailscale<br/>Remote Access]
    end 
    
    subgraph Wildlife["🦔 Garden Visitors"]
        Hedgehogs[🦔 Hedgehogs]
        Birds[🐦 Birds]
        Squirrels[🐿️ Squirrels]
        Deer[🦌 Deer]
    end
    
    subgraph Controls["🎛️ Remote Control"]
        StartBtn[▶️ Start Stream]
        StopBtn[⏹️ Stop Stream]
        StatusBtn[📊 Check Status]
    end
    
    subgraph Remote["🌐 Remote Access"]
        Phone[📱 Phone]
        Computer[💻 Computer]
        Anywhere[🏠 From Anywhere]
    end
    
    Camera -.-> Wildlife
    Remote --> Tailscale
    Tailscale --> FlaskApp
    Controls --> FlaskApp
    
    style Camera fill:#81c784,stroke:#2e7d32,stroke-width:3px,color:#000
    style WiFi fill:#64b5f6,stroke:#0d47a1,stroke-width:2px,color:#000
    style FlaskApp fill:#4dd0e1,stroke:#00695c,stroke-width:2px,color:#000
    style FFmpeg fill:#ba68c8,stroke:#4a148c,stroke-width:2px,color:#000
    style SaveDisk fill:#90a4ae,stroke:#263238,stroke-width:2px,color:#000
    style YouTube fill:#ef5350,stroke:#b71c1c,stroke-width:2px,color:#000
    style Tailscale fill:#7986cb,stroke:#3730a3,stroke-width:2px,color:#000
    style StartBtn fill:#81c784,stroke:#2e7d32,stroke-width:2px,color:#000
    style StopBtn fill:#ef5350,stroke:#b71c1c,stroke-width:2px,color:#000
    style StatusBtn fill:#ffb74d,stroke:#e65100,stroke-width:2px,color:#000
    style Phone fill:#64b5f6,stroke:#0d47a1,stroke-width:2px,color:#000
    style Computer fill:#90a4ae,stroke:#263238,stroke-width:2px,color:#000
    style Anywhere fill:#4dd0e1,stroke:#00695c,stroke-width:2px,color:#000
    style Hedgehogs fill:#f06292,stroke:#ad1457,stroke-width:2px,color:#000
    style Birds fill:#4dd0e1,stroke:#00695c,stroke-width:2px,color:#000
    style Squirrels fill:#ffb74d,stroke:#e65100,stroke-width:2px,color:#000
    style Deer fill:#a1887f,stroke:#3e2723,stroke-width:2px,color:#000
    style Laptop fill:#fff8f0,stroke:#ff9800,stroke-width:2px
    style Wildlife fill:#faf5ff,stroke:#9c27b0,stroke-width:2px
    style Controls fill:#f0fdf4,stroke:#00bcd4,stroke-width:2px
    style Remote fill:#f8fafc,stroke:#0284c7,stroke-width:2px

Frigate

I tried to setup Frigate on the laptop in order to do some real-time detection. But the laptop was so old I had to compile an old version of Frigate because of unsupported CPU instructions. When I finally got it running. the fans sounded like a jet engine, and I had to sleep in that room. Ditched for now.

TODO

Still to solve

  • better connection
  • more stable youtube streaming
  • replace laptop, probably with a Raspberry Pi
  • videos analysis to automatically extract highlights for further processing
  • ensure easy access for mom to what the videos
  • investigate OBS Studio

Nice to have

  • automatic detection with alerts. For the hedgehogs I think I need to train my own, because they are very still, and more or less the same color as the ground.

Cool to have

  • a real-time “David Attenborough”-style commentary on what’s happning