modelscope / FunClip

Open-source, accurate and easy-to-use video speech recognition & clipping tool, LLM based AI clipping intergrated.
MIT License
3.8k stars 417 forks source link
gradio gradio-python-llm llm speech-recognition speech-to-text subtitles-generator video-clip video-subtitles

SVG Banners

简体中文 | English」

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

🧠 Explore LLM based video clipping with FunClip

alibaba-damo-academy%2FFunClip | Trendshift

What's New On Going Install Usage Community

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🎨

What's New🚀

On Going🌵

Install🔨

Python env install

FunClip basic functions rely on a python environment only.

# clone funclip repo
git clone https://github.com/alibaba-damo-academy/FunClip.git
cd FunClip
# install Python requirments
pip install -r ./requirements.txt

imagemagick install (Optional)

If you want to clip video file with embedded subtitles

  1. ffmpeg and imagemagick is required

Download and install imagemagick https://imagemagick.org/script/download.php#windows

Find your python install path and change the IMAGEMAGICK_BINARY to your imagemagick install path in file site-packages\moviepy\config_defaults.py

  1. Download font file to funclip/font
wget https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ClipVideo/STHeitiMedium.ttc -O font/STHeitiMedium.ttc

Use FunClip

A. Use FunClip as local Gradio Service

You can establish your own FunClip service which is same as Modelscope Space as follow:

python funclip/launch.py
# '-l en' for English audio recognize
# '-p xxx' for setting port number
# '-s True' for establishing service for public accessing

then visit localhost:7860 you will get a Gradio service like below and you can use FunClip following the steps:

Follow the guide below to explore LLM based clipping:

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:

# 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'

Community Communication🍟

FunClip is firstly open-sourced bu FunASR team, any useful PR is welcomed.

You can also scan the following DingTalk group or WeChat group QR code to join the community group for communication.

DingTalk group WeChat group

Find Speech Models in FunASR

FunASR hopes to build a bridge between academic research and industrial applications on speech recognition. By supporting the training & finetuning of the industrial-grade speech recognition model released on ModelScope, researchers and developers can conduct research and production of speech recognition models more conveniently, and promote the development of speech recognition ecology. ASR for Fun!

📚FunASR Paper:

📚SeACo-Paraformer Paper:

🌟Support FunASR: