当前位置:网站首页>Cut the hit pro subtitles export of essays
Cut the hit pro subtitles export of essays
2022-08-04 06:21:00 【language】
Clipping Pro Subtitle Export Essay
Recently, there is a small need to identify the human voice in the video and convert it into subtitles and export it,After looking around, I found that the professional version of Toutiao is really easy to use,Take advantage of the Subtitle Recognition feature of Clip Movie Pro,以及抓包工具 fiddler Get the subtitlesjson文件,实现“字幕导出”.This article is here to commemorate it,截止2021年03月14日12:19:26,此方法有效,It is not excluded that the method may fail after the clipping upgrade.
环境准备
First you must install Clipper Pro,If you haven't used Clipping Pro,请自行搜索关键字【剪映】下载安装;In addition, you need to install a package capture tool,笔者安装的是【Fiddler】,It is worth noting that it needs to be turned on https 抓包模式.
A screenshot of the environment is as follows:
剪映
Fiddler
Data processing I use NodeJS,此处就不展开介绍了,If you don't know how to code,可以搜索一下【Cut the subtitlessrt】
字幕生成
首先,We import the video into the clipping footage,如下图所示,After the import is successful, a video preview will be generated,And the small window on the left shows that it has been added.
接着,我们切换到到【文本-识别字幕】,点击【开始识别】,At this point, Clipping Pro will recognize the human voice in the video,And automatically generate subtitle files on the timeline.
Caption Capture
然后呢,We methodically opened the packet grabber,并开启 HTTPS 模式,It is worth noting that this step requires a trust certificate.
At this time, we better add a filter condition,只显示lv-pc-api.ulikecam.com
requests under this domain,That is, the interface for clipping and subtitle processing.If the subtitles have been processed at this point,Then click again in the above step【开始识别】按钮.
Because the video I deal with is relatively long,About an hour and a half,Therefore, it takes a long time to generate subtitles,That's why I'm not in a hurry,稍等片刻,发现 fiddler No more spitting out new request messages,最终https://lv-pc-api.ulikecam.com/lv/v1/audio_subtitle/query
This interface returns our subtitles.
字幕处理
最后一步了,In fact, we just need to copy what we caught in the previous stepJSONThe data realizes the subtitle export.处理这个JSON数据的方式有很多,For example, you can use some public gadgets,把这个JSON数据直接转成SRT字幕文件,You can also write programs by yourself through programming languages to handle according to your own needs.The author is more familiar with itJavaScript,因此使用NodeJS来处理,The final file is generated in text format.
Let's first take a look at the subtitle data format I captured:
{
"ret": "0",
"errmsg": "success",
"svr_time": 1615699052,
"log_id": "202103141317310102121441631D8D72AD",
"data": {
"utterances": [{
"text": "直播课堂",
"start_time": 0,
"end_time": 896,
"words": [{
"text": "直",
"start_time": 0,
"end_time": 258
},
{
"text": "播",
"start_time": 258,
"end_time": 360
},
{
"text": "课",
"start_time": 360,
"end_time": 520
},
{
"text": "堂",
"start_time": 520,
"end_time": 896
}
]
},
{
"text": "See you all again",
"start_time": 2063,
"end_time": 3680,
"words": [{
"text": "又",
"start_time": 2063,
"end_time": 2240
},
{
"text": "一",
"start_time": 2240,
"end_time": 2400
},
{
"text": "次",
"start_time": 2400,
"end_time": 2576
},
{
"text": "跟",
"start_time": 2663,
"end_time": 2840
},
{
"text": "大",
"start_time": 2840,
"end_time": 2980
},
{
"text": "家",
"start_time": 2980,
"end_time": 3120
},
{
"text": "见",
"start_time": 3120,
"end_time": 3296
},
{
"text": "面",
"start_time": 3303,
"end_time": 3496
},
{
"text": "了",
"start_time": 3503,
"end_time": 3680
}
]
},
{
"text": "I'm still the familiar host Mina",
"start_time": 3680,
"end_time": 6656,
"words": [{
"text": "我",
"start_time": 3680,
"end_time": 3856
},
{
"text": "还",
"start_time": 3863,
"end_time": 4056
},
{
"text": "是",
"start_time": 4103,
"end_time": 4296
},
{
"text": "大",
"start_time": 4543,
"end_time": 4700
},
{
"text": "家",
"start_time": 4700,
"end_time": 4856
},
{
"text": "熟",
"start_time": 5023,
"end_time": 5216
},
{
"text": "悉",
"start_time": 5223,
"end_time": 5380
},
{
"text": "的",
"start_time": 5380,
"end_time": 5500
},
{
"text": "主",
"start_time": 5500,
"end_time": 5620
},
{
"text": "持",
"start_time": 5620,
"end_time": 5740
},
{
"text": "人",
"start_time": 5740,
"end_time": 5896
},
{
"text": "美",
"start_time": 6063,
"end_time": 6256
},
{
"text": "娜",
"start_time": 6263,
"end_time": 6656
}
]
}
]
}
}
因此,The author's code is also very concise:
const fs = require('fs')
const rawdata = fs.readFileSync('./srt.json');
const {
data} = JSON.parse(rawdata);
const {
utterances} = data
let txt = ''
for(let i of utterances) {
txt += i.text + '\n'
}
fs.writeFile('srt.txt', txt, function (err) {
if (err) {
return console.error(err);
}
});
最终生成的txt文件如下图:
Of course if you need processing time,处理start_time
和end_time
这两个字段即可.
小结
本次分享就到这,In fact, the whole process is very simple,It just captures the identification request based on the subtitles identified by the professional version of Clipping,最终获得JOSN数据.If you have a better way to handle it,Feel free to share with me in the comments section.
边栏推荐
- [CV-Learning] Semantic Segmentation
- 多层LSTM
- pytorch学习-没掌握的点
- Thunderbolt turns off automatic updates
- Deep Learning Theory - Initialization, Parameter Adjustment
- Copy Siege Lions "sticky" to AI couplets
- Pytorch语义分割理解
- 动手学深度学习_线性回归
- PCL窗口操作
- (TensorFlow) - detailed explanation of tf.variable_scope and tf.name_scope
猜你喜欢
浅谈游戏音效测试点
【论文阅读】Multi-View Spectral Clustering with Optimal Neighborhood Laplacian Matrix
深度学习理论 —— 初始化、参数调节
Copy Siege Lion 5-minute online experience MindIR format model generation
动手学深度学习_softmax回归
How to get started with MOOSE platform - an example of how to run the official tutorial
[Copy Siege Lion Log] Flying Pulp Academy Intensive Learning 7-Day Punch Camp-Study Notes
典型CCN网络——efficientNet(2019-Google-已开源)
深度确定性策略梯度(DDPG)
No matching function for call to 'RCTBridgeModuleNameForClass'
随机推荐
latex-写论文时一些常用设置
Transformer
【CV-Learning】线性分类器(SVM基础)
打金?工作室?账号被封?游戏灰黑产离我们有多近
Install Minikube Cluster in AWS-EC2
[Deep Learning 21 Days Learning Challenge] Memo: What does our neural network model look like? - detailed explanation of model.summary()
【论文阅读】Anchor-Free Person Search
Pytorch问题总结
Halcon缺陷检测
如何用Pygame制作简单的贪吃蛇游戏
tensorRT教程——tensor RT OP理解(实现自定义层,搭建网络)
JPEG2jpg
MOOSE平台官方第二个例子分析——关于创建Kernel,求解对流扩散方程
Linear Regression 02---Boston Housing Price Prediction
The difference between oracle temporary table and pg temporary table
Copy Siege Lion 5-minute online experience MindIR format model generation
TensorFlow2 study notes: 8. tf.keras implements linear regression, Income dataset: years of education and income dataset
MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification
语音驱动嘴型与面部动画生成的现状和趋势
2020-10-29