百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
F

firescrew

> 安全
开源

Firescrew - 在 RTSP 网络摄像机上更快地发现移动物体,比咖啡上瘾的猫还快!

186 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Firescrew - 在 RTSP 网络摄像机上更快地发现移动物体,比咖啡上瘾的猫还快!

Firescrew

Docs: https://8ff.github.io/firescrew/

Firescrew is a cutting-edge application written in Go that enables real-time object and motion detection from an RTSP network camera. It leverages advanced image processing techniques and machine learning models to identify specific objects such as cars, people, and more.

Key Features

  • Real-Time Motion Detection: Firescrew can detect motion from a live feed and provide real-time alerts.
  • Object Identification: Identify specific objects like cars and people in real-time.
  • Model Flexibility: Firescrew can use the latest YOLOv8 model, MobileNET with Coral TPU or YOLOv8s with CoreML (MAC Only) for enhanced performance.
  • Performance: Firescrew takes full advantage of Go's concurrency handling and speed, providing a high-performance solution for real-time image processing.
  • RTSP Network Camera Support: Firescrew is compatible with RTSP network cameras, extending its applicability in a wide range of scenarios.
  • MQTT/Webhook/Script/Slack: Firescrew can send events to MQTT/Webhook/Script/Slack for further processing.
  • Natural Language Search: Firescrew supports natural language processing for searching events based on time/type/camera.
  • In-House Quality Control: At Firescrew, we believe in sampling our own "product," chasing the next high in innovation like caffeine-fueled engineers on a coding binge. We don't just build technology; we live it, breathe it, and occasionally spill coffee on it – all to ensure we're delivering a product that's up to snuff!
Things added/fixed in last 3 days:
- Added CoreML YoloV8s (Mac only)
- Added MQTT/Webhook/ScriptHook/Slack support!
- Added ffprobe timeout/Fixed MQTT port in template/Added docs page
- Added inference statistics and much more!
- Fixed Coral TPU model detection
- Performance updates for model adapters
- Discord server has been added
- Docker image will now fetch latest binaries from github at runtime
- Fixed ffprobe ftps parsing/Added resolution/fps bypass parameters

Quick Start Demo

bash
docker run --rm -it -p 8080:8080 8fforg/firescrew:latest demo

# Point your browser to http://localhost:8080

WebUI

WebUI Supports natural language processing for searching events, here are some of the examples:

  • Today & Yesterday:
    • today
    • today 8am
    • yesterday 3pm
  • Specific Dates:
    • august 15th 10am
    • last friday 2pm
  • Ranges: Supports from/to and between/and ranges
    • from july 7th 5pm to july 7th 6pm
    • last tuesday between 1pm and 2pm
  • With Keywords:
    • people cars today between 10am and 1pm
  • With Camera Name
    • front cars today
  • Background color of the events signify the same event to make it easier to separate them

Installation

Docker

bash
docker pull 8fforg/firescrew:latest

Local

Firescrew leverages the capabilities of ffmpeg to ensure optimal performance and broad compatibility, you will need to install it before use.

bash
apt-get install ffmpeg
pip3 install ultralytics
curl -o firescrew -L https://github.com/8ff/firescrew/releases/download/latest/firescrew.linux.amd64 && chmod +x firescrew

Usage

Docker

Generate config

bash
# Store template config in config.json
docker run --rm -it 8fforg/firescrew:latest -t > config.json

Run

bash
# Run with config.json and mount media folder for persistent storage
docker run --rm -v $(pwd)/media:/media -v $(pwd)/config.json:/config.json -it 8fforg/firescrew:latest /config.json

Serving from Docker

bash
# Serve from ./media on port 8080 (./media must be defined in config.json)
docker run --rm -p 8080:8080 -it -v $(pwd)/media:/media 8fforg/firescrew:latest -s /media :8080

Using Coral TPU with Docker

bash
lsusb | grep Google
# Take Bus and Device from the output of the above command and replace [bus] and [device] in the below command
docker run -d --device=/dev/bus/usb/[bus]/[device] -v config.json:config.json 8fforg/firescrew:latest

Help menu

bash
root@debian:~docker run --rm -it 8fforg/firescrew:latest -h
Usage: firescrew [configfile]
  -t, --template, t     Prints the template config to stdout
  -h, --help, h         Prints this help message
  -s, --serve, s        Starts the web server, requires: [path] [addr]
  -v, --version, v      Prints the version
  -update, --update, update     Updates firescrew to the latest version

Local

Create a template config file

bash
./firescrew -t > config.json

Start object detection

bash
./firescrew config.json

Starting WebUI

bash
./firescrew -s rec/hi :8080

Using Demo Stream from sample video

This will start a demo stream at rtsp://localhost:8553/lo and rtsp://localhost:8554/hi

bash
cd demoStream && ./startDemoStream.sh

Command line options

bash
Usage: firescrew [configfile]
  -t, --template, t     Prints the template config to stdout
  -h, --help, h         Prints this help message
  -s, --serve, s        Starts the web server, requires: [path] [addr]
  -v, --version, v      Prints the version
  -update, --update, update     Updates firescrew to the latest version

Benchmarks!

YOLOV8S Running CUDA 11.8 on RTX 4090

Min Time: 16.369294ms, Max Time: 1.748422882s, Avg Time: 20.55754ms, Count: 500
50th: 16.787455ms, 90th: 17.206168ms, 99th: 27.898232ms

YOLOV8S Running CUDA 11.8 on RTX 3090

Min Time: 15.337001ms, Max Time: 1.931347977s, Avg Time: 28.308399ms, Count: 500
50th: 24.313751ms, 90th: 25.290932ms, 99th: 34.881259ms

