当前位置:网站首页>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.comrequests 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.
边栏推荐
- 深度学习,“粮草”先行--浅谈数据集获取之道
- 计算某像素点法线
- pytorch学习-没掌握的点
- Linear Regression 02---Boston Housing Price Prediction
- 动手学深度学习_多层感知机
- AWS uses EC2 to reduce the training cost of DeepRacer: DeepRacer-for-cloud practical operation
- (Navigation page) OpenStack-M version - manual construction of two nodes - with video from station B
- Halcon缺陷检测
- Vision Transformer 论文 + 详解( ViT )
- YOLOV4流程图(方便理解)
猜你喜欢

Vision Transformer 论文 + 详解( ViT )

PP-LiteSeg

Image-Adaptive YOLO for Object Detection in Adverse Weather Conditions

【Copy攻城狮日志】飞浆学院强化学习7日打卡营-学习笔记

TensorFlow2 study notes: 5. Common activation functions

The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation

Copy攻城狮的年度之“战”|回顾2020
![[Go language entry notes] 13. Structure (struct)](/img/0e/44601d02a1c47726d26f0ae5085cc9.png)
[Go language entry notes] 13. Structure (struct)

基于PyTorch的FCN-8s语义分割模型搭建

【CV-Learning】图像分类
随机推荐
Thoroughly understand box plot analysis
[Copy Siege Lion Log] Flying Pulp Academy Intensive Learning 7-Day Punch Camp-Study Notes
postgres recursive query
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
Copy攻城狮5分钟在线体验 MindIR 格式模型生成
【论文阅读】SPANET: SPATIAL PYRAMID ATTENTION NETWORK FOR ENHANCED IMAGE RECOGNITION
target has libraries with conflicting names: libcrypto.a and libssl.a.
Postgresql snapshot
TypeError: load() missing 1 required positional argument: ‘Loader‘
光条中心提取方法总结(二)
打金?工作室?账号被封?游戏灰黑产离我们有多近
【论文阅读】Anchor-Free Person Search
TensorFlow: tf.ConfigProto() and Session
[CV-Learning] Linear Classifier (SVM Basics)
MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification
DeblurGAN-v2: Deblurring (Orders-of-Magnitude) Faster and Better 图像去模糊
深度学习,“粮草”先行--浅谈数据集获取之道
亚马逊云科技Build On-Amazon Neptune基于知识图谱的推荐模型构建心得
MOOSE平台官方第二个例子分析——关于创建Kernel,求解对流扩散方程
强化学习中,Q-Learning与Sarsa的差别有多大?