---
name: video-edit-local
description: "Local video editing using FFmpeg — no APIs, no credits, no external services. Use when Isaí sends a video (or multiple videos) and asks to: cut silence, trim segments, speed up/slow down, merge clips, add background music, or convert format. Trigger on any video editing request involving locally stored video files."
---

# video-edit-local

Edit locally stored videos using FFmpeg. Everything runs on the server — no external APIs, no credits, no internet needed.

## Quick Start

```
video_edit.py <operation> [options]
```

## Operations

### cut-silence — Remove silent pauses

```
video_edit.py cut-silence <input.mp4> <output.mp4> [--threshold-db -30] [--min-duration 0.5]
```

Detects silence using FFmpeg's `silencedetect` filter and removes those segments. Threshold in dB (more negative = silence is softer). `min-duration` is the shortest silence to consider.

**Example:** `video_edit.py cut-silence raw.mp4 clean.mp4 --threshold-db -35 --min-duration 0.3`

### cut-segment — Extract a time range

```
video_edit.py cut-segment <input.mp4> <output.mp4> --start 10 --end 45
```

Cuts from `start` (seconds) to `end` (seconds).

**Example:** `video_edit.py cut-segment recording.mp4 clip.mp4 --start 5 --end 30`

### speed — Change playback speed

```
video_edit.py speed <input.mp4> <output.mp4> --factor 2.0
```

Factor > 1 = faster. Factor < 1 = slower. Range: 0.5–2.0.

**Example:** `video_edit.py speed tutorial.mp4 fast_tutorial.mp4 --factor 1.5`

### merge — Concatenate multiple videos

```
video_edit.py merge <video1.mp4> <video2.mp4> <video3.mp4> <output.mp4>
```

Joins clips in order. All inputs must have the same codec/resolution.

### add-music — Overlay background music

```
video_edit.py add-music <video.mp4> <music.mp3> <output.mp4> [--volume 0.3]
```

Mixes audio track at specified volume (0.0–1.0).

### export-format — Convert format/codec

```
video_edit.py export-format <input.mp4> <output.mp4> --format mp4 [--crf 23]
```

Supported formats: mp4, webm, mov.

## Workflow

1. **Recibir video(s)** — Isaí envía el archivo(s) o guarda en el workspace.
2. **Confirmar operación** — Decir qué se va a hacer y con qué parámetros.
3. **Ejecutar** — `exec` con el comando correspondiente.
4. **Entregar** — Devolver ruta del archivo output o enviar por el canal correspondiente.

## FFmpeg Paths

- `/home/claw/.local/tools/ffmpeg/ffmpeg`
- `/home/claw/.local/tools/ffmpeg/ffprobe`

## Notes

- By default re-encodes with H.264 + AAC for broad compatibility.
- Temporary segments are stored in `~/.openclaw/workspace/tmp/` and cleaned up automatically.
- For very large files (>1GB), processing may take several minutes — notify Isaí before starting.
- Supported input formats: MP4, MOV, AVI, WebM, MKV, FLV, MP3, AAC, OGG.