Skip to content

sindhu1807/rtsp-motion-frame-capture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

RTSP Motion Detector with Timestamp and Frame Logging

This Python script connects to an RTSP camera stream, detects motion via pixel difference analysis, overlays timestamps on frames, and saves them on motion detection or regular intervals.

Features

  • 🟡 Overlay timestamps with a visual background strip
  • 📹 Real-time RTSP stream display
  • 📦 Saves frames on:
    • Motion detection
    • Regular time intervals (based on frame count and FPS)
  • ⚙️ Simple motion detection using pixel difference count

Prerequisites

  • Python 3.7 or higher
  • An RTSP camera or local RTSP stream URL

Installation

  1. Clone the repo or download the script.
  2. Install required packages:
pip install -r requirements.txt
  1. Update the script:
rtsp_link = r'rtsp://localhost:8554/stream'  # Replace with your RTSP link

Usage

Run the script:

python motion_capture.py

Output

  • Motion frames: motion_YYYYMMDD_HHMMSS.jpg
  • Regular frames: regular_YYYYMMDD_HHMMSS.jpg

Screenshot

Screenshot (137)

Notes

  • Motion detection sensitivity is adjustable via:
return count > 1000  # Lower = more sensitive
  • Change save_interval to adjust regular snapshot frequency (in seconds).

About

Capture motion-triggered images from RTSP streams with timestamps for surveillance and monitoring.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages