Skip to content
modelscopePublic

Latest commit

 

History

327 Commits

Folders and files

Repository files navigation

SVG Banners

「简体中文 | English」

⚡ Open-source, accurate and easy-to-use video clipping tool

🧠 Explore LLM based video clipping with FunClip

modelscope%2FFunClip | Trendshift

FunClip is a fully open-source, locally deployed automated video clipping tool. It leverages Alibaba TONGYI speech lab's open-source FunASR Paraformer series models to perform speech recognition on videos. Then, users can freely choose text segments or speakers from the recognition results and click the clip button to obtain the video clip corresponding to the selected segments (Quick Experience Modelscope⭐ HuggingFace🤗).

Highlights🎨

  • 🔥Try AI clipping using LLM in FunClip now.
  • FunClip integrates Alibaba's open-source industrial-grade model Paraformer-Large, which is one of the best-performing open-source Chinese ASR models available, with over 13 million downloads on Modelscope. It can also accurately predict timestamps in an integrated manner.
  • FunClip incorporates the hotword customization feature of SeACo-Paraformer, allowing users to specify certain entity words, names, etc., as hotwords during the ASR process to enhance recognition results.
  • FunClip integrates the CAM++ speaker recognition model, enabling users to use the auto-recognized speaker ID as the target for trimming, to clip segments from a specific speaker.
  • The functionalities are realized through Gradio interaction, offering simple installation and ease of use. It can also be deployed on a server and accessed via a browser.
  • FunClip supports multi-segment free clipping and automatically returns full video SRT subtitles and target segment SRT subtitles, offering a simple and convenient user experience.

What's New🚀

  • 2026/09/01 FunClip v2.2.1 preserves selected subtitle colors with a Pillow renderer and publishes the latest MOSS speaker-label boundaries in checksum-protected source archives.
  • 2026/08/30 FunClip v2.2.0 adds the third-party MOSS-Transcribe-Diarize path for long-form ASR, timestamps, and anonymous speaker labels without external VAD or speaker models.
  • 2026/08/03 FunClip v2.1.1 improves fresh Gradio installs, private-by-default container startup, case-insensitive matching, and MiniMax routing.

See GitHub Releases for the complete history and downloadable assets.

On Going🌵

  • FunClip will support Whisper model for English users, coming soon (ASR using Whisper with timestamp requires massive GPU memory, we support timestamp prediction for vanilla Paraformer in FunASR to achieving this).
  • FunClip will further explore large language model based AI clipping. Feedback and prompt-setting tips are welcome.
  • Reverse periods choosing while clipping.
  • Removing silence periods.

Install🔨

Python env install

Use a separate Python environment for FunClip. The commands below use Python 3.12; install a matching PyTorch/torchaudio pair for your platform before the remaining requirements. See the installation and troubleshooting guide for the Linux CPU recipe, Windows activation and certificate errors.

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

Keep this environment on the repository's Transformers 4.x requirements. Nano's separate native Transformers 5.x quickstart is not an upgrade command for an existing FunClip installation.

For a packaged installation, open the latest published release. Download its numbered FunClip-*.tar.gz or FunClip-*.zip and SHA256SUMS from the same release. The 2.2.2 source notes describe the stage-2 video export and upload-page fixes; the older v2.2.1 archives do not contain them. These are source archives, not bundled model weights.

FunClip v2.2.1 keeps the supported Gradio 4 runtime and renders built-in subtitles with Pillow so the selected foreground color survives video encoding. Existing installations should run python -m pip install -U -r requirements.txt inside their FunClip environment before restarting.

FunClip's current model and subtitle compatibility paths require funasr>=1.4.9. This includes the MOSS vLLM adapter, long-audio generation controls, normalized sentence_info speaker segments, and the earlier SenseVoice and realtime fixes. If you installed FunClip before this requirement was updated, run python -m pip install -U "funasr>=1.4.9" before starting the Gradio service. Release notes · PyPI

Burn Chinese subtitles into a video

The current source tree includes Noto Sans CJK SC Medium and its font license. The built-in Pillow renderer needs no separate font download, ImageMagick installation, or security policy changes. This applies to subtitle rendering only; model weights and video encoding dependencies are separate.

ImageMagick is only needed for the legacy demo or a custom MoviePy 1.x TextClip workflow.

Use FunClip

A. Use FunClip as local Gradio Service

Make your first clip from a spoken line

From the root of this source checkout, activate the FunClip environment from Install. Have a short video you are allowed to process and the corresponding Paraformer models ready. For Mandarin speech run:

python funclip/launch.py --no-examples

