video-verstehen
Verstehe Videoinhalte lokal mittels ffmpeg zur Frame-Extraktion und Whisper zur Transkription. Vollständig offline, keine API-Schlüssel erforderlich.
Voraussetzungen
ffmpeg+ffprobe(erforderlich):brew install ffmpegopenai-whisper(optional, für Transkription):pip install openai-whisper
Befehle
# Szenenerkennung + Transkription (Standard)
python3 skills/video-understand/scripts/understand_video.py video.mp4
# Keyframe-Extraktion
python3 skills/video-understand/scripts/understand_video.py video.mp4 -m keyframe
# Regelmäßige Intervall-Extraktion
python3 skills/video-understand/scripts/understand_video.py video.mp4 -m interval
# Begrenzung der extrahierten Frames
python3 skills/video-understand/scripts/understand_video.py video.mp4 --max-frames 10
# Verwende ein größeres Whisper-Modell
python3 skills/video-understand/scripts/understand_video.py video.mp4 --whisper-model small
# Nur Frames, Transkription überspringen
python3 skills/video-understand/scripts/understand_video.py video.mp4 --no-transcribe
# Stiller Modus (nur JSON, keine Fortschrittsanzeige)
python3 skills/video-understand/scripts/understand_video.py video.mp4 -q
# Ausgabe in Datei
python3 skills/video-understand/scripts/understand_video.py video.mp4 -o result.json
CLI-Optionen
| Flag | Beschreibung |
|---|---|
video | Eingabevideodatei (positionsabhängig, erforderlich) |
-m, --mode | Extraktionsmodus: scene (Standard), keyframe, interval |
--max-frames | Maximale Anzahl zu behaltender Frames (Standard: 20) |
--whisper-model | Whisper-Modellgröße: tiny, base, small, medium, large (Standard: base) |
--no-transcribe | Überspringe Audiotranskription, extrahiere nur Frames |
-o, --output | Schreibe Ergebnis-JSON in Datei statt stdout |
-q, --quiet | Unterdrücke Fortschrittsmeldungen, gebe nur JSON aus |
Extraktionsmodi
| Modus | Funktionsweise | Am besten geeignet für |
|---|---|---|
scene | Erkennt Szenenwechsel via ffmpeg select='gt(scene,0.3)' | Die meisten Videos, abwechslungsreicher Inhalt |
keyframe | Extrahiert I-Frames (Codec-Keyframes) | Codierte Videos mit natürlicher Keyframe-Platzierung |
interval | Gleichmäßig verteilte Frames basierend auf Dauer und max-frames | Feste Abtastung, vorhersehbare Ausgabe |
Wenn der scene-Modus keine Szenenwechsel erkennt, fällt er automatisch auf den interval-Modus zurück.
Ausgabe
Das Skript gibt JSON auf stdout aus (oder in eine Datei mit -o). Siehe references/output-format.md für das vollständige Schema.
{
"video": "video.mp4",
"duration": 18.076,
"resolution": {"width": 1224, "height": 1080},
"mode": "scene",
"frames": [
{"path": "/abs/path/frame_0001.jpg", "timestamp": 0.0, "timestamp_formatted": "00:00"}
],
"frame_count": 12,
"transcript": [
{"start": 0.0, "end": 2.5, "text": "Hallo und willkommen..."}
],
"text": "Vollständiges Transkript...",
"note": "Verwende das Lese-Werkzeug, um Frame-Bilder zur visuellen Analyse zu betrachten."
}
Verwende das Lese-Werkzeug auf Frame-Bildpfaden, um extrahierte Frames visuell zu inspizieren.
Referenzen
references/output-format.md-- Vollständige Dokumentation des JSON-Ausgabeschemas