https://github.com/matthewww/fpv-auto-trimmer
A bulk utility to trim the beginning and end* of FPV videos, when the drone is sitting on the ground. *Currently only the beginning.
https://github.com/matthewww/fpv-auto-trimmer
drone fpv video
Last synced: 11 months ago
JSON representation
A bulk utility to trim the beginning and end* of FPV videos, when the drone is sitting on the ground. *Currently only the beginning.
- Host: GitHub
- URL: https://github.com/matthewww/fpv-auto-trimmer
- Owner: matthewww
- License: gpl-3.0
- Created: 2025-02-22T13:44:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-25T07:34:32.000Z (over 1 year ago)
- Last Synced: 2025-03-05T02:33:07.075Z (over 1 year ago)
- Topics: drone, fpv, video
- Language: Python
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FPV Auto Trimmer
[](https://badge.fury.io/py/fpv-auto-trimmer)
[](https://github.com/matthewww/fpv-auto-trimmer/actions/workflows/pylint.yml)
[](https://github.com/matthewww/fpv-auto-trimmer/actions/workflows/publish.yml)
- Detects frames when the drone is sitting on the ground at the start of of FPV drone video clips, and **trims the frames out.**
- Processes **multiple videos** automatically (sequentially).
- Uses **[Optical Flow](https://docs.opencv.org/4.x/d4/dee/tutorial_optical_flow.html)** to track motion.
- Detects **takeoff events** based on motion intensity.



#### Why?
I had a lot of videos taking up unnecessary space, but also didn't want to delete them. I wanted to build a tool that quickly and easily keep only the main flights.
Also I just wanted an excuse to try out a Python / Github CI/CD workflow and OpenCV 😛
#### Todo
- [ ] Break into logical modules? Seperate concerns (e.g. 'UI' and OpenCV processing).
- [ ] Add landing detection.
- [ ] Parallel process if there's CPU capacity?
- [ ] Process in halves? End to middle? Sort of binary processing.
- [ ] Containers / K8s / Cloud / Web UI
- [ ] Accept path at prompt
#### Compatibility
So far, only tested to be working on .MOV format H.264 codec videos (from a Runcam 3).
#### Performance
Around 60s for a 60s clip (i7 6700k, 16 GB)
## Usage
```bash
pip install fpv-auto-trimmer
```
#### Process all videos in a folder:
By default, processed videos are saved to an 'output' folder next to the input location.
```bash
python -m fpv_auto_trimmer [-h] [--output OUTPUT] input_path
```
For example:
```bash
python -m fpv_auto_trimmer C:\fpv-auto-trimmer\input
```
#### Process a single video:
```bash
python -m fpv_auto_trimmer [-h] [--output OUTPUT] input_path_to_video
```
For example:
```bash
python -m fpv_auto_trimmer C:\fpv-auto-trimmer\input\video.mov
```
## Development Setup
```bash
git clone https://github.com/matthewww/fpv-auto-trimmer.git
cd fpv-auto-trimmer
pip install -e .[dev]
```