Skip to content

wathika-eng/HomeWatch

Repository files navigation

CCTV Flutter Viewer

A modern Flutter application for viewing and monitoring local CCTV cameras with real-time motion detection and alarm capabilities.

Features

  • Multi-Channel Support: View up to 4+ camera channels simultaneously
  • RTSP Stream Support: Automatic RTSP URL detection for common CCTV models
  • Motion Detection: Intelligent motion detection using image processing
  • Real-time Monitoring: Live view of camera feeds with status indicators
  • Snapshot Capture: Take snapshots from any camera channel
  • Motion Alerts: Get notified when motion is detected
  • Cross-Platform: Runs on Android, iOS, Linux, macOS, and Windows

Requirements

  • Flutter 3.11.0 or higher
  • Dart 3.11.0 or higher
  • A local CCTV system with RTSP stream support

Quick Start

1. Install Dependencies

flutter pub get

2. Configure Your CCTV

  1. Open the app and navigate to Settings
  2. Enter your CCTV camera IP address (e.g., 192.168.1.100)
  3. Enter the username and password
  4. Specify the number of channels
  5. Tap "Save Credentials"

3. Start Viewing

  1. Go to Home screen
  2. Tap "Start All" to begin streaming all cameras
  3. Each camera card will show:
    • Stream status (Running/Stopped)
    • Last frame timestamp
    • Individual start/stop buttons
    • Snapshot button

Building

Development

flutter run

Release Build

# Android
flutter build apk --release
flutter build appbundle --release

# iOS
flutter build ios --release

# Linux
flutter build linux --release

# macOS
flutter build macos --release

# Windows
flutter build windows --release

Project Structure

lib/
├── main.dart                 # App entry point
├── models/
│   ├── cctv_camera.dart     # Camera model
│   ├── credentials.dart     # CCTV credentials model
│   └── motion_event.dart    # Motion detection event model
├── services/
│   ├── cctv_service.dart    # CCTV operations service
│   ├── rtsp_helper.dart     # RTSP URL builder and utilities
│   └── motion_detector.dart # Motion detection engine
├── providers/
│   └── cctv_provider.dart   # State management with Provider
├── screens/
│   ├── home_screen.dart     # Main viewing screen
│   └── settings_screen.dart # Configuration screen
└── widgets/
    ├── stream_card.dart     # Camera stream display card
    └── credentials_form.dart # Credentials input form

Dependencies

  • provider: State management
  • http: Network requests
  • image: Motion detection image processing
  • cached_network_image: Efficient image caching
  • permission_handler: Platform permissions
  • shared_preferences: Local storage
  • logger: Logging utility

Configuration

.env File

Create a .env file in the project root:

IP_ADDRESS=192.168.1.100
USERNAME=admin
PASSWORD=admin

RTSP Stream Support

The app automatically detects and supports RTSP streams from popular CCTV brands:

  • Hikvision
  • Dahua
  • Reolink
  • Generic RTSP servers
  • And many more through pattern matching

Motion Detection

  • Uses image frame comparison for real-time motion detection
  • Configurable sensitivity threshold
  • Motion events are logged with timestamp and confidence score
  • Automatic motion alerts when movement exceeds threshold

Troubleshooting

No streams detected

  • Ensure your CCTV camera is on and connected to the network
  • Verify the IP address is correct
  • Check username/password are correct
  • Make sure RTSP protocol is enabled on your camera

Motion detection not working

  • Ensure sufficient lighting for accurate detection
  • Adjust the motion threshold in settings
  • Check camera resolution (lower resolution = faster processing)

License

This project is provided as-is for personal use.

Future Enhancements

  • Motion detection with snapshot capture
  • Cloud recording integration
  • Multi-device sync
  • Advanced motion detection algorithms
  • Face detection integration
  • Email/Push notifications
  • Video recording to local storage
  • 24-7 monitoring mode

About

Watch your home CCTV live footage on your mobile device—anytime, anywhere.

Topics

Resources

Stars

Watchers

Forks

Contributors