Mitul Aggarwal
Prototype Working V3 demo

GolfCam Training Cameras

Two-angle coaching camera system with Android swing review

Hardware / Android / CAD / Golf Coaching Technology

Raspberry Pi Zero W Camera Module 3 CAD enclosure design Android Kotlin Jetpack Compose Retrofit OkHttp Flask REST API rpicam-vid ffmpeg RTSP preview
GolfCam Android swing review showing two synchronised golf swing angles
The Android Swing Review screen from the demo video, showing Face-On and Down-the-Line clips lined up for the same swing.

Project Story

GolfCam came from the same frustration I kept having in golf practice: one camera angle never tells the whole story. A Face-On view can show body movement and weight shift, while a Down-the-Line view shows club path, posture, and plane. Coaches use both angles all the time, but setting them up, recording them together, and reviewing them in sync is normally clunky. I wanted a tool I could take to the range, tap Record Swing once, and get both views ready for review on my phone. That meant building the whole system myself: the camera hardware, the CAD enclosure, the Raspberry Pi services, and the Android app.

Why I Built It

The hard part was not just filming two videos. The system had to make two separate camera units behave like one coaching tool. They needed to be portable, start recording at nearly the same time, save usable video files, send them back to the phone, and let me compare the same moment of the swing without juggling files manually.

What I Built

I built two Raspberry Pi Zero W camera units with Camera Module 3 sensors, portable power, and CAD-designed custom enclosures. Each Pi runs a Flask REST service on port 8080. I also coded the Android app in Kotlin with Jetpack Compose. The app checks both cameras, sends both record commands concurrently, polls each camera through recording and processing, downloads the MP4 files, and opens a native Swing Review screen with split view, play together, sliders, slow motion, frame stepping, sync adjustment, zoom, maximise, and drawing tools.

What I Did

  • Designed and assembled both portable camera units myself
  • Designed the portable camera enclosure in CAD and exported the STL for the case
  • Built the Raspberry Pi REST recording service around rpicam-vid and ffmpeg
  • Coded the Android app in Kotlin with Jetpack Compose, Retrofit, OkHttp, Media3, and DataStore
  • Built the app workflow for camera health checks, REST discovery, recording, downloading, local capture storage, and swing review
  • Tested the system at the range using real golf swings and two-angle review
  • Documented the full setup, quick run flow, troubleshooting, and recovery process

How I Built It

Build Flow

Jetpack Compose Android app -> CameraRepository abstraction -> concurrent REST /record calls -> two Raspberry Pi camera services -> H264 capture -> ffmpeg MP4 remux -> validated concurrent download -> app-private local capture storage -> native dual-video swing review.

How It Works

Each camera is a small REST device inside a custom enclosure. The app calls /health and /status to check readiness, then sends POST /record to both units at the same time. Each Pi records H264 with rpicam-vid, remuxes it to MP4 with ffmpeg, and exposes the file at /download/latest. The Android app streams downloads with OkHttp, rejects undersized files, retries transient failures, stores valid captures locally, and opens them in a swing-review screen where I can play both together, adjust sync, slow the footage down, step frame by frame, zoom, maximise one angle, draw coaching lines, and export annotated review videos.

Hardware

  • Two Raspberry Pi Zero W/WH units
  • Two Camera Module 3 Standard sensors
  • 200 mm Pi Zero camera ribbons
  • Pimoroni LiPo SHIMs and 3.7 V LiPo batteries
  • CAD-designed portable enclosures and mounts

Software

  • Kotlin Android app
  • Jetpack Compose UI
  • Retrofit and OkHttp REST client
  • Moshi JSON parsing
  • DataStore settings
  • Media3 ExoPlayer and RTSP preview
  • Flask REST API
  • rpicam-vid
  • ffmpeg remuxing
  • systemd services

What Was Hard

  • Designing a compact enclosure that could hold the Pi, camera ribbon, lens opening, wiring, and battery without becoming awkward to mount
  • Making two independent Raspberry Pi cameras start and finish recordings together
  • Handling recording, processing, downloading, and errors without needing a laptop at the range
  • Writing an Android app that separated demo mode from real REST cameras while keeping the review screen reusable
  • Keeping Wi-Fi and hotspot setup reliable enough for outdoor practice
  • Building a review interface where sync, slow motion, frame stepping, and drawing all feel useful on a phone screen
