DEV Community

x549d
x549d

Posted on Edited on

Detect Objects in Video and Export Activity Records with Python

Introduction
video-ai-saver is an open-source Python library and CLI that detects objects in video, selects regions for vision-language model analysis, and exports structured activity records.

It supports video files, webcams and RTSP streams. The project is early alpha; real-world accuracy and cost savings remain to be validated.[video-ai-saver](https://github.com/x549d/video-ai-saver)
Enter fullscreen mode Exit fullscreen mode

New: local web workspace. Prefer a GUI over the command line? Run python -m cascade_vision.web and open http://127.0.0.1:8765. Import a video and click Analyze: the workspace shows frame counts, motion filtering, API usage, and a filterable list of timestamped events. Click an event to inspect its bounding box or jump to that point in the original video, and download the run summary and event records from the same page. The interface defaults to real local detection with simulated descriptions and makes no paid API calls; use Run offline demo to explore it with synthetic footage. Step-by-step tutorial with screenshots: docs/WEB.en.md.

New: Codex plugin. Want Codex to review a video without sending it the whole file? Install the Video AI Saver plugin: it scans the video locally for visual changes and hands Codex a timestamped contact sheet plus a few JPEG frames, so Codex can find the moments worth reviewing. The screening step needs no API key and never uploads the original video. Install the plugin and try the example: docs/CODEX.en.md (https://github.com/x549d/video-ai-saver/blob/main/docs/CODEX.en.md).

What Does It Do?
Enter fullscreen mode Exit fullscreen mode

The pipeline combines OpenCV motion filtering, YOLO detection, ByteTrack tracking and background semantic analysis.

Its output can help you:

  • Locate selected observations in the original video.
  • Filter records by object category or event label.
  • Feed descriptions into your own database or dashboard.
  • Compare sampling policies using recall, latency and API usage. How to Try It With Python 3.9 or newer:
  git clone https://github.com/x549d/video-ai-saver.git
  cd video-ai-saver
  python -m pip install -e .

  python -m cascade_vision.cli demo --mock-vlm \
    --event-labels person,backpack \
    --report-json reports/demo.json \
    --events-jsonl reports/events.jsonl
Enter fullscreen mode Exit fullscreen mode
The demo generates synthetic frames and mock descriptions. After installation, it needs no footage, camera or API key and sends no paid API requests.

Real video detection requires the optional YOLO dependencies. Real semantic analysis requires a configured model API and may incur charges.
Enter fullscreen mode Exit fullscreen mode

How to Use the Results

  • demo.json summarizes processed frames, task outcomes, usage and timing.
  • events.jsonl contains individual observations with time information, categories, activity descriptions and event labels.
    Use these records to build a review list, filter relevant observations or connect another application. Demo records contain simulated: true; they demonstrate the format, not recognition accuracy.

    I’d welcome feedback on installation and whether the output fits your video-analysis workflow.

Top comments (0)