目录
目录README.md

赛题题目:视频字幕AI自动识别显示工具

赛题说明:

随着短视频、直播、在线教育等场景的爆发式增长,视频内容的可访问性和跨语言传播需求日益增强。传统字幕制作依赖人工转录,效率低且成本高。近年来,基于深度学习的语音识别(ASR)、自然语言处理(NLP)显著提升了字幕生成的自动化水平。AI字幕技术通过自动识别音频、生成精准字幕并支持多语言翻译,正在重塑视频创作与传播方式。 本赛题旨在推动AI技术在视频处理领域的创新应用,优化音视频播放逻辑,同时探索跨语言适配、实时处理等关键技术难点。该方向与“智能技术应用与创新”赛道目标高度契合,可促进教育、娱乐、跨国协作等场景的智能化升级。

赛题要求:

  • 软件基于开源操作系统研发及运行;
  • 核心功能:基于操作系统桌面接口或SDK开发工具实现视频的语音识别、字幕自动生成及时间轴同步,支持中英等多语言翻译切换;
  • 性能要求:字幕生成准确率≥90%,支持实时或准实时处理(延迟<3秒),对字幕获取处理流程输出系统资源使用情况;
  • 扩展功能:支持字幕样式自定义(字体、颜色、位置)、多说话人分离、背景噪音过滤。

评分标准:

功能完整性(40%):

  • 基于操作系统桌面接口或SDK开发工具实现视频播放(20分);
  • 可以显示视频字幕(30分);
  • 可以显示多种语言字幕(30分);
  • 支持多种扩展功能(字幕字体,颜色,位置调整,多说话人分离等)(20分)。

性能优化(30%):

  • 字幕识别准确率超过90%(55分)
  • 准确率低于60%(0分);
  • 准确率高于60%,低于70%(35分);
  • 准确率高于70%,低于80%(45分);
  • 准确率高于80%,低于90%(55分)。
  • 字幕识别延迟小于1s(35分)
  • 字幕识别延迟大于1s,小于2s(35分);
  • 字幕识别延迟大于s2,小于3s(25分);
  • 字幕识别延迟大于3s(0分)。
  • 对字幕获取处理流程输出系统资源使用情况(10分)
  • 输出字幕获取过程的系统资源情况,内存、CPU、显存等信息(10分)。

代码规范性(20%):

  • 代码目录结构清晰,易读,可维护性强(50分);
  • 符合开源社区规范(50分)。

文档质量(10%):

  • 概要设计说明书、测试设计说明书(50分);
  • 申报书、用户手册和安装说明(50分)。

赛题联系人:

于恒 yuheng@kylinos.cn

参考资料:

  • [1] FFmpeg多媒体处理框架 官网:https://github.com/linyqh/NarratoAIhttps://github.com/mpv-player/org 核心功能:音视频流提取、格式转换与时间轴同步;支持多轨道合成(字幕、配音、视频),为AI字幕工具提供底层处理能力 
  • [2] MPV播放器矿框架 项目地址:https://github.com/mpv-player/ 核心功能:集成音视频播放能力,便于开发;
  • [3] NarratoAI(智能视频解说与字幕生成) 项目地址:https://github.com/linyqh/NarratoAI 相关技术:基于Whisper的语音识别与时间轴同步技术; 多语言翻译(支持Qwen2-VL模型)与字幕-视频自动合成(FFmpeg集成); 实时处理优化方案,支持GPU加速降低延迟。

参赛资源支持:

[1] 麒麟软件有限公司可提供软件开发环境

快速启动:

1、解压

sudo apt-get install unzip
unzip KylinEcho.zip

2、安装 Node.js 和 npm【Node.js 22.X 版本尽量】

sudo apt update
sudo apt install curl
sudo apt install npm -y
sudo npm install -g n
sudo n 22

// 版本验证
node -v
npm -v

3、安装pnpm【-g 表示全局安装,全覆盖”攻击”】,更换国内源

sudo npm install -g pnpm
pnpm config set registry https://registry.npmmirror.com
npm config set registry https://registry.npmmirror.com

4、安装Vue3 依赖

cd ${KylinEcho_HOME}
pnpm install

5、安装electron 依赖

cd  ${KylinEcho_HOME}/modules/SystemElectron
npm install
npm config set registry http://registry.npmmirror.com
npm install electron
npm install -D concurrently wait-on

// 启动 electron 桌面应用
npm run electron:serve

6、安装miniconda,构建python虚拟环境(Kylin)

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh
echo 'eval "$(~/miniconda3/bin/conda shell.bash hook)"' >> ~/.bashrc
source ~/.bashrc
conda --version

conda create -n Kylin python=3.10
conda activate Kylin

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --set show_channel_urls yes

7、配置国内阿里云源:

cd ~
ls -a
mkdir .pip
cd .pip
vi pip.conf
“[global]
index-url = https://mirrors.aliyun.com/pypi/simple/

8、安装git、ffmpeg安装

sudo apt install -y git
sudo apt install -y ffmpeg

// 配置账号 & 密码
git config --global user.name  "jomos"
git config --global user.email "1411656134@qq.com"

9、在虚拟环境中安装 python依赖【各个国内源下载模块的速度也不一致】

cd $(KYLIN_HOME)/modules/Source
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn

Tip:

① 若开源项目未提供pyproject.toml,则在编译的时候加上 –use-pep517,强制用现代标准来构建和安装

② 在下载依赖时,相关的模块文件会先放在缓存中,导致系统的内存量激增,推荐:

pip install -r requirements.txt --no-cache-dir

10、🚀启动服务【先进入Kylin虚拟环境】

// 1.启动 Web UI服务
cd $(KYLIN_HOME)
pnpm run dev

// 2.启动 Electron 桌面应用
cd $(KYLIN_HOME)/modules/SystemElectron
npm run electron:serve

// 3.启动 实时字幕生成服务
cd $(KYLIN_HOME)/modules/RealtimeClient
python app.py

// 4.启动 离线字幕生成服务
cd $(KYLIN_HOME)/modules/OfflineSpeakersSubtitles
python app.py
'''
https://huggingface.co/pyannote/speaker-diarization-3.1
https://huggingface.co/pyannote/segmentation-3.0 
【需至 huggingface进行模型授权】
'''

// 5.启动 噪音人声过滤服务
cd $(KYLIN_HOME)/modules/AudioDenoising
python app.py

// 6.启动 硬字幕提取服务
cd $(KYLIN_HOME)/modules/HardSubtitleExtraction
python app.py

11、搭建nginx配置【上线测试,可选】

1. 编译vue3项目,生成dist
pnpm run build

2. 下载nginx
https://nginx.org/download/nginx-1.28.0.zip

3. 配置nginx
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       8848;
        server_name  localhost;

        # Vue3 静态文件(前端页面)
        root   F:/0_MyProject/KylinEcho/dist;
        index  index.html;

        location / {
            try_files $uri $uri/ /index.html;
        }

        # iframe 的页面代理(后端服务)
        location /index/page/ {
            proxy_pass   http://127.0.0.1:5010/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }

        location /OfflineGenerate/ {
            proxy_pass   http://127.0.0.1:5011/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }

        location /OfflineDenoising/ {
            proxy_pass   http://127.0.0.1:5012/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }

        location /HardSubtitleExtraction/ {
            proxy_pass   http://127.0.0.1:5013/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }
}

4. 进入nginx项目,并修改配置文件【上述内容】
F:\0_MyProject\nginx\conf\nginx.conf

5. 启动nginx【nginx 需要始终启动,更改之后 需要马上重载】
cmd
start nginx                启动

//其他命令:
nginx -s stop             停止
nginx -s reload            重启

6. 动态路由 KylinEcho\mockmock\asyncRoutes.ts 配置修改 
meta: {
    title: "实时字幕生成",
    frameSrc: "/api1/",
    roles: ["admin", "common"]
}
【不可用.ts 源代码路径来作为.js的最终实现,必须得用dist/index.html】

Tip:

设备不支持浮点数float16的话(如CPU),可使用float32类型,兼容性更强

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号