GolfCam Android dual-video review architecture

Build Reference

Android app -> REST API -> Face-On and Down-the-Line Raspberry Pi camera units -> local MP4 download -> synchronised swing review.

Click to inspect

Demos and Build Notes

Product Demos

Demo video of the working training-camera system at the range: phone control, two-angle capture, synchronised playback, slow motion, frame stepping, sync controls, and drawing tools for swing review.

Photos and Notes

Project photos

Range demo setup, using the phone as the control and review device while the two camera units capture the action from different angles.

GolfCam demo at the driving range

GolfCam demo at the driving range
Range demo setup, using the phone as the control and review device while the two camera units capture the action from different angles.
Single-angle review mode from the demo, with frame navigation and drawing controls for coaching notes.

GolfCam single-angle swing review with drawing controls

GolfCam single-angle swing review with drawing controls
Single-angle review mode from the demo, with frame navigation and drawing controls for coaching notes.
Inside one of the self-built camera units, showing the compact Raspberry Pi based electronics and wiring inside the enclosure.

Inside a self-built GolfCam camera unit

Inside a self-built GolfCam camera unit
Inside one of the self-built camera units, showing the compact Raspberry Pi based electronics and wiring inside the enclosure.
Portable camera unit enclosure built for range use. I designed the case around the Pi, camera ribbon, lens opening, wiring, and battery constraints.

GolfCam portable camera unit enclosure

GolfCam portable camera unit enclosure
Portable camera unit enclosure built for range use. I designed the case around the Pi, camera ribbon, lens opening, wiring, and battery constraints.
Hardware build progress, including the CAD-designed enclosure work for the portable camera unit.

GolfCam camera enclosure build

GolfCam camera enclosure build
Hardware build progress, including the CAD-designed enclosure work for the portable camera unit.
Another build-stage view of the camera hardware, showing how the electronics were packaged into the enclosure for a portable coaching setup.

GolfCam hardware assembly detail

GolfCam hardware assembly detail
Another build-stage view of the camera hardware, showing how the electronics were packaged into the enclosure for a portable coaching setup.

Technical Evidence

Screenshots

Split Swing Review view: Face-On and Down-the-Line clips can be played together, scrubbed, stepped frame-by-frame, slowed down, and manually synced.

GolfCam split swing review screen

GolfCam split swing review screen
Split Swing Review view: Face-On and Down-the-Line clips can be played together, scrubbed, stepped frame-by-frame, slowed down, and manually synced.
Coaching review controls in use, including single-angle focus, drawing tools, frame navigation, and sync controls.

GolfCam coaching review controls

GolfCam coaching review controls
Coaching review controls in use, including single-angle focus, drawing tools, frame navigation, and sync controls.

Results & Impact

  • Working V3 prototype demonstrated at the range with real two-angle golf swing capture
  • Android-only daily workflow with no laptop, SSH, PowerShell, or browser required during normal use
  • Kotlin/Jetpack Compose app with REST discovery, settings, capture bank, RTSP alignment preview, annotation tools, and unit tests
  • REST camera services support health checks, status polling, recording, file availability, download, and reset
  • CAD enclosure exported as an STL for the portable camera case
  • A practical foundation for an AI swing analyser and golf-coaching assistant

What I Learned

  • A sports tool only works if the setup is fast enough that I would actually use it during practice
  • Hardware projects fail in small practical ways first: Wi-Fi, boot time, camera ribbon seating, file conversion, and power
  • Designing the enclosure is part of the engineering, because cable routing, lens access, battery space, and mounting all affect whether the system survives real use
  • The review experience matters as much as the capture system, because the whole point is better coaching feedback

Next Steps

  • Add automatic impact detection and more precise timeline alignment
  • Develop AI swing analysis on top of the synchronised Face-On and Down-the-Line footage
  • Turn the system into a more complete AI golf coach with swing faults, drills, and progress tracking
  • Improve the enclosure, tripod mounting, battery reporting, and automatic camera discovery