# FunClip

> Transcribe a video locally, then cut it by selecting text or a speaker instead of dragging a timeline

- Category: Multimodal Generation / Audio, Music & Voice
- Language: Python
- Licence: MIT
- Repository: https://github.com/modelscope/FunClip
- Website: https://huggingface.co/spaces/FunAudioLLM/FunClip
- Canonical page: https://ai-tldr.dev/tools/funclip/

## In short

FunClip is a fully open-source, locally deployed video clipping tool from the ModelScope project. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed MIT. To get started: set up a Python environment.

## Overview

FunClip is a fully open-source, locally deployed video clipping tool from the ModelScope project. It runs speech recognition over a video with Alibaba TONGYI speech lab's FunASR Paraformer models, shows you the transcript, and then cuts the video to whichever text segments or speakers you select. The editing metaphor is the transcript rather than a waveform or a timeline: you highlight the sentences you want and press clip.

Several FunASR capabilities are wired in behind that interface. Paraformer-Large predicts word-level timestamps as part of recognition, so segment boundaries come out of the model rather than being estimated afterwards. SeACo-Paraformer's hotword customisation lets you supply names, product terms or other entities up front to improve how they are recognised. The CAM++ speaker-verification model assigns speaker IDs, which makes "give me everything this person said" a single selection. Alternative recognition paths are selectable at launch — SenseVoice for multilingual ASR with emotion and audio-event detection, and a third-party MOSS path for long-form audio with anonymous speaker labels.

The project also explores LLM-assisted clipping: rather than picking segments by hand, you can prompt a model over the transcript and have it propose the cuts. Everything runs through a Gradio interface that you can start locally or host on a server and reach from a browser; there are also a command line mode and a Python API for scripted use. FunClip returns SRT subtitles for both the full video and the clipped output, and is MIT-licensed.

## What it does

- Transcript-driven editing — select text segments or a speaker ID and cut the matching video, including multiple segments in one pass
- Word-level timestamps predicted by Paraformer-Large as part of recognition, rather than force-aligned afterwards
- Hotword customisation via SeACo-Paraformer: declare names and entities before recognition to improve how they are transcribed
- Speaker recognition with CAM++, so a clip can be scoped to one speaker automatically
- Selectable recognition backends at launch: Paraformer, Fun-ASR-Nano, SenseVoice for multilingual ASR with emotion and event detection, or the MOSS long-form path
- LLM-assisted clipping over the transcript, plus SRT subtitles for both the source video and the clipped result

## Getting started

FunClip wants its own Python environment. Install a PyTorch/torchaudio pair for your platform first, then the repository requirements; model weights are downloaded separately when FunClip starts.

1. Set up a Python environment

   The README's recipe uses Python 3.12 in a virtualenv. `pip check` catches a mismatched torch/torchaudio pair before you hit it at runtime.

```bash
git clone https://github.com/modelscope/FunClip.git
cd FunClip
python3.12 -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt
python -m pip check
python funclip/launch.py --help
```

2. Launch the Gradio service

   This is the same interface as the hosted ModelScope and Hugging Face demos. The flags choose the recognition model, the audio language and the port.

```bash
python funclip/launch.py

# pick a recognition backend
python funclip/launch.py -m fun-asr-nano   # Mandarin, English, Japanese, Chinese dialects
python funclip/launch.py -m sensevoice    # multilingual ASR + emotion + audio events
python funclip/launch.py --model moss      # long-form ASR with anonymous speaker labels

# English audio, custom port
python funclip/launch.py -l en -p 7860
```

3. Recognise, then clip

   In the browser: upload a video, press recognise, and wait for the transcript and speaker labels. Highlight the sentences you want or enter a speaker ID, then press clip. FunClip returns the cut video plus SRT subtitles for the whole source and for the selection.

4. Keep the dependency floor

   FunClip's model and subtitle compatibility paths require funasr 1.4.9 or newer. Upgrade inside the FunClip environment before starting the service if you installed it earlier.

```bash
python -m pip install -U "funasr>=1.4.9"
python -m pip install -U -r requirements.txt
```

## When to use it

- Pull quotable segments out of a recorded talk or interview by selecting sentences in the transcript
- Cut a multi-speaker recording down to one participant's contributions using the automatic speaker IDs
- Generate accurate SRT subtitles for Mandarin or multilingual video without sending the audio to a hosted service
- Prototype LLM-driven editing: prompt a model over the transcript and let it choose the segments to keep
