feat: VRSub 单体应用(WOV 单机版)初始提交
为视频生成 VR 双眼字幕的单体实现:FastAPI 后端、调度器与全部节点 (提音/转写/翻译/ASS/抽帧/OCR/LLM 过滤)在单进程内运行。 - 节点协议(wov_sdk 数据模型)与分布式版保持一致,预留回退桥梁 - 工作流即数据:DAG 存于 workflows/*.json,模型/链路改动只改数据 - 调度器:拓扑顺序执行、断点续跑(产物重建)、任务暂停/继续 - 抽帧按帧间隔(select 按帧号精确取帧),VLM OCR 与 LLM 过滤使用 自适应线程池弹性并发,并打印数据处理速度进度日志 - 100% 行覆盖率(pytest --cov-fail-under=100)
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"id": "demo",
|
||||
"name": "视频字幕生成",
|
||||
"description": "上传视频,自动生成中文字幕和 VR 双眼 ASS。",
|
||||
"version": 1,
|
||||
"definition": {
|
||||
"name": "视频字幕生成",
|
||||
"version": 1,
|
||||
"nodes": [
|
||||
{
|
||||
"id": "extract",
|
||||
"node_type": "ffmpeg-extract",
|
||||
"params": {
|
||||
"sample_rate": 16000,
|
||||
"channels": 1
|
||||
},
|
||||
"inputs": {
|
||||
"video_uri": "input.video_uri"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "asr",
|
||||
"node_type": "faster-whisper",
|
||||
"params": {
|
||||
"language": "ja",
|
||||
"model_path": "faster-whisper-large-v3",
|
||||
"condition_on_previous_text": false,
|
||||
"chunk_seconds": 60,
|
||||
"vad_filter": true
|
||||
},
|
||||
"inputs": {
|
||||
"audio_uri": "extract.audio_uri"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "translate",
|
||||
"node_type": "llm-translate",
|
||||
"params": {
|
||||
"target_language": "zh-CN"
|
||||
},
|
||||
"inputs": {
|
||||
"srt_uri": "asr.srt_uri"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ass",
|
||||
"node_type": "srt-to-dual-eye-ass",
|
||||
"params": {
|
||||
"resolution": "3840x1920"
|
||||
},
|
||||
"inputs": {
|
||||
"cn_srt_uri": "translate.cn_srt_uri"
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"from": "extract",
|
||||
"to": "asr"
|
||||
},
|
||||
{
|
||||
"from": "asr",
|
||||
"to": "translate"
|
||||
},
|
||||
{
|
||||
"from": "translate",
|
||||
"to": "ass"
|
||||
}
|
||||
],
|
||||
"entry_inputs": {
|
||||
"video_uri": "file"
|
||||
},
|
||||
"final_outputs": {
|
||||
"cn_srt": "translate.cn_srt_uri",
|
||||
"ass": "ass.ass_uri"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"id": "ocr-subtitle",
|
||||
"name": "字幕OCR提取",
|
||||
"description": "抽帧并 OCR 提取视频烧录字幕,经 LLM 过滤无意义内容后生成带时间轴的 SRT 基准数据。",
|
||||
"version": 3,
|
||||
"definition": {
|
||||
"name": "字幕OCR提取",
|
||||
"version": 3,
|
||||
"nodes": [
|
||||
{
|
||||
"id": "extract",
|
||||
"node_type": "frame-extract",
|
||||
"params": {
|
||||
"interval_seconds": 0.5,
|
||||
"crop": [
|
||||
0,
|
||||
0.82,
|
||||
1,
|
||||
0.18
|
||||
]
|
||||
},
|
||||
"inputs": {
|
||||
"video_uri": "input.video_uri"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ocr",
|
||||
"node_type": "subtitle-ocr",
|
||||
"params": {
|
||||
"prompt": "提取图像中的文字,不要描述图片中的内容"
|
||||
},
|
||||
"inputs": {
|
||||
"frames_manifest": "extract.frames_manifest"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "filter",
|
||||
"node_type": "llm-filter",
|
||||
"params": {},
|
||||
"inputs": {
|
||||
"srt_uri": "ocr.srt_uri"
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"from": "extract",
|
||||
"to": "ocr"
|
||||
},
|
||||
{
|
||||
"from": "ocr",
|
||||
"to": "filter"
|
||||
}
|
||||
],
|
||||
"entry_inputs": {
|
||||
"video_uri": "file"
|
||||
},
|
||||
"final_outputs": {
|
||||
"srt": "filter.srt_uri"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"id": "zh-direct",
|
||||
"name": "中文直出字幕",
|
||||
"description": "使用中文直出模型直接生成中文字幕和 VR 双眼 ASS,无需 LLM 翻译。",
|
||||
"version": 1,
|
||||
"definition": {
|
||||
"name": "中文直出字幕",
|
||||
"version": 1,
|
||||
"nodes": [
|
||||
{
|
||||
"id": "extract",
|
||||
"node_type": "ffmpeg-extract",
|
||||
"params": {
|
||||
"sample_rate": 16000,
|
||||
"channels": 1
|
||||
},
|
||||
"inputs": {
|
||||
"video_uri": "input.video_uri"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "asr",
|
||||
"node_type": "faster-whisper",
|
||||
"params": {
|
||||
"language": "ja",
|
||||
"task": "translate",
|
||||
"model_path": "whisper-large-v2-translate-zh-v0.2-st-ct2",
|
||||
"target_language": "zh-CN",
|
||||
"condition_on_previous_text": false,
|
||||
"chunk_seconds": 60,
|
||||
"vad_filter": true
|
||||
},
|
||||
"inputs": {
|
||||
"audio_uri": "extract.audio_uri"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ass",
|
||||
"node_type": "srt-to-dual-eye-ass",
|
||||
"params": {
|
||||
"resolution": "3840x1920"
|
||||
},
|
||||
"inputs": {
|
||||
"cn_srt_uri": "asr.srt_uri"
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{
|
||||
"from": "extract",
|
||||
"to": "asr"
|
||||
},
|
||||
{
|
||||
"from": "asr",
|
||||
"to": "ass"
|
||||
}
|
||||
],
|
||||
"entry_inputs": {
|
||||
"video_uri": "file"
|
||||
},
|
||||
"final_outputs": {
|
||||
"cn_srt": "asr.srt_uri",
|
||||
"ass": "ass.ass_uri"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user