繁体   English   中英

zenity 文件处理到 python

[英]zenity file handling to python

我想通过使用 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不合,所以我得到零output。

有接盘者吗? 希望是你的,惠誉

虚惊。 它工作正常。 我忘了解压 vosk model。所以底部现在是:

  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"

对于那个很抱歉。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM