我想通过使用Zenity来加速我的视频字幕创作。我没有Python的经验,也有Zenity的经验。所以我做了:
#!/bin/bash
cd ~/Desktop
file="$(zenity --title "Video to subtitles: Select a File to convert" --file- selection )"
wavfile="$(zenity --file-selection --save --confirm-overwrite --filename="${file%.*}.wav")"
srtfile="$(zenity --file-selection --save --confirm-overwrite --filename="${file%.*}.srt")"
ffmpeg -i "$file" -c:a pcm_s16le -ac 1 "$wavfile"
cd ~/vosk-api/python/example
time python3 ./test_srt.py "$wavfile" > "$srtfile"
zenity --info --text "Conversion Completed"当然,我忘了最后一点是使用python进行转换,而Python与bash的关系不太好,所以我得到了零输出。
有人接电话吗?希望是你的,惠奇
发布于 2022-02-15 21:04:45
假警报。效果很好。我忘了解压vosk模型。下面的部分是:
unzip vosk-model-small-en-us-0.3.zip
mv vosk-model-small-en-us-0.3 model
time python3 ./test_srt.py "$wavfile" > "$srtfile"
zenity --info --text "Conversion Completed"真对不起。
https://stackoverflow.com/questions/71104557
复制相似问题