Skip to content

Lynder063/segmenter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Segmenter

License Platform Python Qt Dotnet WPF

Segmenter is a high-performance visual timestamp annotation tool for Linux and Windows. It lets you create, edit, and upload media segment markers β€” Intro, Recap, Credits, and Preview β€” to TheIntroDB and IntroDB.

Segmenter App Layout


✨ Features

🎧 Audio Waveform Analysis

Automatically extracts audio and displays a density waveform on the timeline. Uses FFT-based spectral flatness to color-code passages β€” mint for dialogue, orange for music-heavy themes like intros and outros.

πŸ–ΌοΈ Frame Strip Preview

Real-time MJPEG-based frame strip centered on the playhead for frame-accurate seeking and positioning.

πŸ€– GPU-Accelerated Season Fingerprinting

Integrated Recurring Content Detector (RCD) scans an entire season directory and automatically finds duplicate segments across episodes using:

  • FAISS-GPU nearest-neighbor search (NVIDIA) or FAISS-CPU (AMD / no GPU)
  • CNN feature extraction (MobileNetV3 or SimpleCNN fallback via PyTorch)
  • Color Histogram and Color Texture Moment modes for CPU-only setups
  • AMD ROCm support β€” PyTorch ROCm builds accelerate CNN feature extraction on AMD GPUs
  • NVIDIA CUDA support β€” full GPU acceleration including FAISS-GPU

Results are cached in /tmp and reused automatically on subsequent loads.

🌐 Remote Network Shares

Stream and analyze files directly from Samba/SMB, SFTP, NFS, WebDAV, or HTTP mounts via native file dialogs.

πŸ”‘ Local Configuration

API keys are stored in ~/.config/Segmenter/keys.json β€” no keyring daemon required.


⌨️ Controls & Shortcuts

Timeline Mouse Actions

Action Description
Click Seek to position
Alt + Drag Create a new segment
Shift + Drag Move a segment between rows
Drag Edges Resize segment boundaries
Scroll Wheel Zoom in/out around playhead

Keyboard Shortcuts

Shortcut Description
Space Toggle play / pause
← / β†’ Step one frame backward / forward
I / Shift+I Set Intro start / end
R / Shift+R Set Recap start / end
C / Shift+C Set Credits start / end
P / Shift+P Set Preview start / end
, Snap nearest segment edge to playhead

πŸš€ Quick Start (Linux)

Prerequisites

Dependency Purpose
python3 (β‰₯ 3.10) Runtime
pip Package manager
ffmpeg Audio/video processing
NVIDIA CUDA drivers Optional β€” full GPU acceleration (CNN + FAISS)
AMD ROCm + PyTorch-ROCm Optional β€” GPU acceleration for CNN feature extraction

Run

./linux/run.sh

This script automatically creates a virtual environment, installs all Python dependencies, and launches the app.


πŸš€ Quick Start (Windows)

Prerequisites

Dependency Purpose
.NET 8.0 SDK Compilation and runtime
ffmpeg Audio extraction and thumbnail generation (must be in system PATH)

Build & Run

Run the PowerShell build script:

.\windows\build.ps1

This will restore dependencies, compile the project, and generate a standalone executable at windows\dist\Segmenter.exe.


πŸ“¦ Packaging

Build standalone .deb, .rpm, and Arch Linux packages:

./linux/build_packages.sh

Output artifacts are placed in linux/dist/.


πŸ—οΈ Project Structure

.
β”œβ”€β”€ windows/
β”‚   β”œβ”€β”€ build.ps1           # Windows Build Script
β”‚   β”œβ”€β”€ Segmenter/          # WPF C# Application
β”‚   β”‚   β”œβ”€β”€ MainWindow.xaml # Main UI
β”‚   β”‚   └── ...
β”‚   └── dist/               # Compiled Segmenter.exe
β”œβ”€β”€ linux/
β”‚   β”œβ”€β”€ app.py              # Entry point
β”‚   β”œβ”€β”€ ui.py               # Main window & all UI logic
β”‚   β”œβ”€β”€ timeline.py         # Interactive timeline widget
β”‚   β”œβ”€β”€ framestrip.py       # MJPEG frame strip
β”‚   β”œβ”€β”€ player.py           # Video player (mpv backend)
β”‚   β”œβ”€β”€ audio.py            # Audio waveform extraction
β”‚   β”œβ”€β”€ models.py           # Data models (SegmentType, SegmentDraft, etc.)
β”‚   β”œβ”€β”€ clients.py          # TheIntroDB & IntroDB API clients
β”‚   β”œβ”€β”€ parser.py           # Filename β†’ TMDB metadata parser
β”‚   β”œβ”€β”€ validator.py        # Segment validation rules
β”‚   β”œβ”€β”€ rcd_integration.py  # RCD scan dialog & worker
β”‚   β”œβ”€β”€ gpu.py              # Unified GPU detection (CUDA / ROCm / CPU)
β”‚   β”œβ”€β”€ rcd/                # Recurring Content Detector engine
β”‚   β”‚   β”œβ”€β”€ detector.py     # Main detection pipeline
β”‚   β”‚   β”œβ”€β”€ featurevectors.py # Feature vector extraction (CH, CTM, CNN)
β”‚   β”‚   β”œβ”€β”€ video_functions.py # Video resize & framerate utils
β”‚   β”‚   └── evaluation.py   # Detection evaluation metrics
β”‚   β”œβ”€β”€ run.sh              # Launcher script
β”‚   β”œβ”€β”€ build_packages.sh   # Packaging script
β”‚   └── requirements.txt    # Python dependencies
β”œβ”€β”€ docs/
β”‚   └── screenshot.png
β”œβ”€β”€ LICENSE
└── README.md

πŸ™ Acknowledgements

  • recurring-content-detector β€” Core fingerprinting, FAISS search, and CNN algorithms used for automated recurring segment detection.
  • IntroStamp β€” The original macOS segment editor that served as UX model and design inspiration.
  • TheIntroDB & IntroDB β€” Public segment marker databases and APIs.
  • TMDB β€” Movie and TV metadata.

πŸ“„ License

MIT License β€” see LICENSE.

About

Tool for visual timestamp annotation, automated season fingerprinting, and uploading segments to TheIntroDB and IntroDB.

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Contributors