我有一个国际会议视频,其中包含两种口语,即视频中混有英语和汉语句子。我想通过命令行删除中文部分。
首先,使用生成字幕文件whisper
whisper myvideo --model large --language en
字幕文件包含语言和时间
1
00:00:00,000 --> 00:00:04,220
if you are not concerned and doing the work of the Lord.
2
00:00:09,120 --> 00:00:13,880
如果你不愿意去遵行耶稣基督的话语的话,
3
00:00:14,220 --> 00:00:18,220
就没有必要昼夜去默想神的话。
4
00:00:18,220 --> 00:00:22,200
Take more of me, give me more of you.
....
问题是如何使用命令行并根据字幕中的时间ffmpeg
删除所有中文视频部分?视频很长,目的是使用命令行来完成任务,而不是手动。
步骤1)所以我需要识别字幕每一行的语言:
#!/bin/bash
while IFS= read -r line
do
echo "text: $line"
lan= trans -id $line |awk '/^Code/ {print $2}'
echo "lan: $lan"
done < "$1"
那么上面的 bash 还不能正常工作,该怎么办呢?