For English speech add -l en and use the English model. Open http://127.0.0.1:7860 on the same machine. The server stays local by default; no public share link or LLM key is needed. --no-examples skips downloading the hosted demo media, not model weights. A first model download needs permission and network access. Older source archives without this option need a newer checkout; check with python funclip/launch.py --help.

  1. Choose your video in Video Input. A preview means the file is loaded, not transcribed. Click ASR and wait for text in Recognition Result.
  2. In Text/Speaker Clipping, copy one continuous phrase from that result into Text to Clip. Click Clip. Choose Clip+Subtitles instead to burn captions into the video.
  3. Play Video Clipped and check the clipped SRT against the phrase you chose. Its times refer to the clip. If the clipping log reports no match, copy the words from this transcript, not from memory.

For a speaker selection, use the recognition button with speaker labels and enter the returned speaker ID rather than a phrase. To use the hosted demo gallery instead of your own file, omit --no-examples and allow network access to the example media.

Model selection quick start

Scenario Command
Default Chinese video clipping with Paraformer python funclip/launch.py
High-accuracy transcription with the flagship Fun-ASR-Nano checkpoint (use Paraformer for precise text-based clipping) python funclip/launch.py -m fun-asr-nano
Multilingual ASR with emotion and audio event tags python funclip/launch.py -m sensevoice
MOSS through a local vLLM transcription service python funclip/launch.py --model moss --moss-backend vllm
English video clipping with the Paraformer English model python funclip/launch.py -l en

MOSS-Transcribe-Diarize backend

MOSS-Transcribe-Diarize is a third-party OpenMOSS model, not a FunASR or FunClip model. FunClip pins the published Hugging Face object OpenMOSS-Team/MOSS-Transcribe-Diarize at revision e8681d68e7042738ffca8ac8212bc8fcb1131ab8. Start and verify the vLLM service using the bilingual production guide, then run:

# vLLM is the default MOSS backend and defaults to http://127.0.0.1:8898/v1
python funclip/launch.py --model moss --moss-backend vllm

# Optional bearer credentials are read from the environment, not the command line
MOSS_API_KEY=replace-me python funclip/launch.py --model moss

MOSS performs segmentation and speaker diarization end to end. Its spkS01, spkS02, ... values are anonymous speaker labels within the current recording; the model does not identify a known person, verify an enrolled voiceprint, or guarantee label continuity across separate recordings. Do not attach an external vad_model or spk_model, because chunking would break consistent speaker assignment within the recording. Its timestamps are segment-level: SRT, speaker clipping, and LLM timestamp clipping are supported, while precise arbitrary text clipping still requires Paraformer's token timestamps. FunClip currently exposes the vLLM path because it is compatible with the standard Transformers 4.x environment and has an end-to-end tested OpenAI transcription contract.

If you only need offline speech transcription on CPU or edge devices and do not need FunClip's video clipping UI, use the FunASR llama.cpp / GGUF runtime instead: funasr.com/llama-cpp · Fun-ASR-Nano-GGUF · SenseVoiceSmall-GGUF.

Follow the guide below to explore LLM based clipping:

Using OrcaRouter as your LLM gateway (optional)

Besides the transcript-based LLMs above, FunClip can route LLM-assisted clipping through OrcaRouter, an OpenAI-compatible smart-routing gateway. Select any orcarouter/ model in the LLM Model Name dropdown (orcarouter/auto routes each request to the best model for the task), paste an OrcaRouter API key in the APIKEY box, and click 'LLM Inference' — FunClip sends the transcript and prompts to https://api.orcarouter.ai/v1/chat/completions, and the returned segments work with the existing 'AI Clip' button unchanged.

OrcaRouter exposes one endpoint for all frontier and open-weight models, so you can switch routing targets without changing FunClip. It also offers gateway-level, zero-trust controls for AI agents on the same endpoint. Enforcement follows the Guardrail or Firewall policy attached to the relevant scope for prompts, responses, and tool calls that traverse the gateway; select the documented tight posture to enable default-deny behavior. Enforcement is opt-in — this integration supplies only the base URL, API key, and model, and does not attach a policy by itself. Apply a policy via the security quickstart; see Guardrails and Firewall for how coverage is scoped.

