我的征尘是星辰大海。。。
The dirt and dust from my pilgrimage forms oceans of stars...
-------当记忆的篇章变得零碎,当追忆的图片变得模糊,我们只能求助于数字存储的永恒的回忆
作者:黄教授
手机视频列表
从剪映字幕找回到中文语音转文字的难题
视频
音频
原始脚本
从剪映字幕找回,到中文语音转写攻坚,一场关于工具边界与语言本质的探索。 总结这段时间的折腾,看似是找回一段文案的小事,实则串联起工具选型、技术边界、中文特性的多重思考。 每一步试错都不是白费,反而让我们看清了语音转写这 监视的底层逻辑,也沉淀了可复用的方案。 整理出来,既是对这段经历的交代,也希望给有类似需求的人避坑。 一、需求起源,剪映的商业闭环,逼出来的技术探索,最初的核心诉求特别简单,找回剪映 AI 生成视频中的文案。 剪映的 AI Story 功能能把文字生成带字幕的视频。 但它的商业逻辑是闭环,字幕仅以 OSD 屏幕叠加形式烧录在视频里,不提供 SRT 源文件导出。 我虽有文案原稿,但视频生成过程中会有 AI 自动调整的细节,想完整复原最终呈现的文案,只能另寻出路。 可选路径其实很有限。 一,直接从视频中提取字幕,需 OCR 识别屏幕文字,后续可尝试,但当时优先选更成熟的语音转写。 二,视频转音频,再语音转文字。 这是最直接的替代方案,视频的音频就是文案的原声复刻,只要转写准确,就能还原文案。 于是我们的探索焦点从找字幕转向了如何让语音转写精准还原中文文案。 二,技术试错,从本地模型到云端服务。 看清工具的能力边界,我们先后尝试了两条核心路径,每一步试错都让我们更清楚什么工具适合什么场景。 一,本地模型,Whisper 点 CPP,灵活但受限于中文特性。 最初选择 Whisper 点 CPP,是看中它本地运行无需联网的优势,但实际使用中遇到了难以逾越的坎。 中文转写准确率瓶颈不是模型不好,而是中文本身的特性。 同音字多、歧义性强,比如硅基 vs 硅基裸模型,甚至古汉语表达,哪怕是人耳听都可能模糊。 本地模型缺乏云端的大数据校准,很难精准区分。 模型体积与性能权衡,大模型如 LARGE 杠 V3,准确率稍高,但占用资源多。 量化后的小模型如 Q50,虽适配本地硬件,却进一步牺牲了细节准确率。 特殊场景适配差,我们的文案是科技加文学混合风格,含 Agent、RAG、硅基等专业词。 本地模型的训练数据更偏向日常口语,对这类小众场景的适配不足。 结论,本地模型适合日常口语转写,如会议记录、普通对话。 但面对高精度中文文案还原,尤其是含专业词文学表达的场景,力不从心。 二、云端服务,火山引擎 ASR,精准度的最优解。 当本地模型无法满足需求时,转向云端服务是必然选择,不是本地模型差,而是云端服务的核心优势刚好命中我们的痛点。 中文优化更极致,云端模型依托海量中文语料训练,尤其是针对文案类语音,清晰、规整、无杂音的场景,转写准确率远超本地模型。 专业词语歧义处理更成熟,能更好区分中文同音字,识别专业术语,如 RAR, egg, agent,这是本地模型短期内无法企及的。 无需关注底层维护,不用折腾模型下载、量化硬件适配,只需调用 API,聚焦文案还原本身。 结论,对于高精度中文文案转写,云端成熟 ASR 服务是当前最可靠的选择。 它不是完美的,仍有极个别歧义需手动修正,但已是现有技术下的最优解。 三,脚本沉淀,从单文件到批量处理,让工具好用可靠,确定云端服务的核心路径后,我们的工作转向让工具适配实际使用场景,从单文件转写到批量处理,再到异常防护,每一次优化都围绕稳定、省心。 最终沉淀的两套核心脚本,完全贴合实验阶段加实用需求。 一、核心转写脚本,豆包下划线 save 点 py,负责单文件音频转写,集成中文句号换行,日志控制,确保转写结果易读,过程可追溯。 二、批量处理脚本,Batch, ASR, MPA, Pi,负责变目录下所有 MP3,实现同名 TXT 输出,存在即跳过,失败即停止,实验阶段保守策略。 保留所有现场工地 bug,不做多余操作。 脚本设计的核心原则,极简、可靠、无侵入、不破坏原有逻辑,仅解决批量调用加结果规整的需求,避免因复杂功能引入新问题。 四、核心感悟。 中文转写的本质是语言特性,而非技术问题。 这段探索最核心的收获不是找到一个完美工具,而是看清了一个真相中文语音转写的瓶颈本质是语言特性,而非技术能力。 拼音文字如英文,所读即所写,语音与文字的映射关系唯一,转写准确率天然容易拉满。 但中文是表同一发音对应多个汉字,且依赖语境区分歧义。 如模型 vs 魔术,哪怕是最先进的模型,也无法100%避免误差。 这不是技术不够强,而是语言本身的特性决定的。 我们花了很多精力折腾模型,优化脚本,看似是交学费,实则是搞懂了什么场景该用什么工具。 追求灵活离线使用,选 Whisper 点 CPP 日常口语场景够用。 追求高精度专业场景,选云端 ASR 服务,中文文案还原的最优解。 终极方案语音转写加视频 OCR 结合,语音保证内容完整,OCR 校正奇异字。 5后续方向,完善闭环,让文案还原更高效,这段探索没有结束。 后续可补充两个方向,形成完整闭环。 一、补充视频 OCR 功能,用 OCR 识别视频中的 OSD 字幕,与语音转写结果对比校准,进一步降低奇异误差。 二、优化批量脚本的失败处理。 实验阶段后,可新增失败阈值,自动重试,针对临时网络问题,让工具更适配长期使用。 总结,小事背后的价值是看清本质加沉淀方法。 这场从找字幕开始的探索,看似是一件小事,却串联起工具选型、技术边界、语言特性的深度思考。 我们没有发明新技术,但通过试错总结找到了最适合需求的解决方案,也沉淀了可复用的脚本和思路。 所谓不白费努力,不是一定要做出惊天动地的成果,而是每一次探索都能让我们更清楚什么可行,什么不可行。 每一次试错都能成为下一次解决问题的经验,这就是这段经历最大的价值。
修正脚本
从剪映字幕找回,到中文语音转写攻坚,一场关于工具边界与语言本质的探索。 总结这段时间的折腾,看似是找回一段文案的小事,实则串联起工具选型、技术边界、中文特性的多重思考。 每一步试错都不是白费,反而让我们看清了语音转写这件事的底层逻辑,也沉淀了可复用的方案。 整理出来,既是对这段经历的交代,也希望给有类似需求的人避坑。 一、需求起源,剪映的商业闭环,逼出来的技术探索,最初的核心诉求特别简单,找回剪映 AI 生成视频中的文案。 剪映的 AI Story 功能能把文字生成带字幕的视频。 但它的商业逻辑是闭环,字幕仅以 OSD 屏幕叠加形式烧录在视频里,不提供 SRT 源文件导出。 我虽有文案原稿,但视频生成过程中会有 AI 自动调整的细节,想完整复原最终呈现的文案,只能另寻出路。 可选路径其实很有限。 一,直接从视频中提取字幕,需 OCR 识别屏幕文字,后续可尝试,但当时优先选更成熟的语音转写。 二,视频转音频,再语音转文字。 这是最直接的替代方案,视频的音频就是文案的原声复刻,只要转写准确,就能还原文案。 于是我们的探索焦点从找字幕转向了如何让语音转写精准还原中文文案。 二,技术试错,从本地模型到云端服务。 看清工具的能力边界,我们先后尝试了两条核心路径,每一步试错都让我们更清楚什么工具适合什么场景。 一,本地模型,Whisper 点 CPP,灵活但受限于中文特性。 最初选择 Whisper 点 CPP,是看中它本地运行无需联网的优势,但实际使用中遇到了难以逾越的坎。 中文转写准确率瓶颈不是模型不好,而是中文本身的特性。 同音字多、歧义性强,比如硅基 vs 硅基裸模型,甚至古汉语表达,哪怕是人耳听都可能模糊。 本地模型缺乏云端的大数据校准,很难精准区分。 模型体积与性能权衡,大模型如 LARGE 杠 V3,准确率稍高,但占用资源多。 量化后的小模型如 Q50,虽适配本地硬件,却进一步牺牲了细节准确率。 特殊场景适配差,我们的文案是科技加文学混合风格,含 Agent、RAG、硅基等专业词。 本地模型的训练数据更偏向日常口语,对这类小众场景的适配不足。 结论,本地模型适合日常口语转写,如会议记录、普通对话。 但面对高精度中文文案还原,尤其是含专业词文学表达的场景,力不从心。 二、云端服务,火山引擎 ASR,精准度的最优解。 当本地模型无法满足需求时,转向云端服务是必然选择,不是本地模型差,而是云端服务的核心优势刚好命中我们的痛点。 中文优化更极致,云端模型依托海量中文语料训练,尤其是针对文案类语音,清晰、规整、无杂音的场景,转写准确率远超本地模型。 专业词语歧义处理更成熟,能更好区分中文同音字,识别专业术语,如 RAG, egg, agent,这是本地模型短期内无法企及的。 无需关注底层维护,不用折腾模型下载、量化硬件适配,只需调用 API,聚焦文案还原本身。 结论,对于高精度中文文案转写,云端成熟 ASR 服务是当前最可靠的选择。 它不是完美的,仍有极个别歧义需手动修正,但已是现有技术下的最优解。 三,脚本沉淀,从单文件到批量处理,让工具好用可靠,确定云端服务的核心路径后,我们的工作转向让工具适配实际使用场景,从单文件转写到批量处理,再到异常防护,每一次优化都围绕稳定、省心。 最终沉淀的两套核心脚本,完全贴合实验阶段加实用需求。 一、核心转写脚本,豆包下划线 save 点 py,负责单文件音频转写,集成中文句号换行,日志控制,确保转写结果易读,过程可追溯。 二、批量处理脚本,Batch, ASR, MPA, Pi,负责遍历目录下所有 MP3,实现同名 TXT 输出,存在即跳过,失败即停止,实验阶段保守策略。 保留所有现场工地 bug,不做多余操作。 脚本设计的核心原则,极简、可靠、无侵入、不破坏原有逻辑,仅解决批量调用加结果规整的需求,避免因复杂功能引入新问题。 四、核心感悟。 中文转写的本质是语言特性,而非技术问题。 这段探索最核心的收获不是找到一个完美工具,而是看清了一个真相中文语音转写的瓶颈本质是语言特性,而非技术能力。 拼音文字如英文,所读即所写,语音与文字的映射关系唯一,转写准确率天然容易拉满。 但中文是表意文字,同一发音对应多个汉字,且依赖语境区分歧义。 如模型 vs 魔术,哪怕是最先进的模型,也无法100%避免误差。 这不是技术不够强,而是语言本身的特性决定的。 我们花了很多精力折腾模型,优化脚本,看似是交学费,实则是搞懂了什么场景该用什么工具。 追求灵活离线使用,选 Whisper 点 CPP 日常口语场景够用。 追求高精度专业场景,选云端 ASR 服务,中文文案还原的最优解。 终极方案语音转写加视频 OCR 结合,语音保证内容完整,OCR 校正歧义字。 五、后续方向,完善闭环,让文案还原更高效,这段探索没有结束。 后续可补充两个方向,形成完整闭环。 一、补充视频 OCR 功能,用 OCR 识别视频中的 OSD 字幕,与语音转写结果对比校准,进一步降低歧义误差。 二、优化批量脚本的失败处理。 实验阶段后,可新增失败阈值,自动重试,针对临时网络问题,让工具更适配长期使用。 总结,小事背后的价值是看清本质加沉淀方法。 这场从找字幕开始的探索,看似是一件小事,却串联起工具选型、技术边界、语言特性的深度思考。 我们没有发明新技术,但通过试错总结找到了最适合需求的解决方案,也沉淀了可复用的脚本和思路。 所谓不白费努力,不是一定要做出惊天动地的成果,而是每一次探索都能让我们更清楚什么可行,什么不可行。 每一次试错都能成为下一次解决问题的经验,这就是这段经历最大的价值。
英文翻译
From retrieving CapCut subtitles to tackling Chinese speech transcription, an exploration of tool boundaries and the essence of language. Summarizing this period of tinkering, it seems like a trivial matter of recovering a piece of text, but in reality, it weaves together multiple reflections on tool selection, technical boundaries, and the characteristics of the Chinese language. Every trial and error was not in vain; instead, it helped us see the underlying logic of speech transcription and accumulate reusable solutions. Organizing these insights serves both as a record of this experience and as a guide for others with similar needs to avoid pitfalls. **1. Origin of the Need: CapCut’s Business Closed Loop and the Forced Technical Exploration** The initial core requirement was very simple: retrieve the text from AI-generated videos in CapCut. CapCut’s AI Story feature can generate videos with subtitles from text. However, its business logic is a closed loop. Subtitles are burned directly into the video as OSD screen overlays, with no SRT source file export available. Although I had the original text drafts, the video generation process involved AI-driven adjustments to details. To fully reconstruct the final displayed text, I had to find another way. The available paths were actually very limited: 1. Extracting subtitles directly from the video required OCR recognition of on-screen text, which could be attempted later, but at the time, more mature speech transcription was prioritized. 2. Converting the video to audio and then transcribing speech to text. This was the most straightforward alternative. The audio in the video is an exact copy of the original voiceover; as long as the transcription is accurate, the text can be recovered. Thus, our exploration shifted from finding subtitles to figuring out how to achieve precise Chinese speech transcription. **2. Technical Trial and Error: From Local Models to Cloud Services — Understanding Tool Capabilities** We tried two core paths, and each misstep made us clearer about which tool suits which scenario. **1. Local Model: Whisper.cpp — Flexible but Limited by Chinese Characteristics** Initially, we chose Whisper.cpp for its advantage of running locally without an internet connection. However, practical usage revealed insurmountable hurdles. - **Bottleneck in Chinese transcription accuracy**: The problem wasn’t the model itself, but the characteristics of Chinese. Many homophones and high ambiguity—e.g., "硅基" vs. "硅基裸模型," or even classical Chinese expressions—can be confusing even to the human ear. Local models lack the big-data calibration of cloud services, making it hard to distinguish precisely. - **Trade-off between model size and performance**: Large models (e.g., large-v3) offer slightly higher accuracy but consume significant resources. Quantized small models (e.g., Q50), while suited for local hardware, further sacrifice detail accuracy. - **Poor adaptation to specialized scenarios**: Our text had a mix of tech and literary styles, including terms like Agent, RAG, and silicon substrate. Local models are trained more on everyday spoken language and lack sufficient coverage for such niche contexts. **Conclusion**: Local models are suitable for everyday spoken transcription (e.g., meeting notes, casual conversations). However, they fall short when high-precision reconstruction of Chinese text is required, especially in scenarios involving specialized vocabulary and literary expressions. **2. Cloud Service: Volcengine ASR — The Optimal Solution for Accuracy** When the local model couldn’t meet the requirements, turning to a cloud service was inevitable. It’s not that local models are bad; rather, the core advantages of cloud services exactly hit our pain points. - **More optimized for Chinese**: Cloud models are trained on massive Chinese corpora. Especially for speech in text-based scenarios—clear, well-structured, no background noise—their transcription accuracy far exceeds local models. - **Better handling of specialized terms and ambiguity**: They can more effectively distinguish Chinese homophones and recognize professional terms (e.g., RAG, Agent), which local models cannot achieve in the short term. - **No need to worry about underlying maintenance**: No need to bother with model downloads, quantization, or hardware compatibility. Just call the API and focus on text reconstruction. **Conclusion**: For high-precision Chinese text transcription, mature cloud ASR services are currently the most reliable choice. They are not perfect—occasional ambiguities still require manual correction—but they represent the best solution under existing technology. **3. Script Development: From Single File to Batch Processing — Making the Tool Usable and Reliable** After confirming the cloud service as the core path, we shifted our focus to adapting the tool for real-world usage: from single-file transcription to batch processing, and from there to error protection. Every optimization revolved around stability and convenience. Two core scripts were finally developed, fully meeting the needs of both the experimental phase and practical application: 1. **Core transcription script**: `doubao_save.py` — responsible for single-file audio transcription. It integrates features like inserting line breaks after Chinese periods and logging control, ensuring readability of results and traceability of the process. 2. **Batch processing script**: `Batch_ASR_MP3.py` — traverses all MP3 files in a directory, outputs text files with the same name, skips if the output already exists, and stops on failure. This conservative strategy was used during the experimental phase to preserve all on-site traces for debugging, avoiding unnecessary operations. **Design principles of the scripts**: Minimalist, reliable, non‑intrusive, and not disrupting original logic. They only solve the need for batch invocation and result normalization, preventing new issues from complex features. **4. Core Insights** **The essence of Chinese transcription is a language characteristic, not a technical problem.** The most important takeaway from this exploration is not finding a perfect tool, but recognizing a truth: the bottleneck of Chinese speech transcription is fundamentally a language feature, not a technical capability. For phonetic languages like English, what is spoken is what is written. The mapping between speech and text is unique, making it naturally easy to achieve high transcription accuracy. But Chinese is a logographic language. The same pronunciation can correspond to multiple Chinese characters, and disambiguation depends on context. For example, "模型" (model) vs. "魔术" (magic). Even the most advanced model cannot be 100% error-free. This is not because the technology is weak, but because of the inherent nature of the language. We spent a lot of effort tinkering with models and optimizing scripts. It may seem like we were paying tuition, but in reality, we were figuring out which tool to use for which scenario: - For flexibility and offline use, choose Whisper.cpp — sufficient for everyday spoken scenarios. - For high-precision professional scenarios, choose cloud ASR services — the optimal solution for Chinese text reconstruction. - The ultimate solution: combine speech transcription with video OCR. Speech ensures content completeness, while OCR corrects ambiguous characters. **5. Future Directions: Closing the Loop for More Efficient Text Reconstruction** This exploration is not over. Two directions can be added to form a complete loop: 1. **Add video OCR functionality**: Use OCR to recognize on-screen subtitles in the video, then compare and calibrate them with the speech transcription results to further reduce ambiguity errors. 2. **Optimize failure handling in batch scripts**: After the experimental phase, add failure thresholds and automatic retries to handle temporary network issues, making the tool more suitable for long-term use. **Summary** **The value behind small matters: Seeing the essence and accumulating methods.** This exploration, which started with finding subtitles, may seem trivial, but it wove together deep reflections on tool selection, technical boundaries, and language characteristics. We did not invent new technology, but through trial and error, we found the most suitable solution for our needs and accumulated reusable scripts and ideas. The so-called "effort not wasted" does not mean one must achieve earth-shattering results. Rather, every exploration helps us become clearer about what works and what doesn’t. Every trial and error becomes experience for solving the next problem. That is the greatest value of this journey.
back to top