YOLOV8S Running CoreML on M1 Mac

Min Time: 32.435875ms, Max Time: 53.711166ms, Avg Time: 35.725131ms, Count: 500
50th: 35.232417ms, 90th: 37.851167ms, 99th: 44.405792ms

YOLOV8S Running CPU on Core i5-8500T @ 2.10GHz

Min Time: 103.251637ms, Max Time: 308.058517ms, Avg Time: 120.917971ms, Count: 500
50th: 116.531572ms, 90th: 126.291139ms, 99th: 230.462122ms

Dependencies Installation for YOLOv8

Docker image already includes everything you need to get started but if you choose to run manually and use YoloV8 model, you will need to install the Ultralytics dependencies. You can do this by running the following command:

bash
    pip3 install ultralytics

This command installs the Ultralytics package which includes the necessary dependencies for the YOLOv8 model. If you encounter any problems during the installation, or you're looking for more advanced setup instructions, please refer to the Ultralytics Quick Start Guide. Note: Make sure you have Python and pip (or pip3) installed on your system before running these commands. Ensure that your Python environment is properly set up and is compatible with the YOLOv8 model requirements.

Dependencies Installation for EdgeTPU Coral

If you choose to use the EdgeTPU model via the Python adapter for faster and more accurate detection, you will need to install the Ultralytics dependencies. You can do this by running the following command:

bash
pip3 install pycoral numpy Pillow

Running YOLOV8s with CoreML (Mac Only)

This has been tested working on M1/M2 MacOS 13.4.1, it works when using python3.10 and not 3.11

bash
git clone https://github.com/8ff/firescrew && cd firescrew/assets
pip3.10 install coremltools Pillow
./objectDetectServerCoreML.py

Now in your config.json file set "networkObjectDetectServer": "", addr:8555 where addr is the ip of your machine running the above script

RTSP Camera Stream URLs

Firescrew supports two different RTSP camera streams: a low resolution stream (deviceUrl) and a high resolution stream (hiResDeviceUrl). These streams are used for different purposes and should be set up accordingly. The deviceUrl should be set to a low resolution video feed, typically around 640x360. This stream is used for motion detection. Note that the resolution of this stream significantly impacts the CPU usage. A higher resolution will lead to more CPU usage, so it is recommended to keep this stream at a lower resolution. The hiResDeviceUrl should be set to a high resolution video feed, such as 1080p or higher. This stream is used to store video clips of motion events. As this stream is not used for motion detection, it can handle higher resolutions, enabling the capture of more detail in the recorded video clips. Firescrew uses tcp for RTSP streams by default to avoid lost frames. If you camera does not support tcp - please open an issue and we will add support for it.

Configuration

Firescrew uses a JSON configuration file for its settings. Here is a brief explanation of the various configuration parameters:

…

Performance

Firescrew's performance has been meticulously examined and optimized to ensure the fastest and most reliable object detection. The key aspects of this examination include comparing different RTSP feed methods and evaluating various model object detections. Here are the details:

Motion Detection Mechanism

Motion detection system operates in two stages to optimize resource usage and deliver accurate results:

  1. Event-Based Motion Check:

    • If there is an active motion-triggered event, the system directly proceeds to object detection.
    • If no active event is detected, the system compares the amount of changed pixels between consecutive frames.
    • This is done to avoid wasting CPU cycles and also to avoid missing objects once motion has been triggered.
  2. Pixel Change Threshold:

    • A threshold defined in objectAreaThreshold is used to determine significant changes between frames.
    • If the changes exceed this threshold, the frame is considered for further analysis.
    • While it's difficult to have a value that fits all use cases, this approach helps reduce CPU usage as it has a lower cost than object detection.
  3. Object Detection:

    • The frame, if qualified through the above stages, is passed to an object detection model.
    • We use either YOLOv8 or Coral Edge TPU for object detection, depending on the configuration.
    • After extensive testing, this setup has been found to offer the best balance between accuracy and resource consumption.

The project continues to evolve, with a focus on enhancing performance and lowering resource consumption for an even more efficient and robust motion detection solution.

RTSP Feed Comparison

Three different methods for parsing RTSP feeds were tested:

  • GoCV RTSP Feed: Utilized the GoCV library to handle RTSP feeds.
  • GoRTSP Feed: Utilized the GoRTSP library for RTSP feed handling.
  • FFmpeg Command: Employed FFmpeg commands to parse RTSP feeds.

Among these, using the FFmpeg command was found to be the fastest and most compatible between RTSP feeds. This approach not only delivered superior speed but also ensured broad compatibility across different types of RTSP feeds.

Model Object Detection Comparison

Two primary models were examined for object detection:

  • Golang MobileNET: This built-in Go model was tested for object detection capabilities.
  • YOLOv8: The YOLOv8 model was examined via a Python adapter for faster and more accurate detection.

The comparison clearly revealed that YOLOv8 outperformed the Golang MobileNET in both speed and quality. The detection was faster, and the quality of object identification was much better with YOLOv8.

Conclusion

Based on these comprehensive performance tests, Firescrew has adopted the use of the FFmpeg command for RTSP feed handling and the YOLOv8 model for object detection. This decision ensures the delivery of a fast, accurate, and high-quality solution for real-time object and motion detection. Additionally, the implementation of a network model adapter allows the support of any desired model detection, providing flexibility and adaptability for various use cases.

Running remote object detectors

bash
git clone https://github.com/8ff/f

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gocamerahomeassistantmqttnvr

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类安全
定价开源

> 相关工具

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.