Set ORCAROUTER_API_KEY (and optionally ORCAROUTER_API_BASE, which defaults to https://api.orcarouter.ai/v1) instead of pasting the key into the UI if you prefer environment-based configuration. A key is available at https://www.orcarouter.ai.

Using Cheaper Inference as your LLM gateway (optional)

FunClip can also send LLM-assisted clipping through Cheaper Inference, an OpenAI-compatible LLM gateway. One API key gives access to models from several labs. Select any cheaperinference/ model in the LLM Model Name dropdown, paste a Cheaper Inference API key in the APIKEY box, and click 'LLM Inference'. FunClip removes the cheaperinference/ prefix and sends the transcript and prompts to https://api.cheaperinference.com/v1/chat/completions. The returned segments work with the existing 'AI Clip' button.

Set CHEAPER_INFERENCE_API_KEY (and optionally CHEAPER_INFERENCE_API_BASE, which defaults to https://api.cheaperinference.com/v1) instead of pasting the key into the UI if you prefer environment-based configuration. A key is available at https://cheaperinference.com/signup.

Content-aware clipping with TwelveLabs Pegasus (optional)

Besides the transcript-based LLMs above, FunClip can optionally use TwelveLabs Pegasus, a video understanding model that reasons over the actual video (visuals + audio) rather than only the ASR transcript. This helps pick highlight segments even when the transcript alone is ambiguous (e.g. action, scene changes, on-screen events). To use it, select the pegasus1.5 model name, paste your TwelveLabs API key, upload a video, and click 'LLM Inference' — Pegasus returns segments in the same N. [start-end] text format, so the existing 'AI Clip' button works unchanged. It needs pip install twelvelabs, and a free API key is available at https://twelvelabs.io.

B. Experience FunClip in Modelscope

FunClip@Modelscope Space⭐

FunClip@HuggingFace Space🤗

C. Use FunClip in command line

FunClip supports you to recognize and clip with commands:

# download the example video used in the commands below
mkdir -p examples
wget "https://huggingface.co/spaces/R1ckShi/FunClip/resolve/main/examples/2022%E4%BA%91%E6%A0%96%E5%A4%A7%E4%BC%9A_%E7%89%87%E6%AE%B5.mp4" -O "examples/2022云栖大会_片段.mp4"

# step1: Recognize
python funclip/videoclipper.py --stage 1 \
                       --file examples/2022云栖大会_片段.mp4 \
                       --output_dir ./output
# now you can find recognition results and entire SRT file in ./output/
# step2: Clip
python funclip/videoclipper.py --stage 2 \
                       --file examples/2022云栖大会_片段.mp4 \
                       --output_dir ./output \
                       --dest_text '我们把它跟乡村振兴去结合起来,利用我们的设计的能力' \
                       --start_ost 0 \
                       --end_ost 100 \
                       --output_file './output/res.mp4'

Version: The exact output paths and exit behavior below require commit 7c63759 or later. The v2.2.1 release archives predate this fix.

For this stage-2 video command, exit code 0 means both ./output/res.mp4 and ./output/res.srt were written. Choose a fresh output name: an existing MP4 or SRT is not overwritten when you specify --output_file. If no text matches, the command exits nonzero without creating either file. Copy the words from the saved transcript before retrying.

Clipping an audio file instead (current source): Run stage 1 on your recording first. Then reuse that same file and state directory. For example, if the recording is talk.wav and the saved transcript contains “later”:

python funclip/videoclipper.py --stage 2 --lang en --file talk.wav --output_dir ./output --dest_text later --output_file ./output/quote.wav

This step reads the saved timing; it does not run recognition again. Success writes both quote.wav and quote.srt. Without --output_file, the names are result.wav and result.srt in the state directory. Neither name may already exist. A missing match or offsets that leave no audio cause a nonzero exit, not an export of the original recording. Check your selection or choose a fresh output name before retrying.

Community Communication🍟

FunClip was first open-sourced by the FunASR team, and useful PRs are welcome.

For questions, ideas, and community projects, use GitHub Discussions. You do not need to join a chat group to participate.

The archived images docs/images/dingding.png and docs/images/wechat.png are expired invitations, not current joining links. The DingTalk image states an expiry of April 22, 2025; the WeChat image states a seven-day validity ending July 15. No replacement group invitation has been verified here.

Ecosystem

FunClip is part of the FunAudioLLM family:

Project Description Stars
FunASR Industrial speech recognition toolkit — VAD, ASR, punctuation, diarization
Fun-ASR-Nano End-to-end LLM-based ASR — flagship and separate 31-language MLT checkpoints, streaming, hotwords (HF model)
SenseVoice Multilingual speech understanding — ASR + emotion + audio events (HF model)
CosyVoice Natural speech generation — multi-language, zero-shot cloning

📚FunASR Paper: 📚SeACo-Paraformer Paper:

License

  • FunClip source code is licensed under the MIT License.
  • Model weights are downloaded separately and are governed by the terms on their model pages. The default Paraformer-Large, SeACo-Paraformer, and CAM++ pages currently list Apache License 2.0; check the applicable model page before redistribution.

Star History

Star History Chart