当前位置:网站首页>Clip +json parsing converts the sound in the video into text
Clip +json parsing converts the sound in the video into text
2022-07-06 22:26:00 【fangye945a】
Preface
Sometimes we want to convert the audio in a video into text , The simplest and dumbest way is to listen through human ears , Then type it out . But this method is undoubtedly very laborious . Smart friends must know that we can do this with the help of speech recognition tools , But the more realistic point is , Many identification software is not charged , That is, the recognition accuracy is relatively low . So what can we do to convert the audio in the video into text without spending money and accurately ?
resolvent
Friends with editing experience must know , Cut and reflect
The subtitle recognition function of this software , Behind it is ByteDance speech recognition technology , The recognition accuracy of Putonghua is extremely high . But one thing is , The subtitles he recognizes are segmented , Copy them one by one to form a complete text , Its workload is also a lot .
that , Here is a simple method :
Specific operation steps
- 1. download windows Version clipping
- 2. Import video
- 3. Identify subtitles ( After importing the video , Click on the text -> Smart subtitles -> Just start to recognize )
- 4. Wait a while ( The length of time depends on the size of the video file ), Subtitles will be automatically generated .
- 5. After generating subtitles , Close clip , Will be automatically saved as a draft . At this time, open the clip , The box of draft parameters appears in the upper right corner , In the box, we can find the path to save the draft .
- 6. stay windows Open the save location in Explorer , You can see the following documents .
- 7. It is not difficult to find out according to the English name ,draft_content.json Is our draft content , The subtitle text just generated is also saved in this json In file .
- 8. Since it is json file , The next step is naturally json Parsed , We can extract the subtitle content from this file .
- 9. analysis json file , Find the fields to parse , simplified json The structure is as follows :
{"materials":{"texts":[{"content":"<font id=\"\" path=\"D:/Program Files/JianyingPro/3.0.5.8542/Resources/Font/SystemFont/zh-hans.ttf\"><color=(1.000000, 1.000000, 1.000000, 1.000000)><size=5.000000> Hello, students </size></color></font>"}]}}
And we need subtitles , By three xml Element label wrap .
- 10. Let's go through json Parse get content The contents of the field , And then eliminate by string processing xml label , Get the final text subtitle content .
Here is a simple one I wrote python Script , It can be easily and quickly processed to clip this one with subtitles json file :
import json
if __name__ == '__main__':
with open("draft_content.json", "r", encoding='utf-8') as f:
json_str = f.read()
json_content = json.loads(json_str)
texts_data = json_content["materials"]["texts"]
for text_data in texts_data:
content = text_data["content"]
content = content[:-22]
result = content.split("><size=")[1].split(">")[1]
print(result)
- 11. Directly connect the script to json The files are placed in the same directory , perform python The script can get the subtitle content you need .
We can also redirect symbols , Directly generate the output content into a file
python3 parse_jianyin.py >> output.txt
边栏推荐
- Seata aggregates at, TCC, Saga and XA transaction modes to create a one-stop distributed transaction solution
- Unity3d minigame-unity-webgl-transform插件转换微信小游戏报错To use dlopen, you need to use Emscripten‘s...问题
- What are the interface tests? What are the general test points?
- Force buckle 575 Divide candy
- AI enterprise multi cloud storage architecture practice | Shenzhen potential technology sharing
- NPDP certification | how do product managers communicate across functions / teams?
- 十二、启动流程
- Daily question 1: force deduction: 225: realize stack with queue
- [Digital IC hand tearing code] Verilog burr free clock switching circuit | topic | principle | design | simulation
- 做接口测试都测什么?有哪些通用测试点?
猜你喜欢
RESNET rs: Google takes the lead in tuning RESNET, and its performance comprehensively surpasses efficientnet series | 2021 arXiv
LeetCode刷题(十一)——顺序刷题51至55
Management background --1 Create classification
第4章:再谈类的加载器
Aardio - 封装库时批量处理属性与回调函数的方法
Assembly and Interface Technology Experiment 6 - ADDA conversion experiment, AD acquisition system in interrupt mode
NPDP certification | how do product managers communicate across functions / teams?
基於 QEMUv8 搭建 OP-TEE 開發環境
Aardio - 利用customPlus库+plus构造一个多按钮组件
BarcodeX(ActiveX打印控件) v5.3.0.80 免费版使用
随机推荐
小程序系统更新提示,并强制小程序重启并使用新版本
2022-07-05 使用tpcc对stonedb进行子查询测试
C # réalise la liaison des données du rapport Crystal et l'impression du Code à barres 4
解决项目跨域问题
Inno Setup 打包及签名指南
中国VOCs催化剂行业研究与投资战略报告(2022版)
GPS from getting started to giving up (XI), differential GPS
The SQL response is slow. What are your troubleshooting ideas?
图像的spatial domain 和 frequency domain 图像压缩
Classic sql50 questions
MySQL约束的分类、作用及用法
软考高级(信息系统项目管理师)高频考点:项目质量管理
Leetcode question brushing (XI) -- sequential questions brushing 51 to 55
2022年6月国产数据库大事记-墨天轮
二叉(搜索)树的最近公共祖先 ●●
What a new company needs to practice and pay attention to
Memorabilia of domestic database in June 2022 - ink Sky Wheel
Notes de développement du matériel (10): flux de base du développement du matériel, fabrication d'un module USB à RS232 (9): création de la Bibliothèque d'emballage ch340g / max232 SOP - 16 et Associa
Data processing skills (7): MATLAB reads the data in the text file TXT with mixed digital strings
zabbix 代理服务器 与 zabbix-snmp 监控