Home

Awesome

SVG Banners

<p align="center">简体中文 | English」</p>

<p align="center"> ⚡ Open-source, accurate and easy-to-use video clipping tool </p> <p align="center"> 🧠 Explore LLM based video clipping with FunClip </p>

<p align="center"> <img src="docs/images/interface.jpg" width=444/></p> <p align="center" class="trendshift"> <a href="https://trendshift.io/repositories/10126" target="_blank"><img src="https://trendshift.io/api/badge/repositories/10126" alt="alibaba-damo-academy%2FFunClip | Trendshift" style="width: 250px; height: 55px;" width="300" height="55"/></a> </p> <div align="center"> <h4> <a href="#What's New"> What's New </a> |<a href="#On Going"> On Going </a> |<a href="#Install"> Install </a> |<a href="#Usage"> Usage </a> |<a href="#Community"> Community </a> </h4> </div>

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🎨

<a name="What's New"></a>

What's New🚀

<a name="On Going"></a>

On Going🌵

<a name="Install"></a>

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
apt-get -y update && apt-get -y install ffmpeg imagemagick
sed -i 's/none/read,write/g' /etc/ImageMagick-6/policy.xml
brew install imagemagick
sed -i 's/none/read,write/g' /usr/local/Cellar/imagemagick/7.1.1-8_1/etc/ImageMagick-7/policy.xml 

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

<a name="Usage"></a>

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:

<img src="docs/images/guide.jpg"/>

Follow the guide below to explore LLM based clipping:

<img src="docs/images/LLM_guide.png" width=360/>

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'

<a name="Community"></a>

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 groupWeChat group
<div align="left"><img src="docs/images/dingding.png" width="250"/><img src="docs/images/wechat.png" width="215"/></div>

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: <a href="https://arxiv.org/abs/2305.11013"><img src="https://img.shields.io/badge/Arxiv-2305.11013-orange"></a>

📚SeACo-Paraformer Paper: <a href="https://arxiv.org/abs/2308.03266"><img src="https://img.shields.io/badge/Arxiv-2308.03266-orange"></a>

🌟Support FunASR: <a href='https://github.com/alibaba-damo-academy/FunASR/stargazers'><img src='https://img.shields.io/github/stars/alibaba-damo-academy/FunASR.svg?style=social'></a>