auto-subtitle利用open AI Whisper离线自生成字幕
autosub
太老需要上传谷歌需要 python2.7
auto-subs
是给达芬奇剪辑软件用的
https://github.com/m1guelpf/auto-subtitle
使用离线的 OpenAI's Whisper
ffmpeg
,同时需要去 https://github.com/BtbN/FFmpeg-Builds/releases
下载合适的 windows
版本(我选择的是 ffmpeg-n7.1-latest-win64-lgpl-shared-7.1.zip
)解压到合适的位置并且在环境变量的 Path
中添加这个目录
我是通过 conda
安装的
同时也得把 python
的 script
添加到环境变量,在用户的变量里添加
%temp%\..\..\roaming\python\python312\scripts\
还有 conda
的安装目录,因为python的执行文件在那里
pip install ffmpeg-python
pip
要卸载 ffmpeg
,因为跟 windows
的指令不对应。。。在 pip
中安装的只是 ffmpeg
的指令不是执行文件。。。
pip uninstall ffmpeg
使用办法:
auto_subtitle '1.mp4' --srt_only 'True'
使用默认的指令
auto_subtitle '1.mp4' -o subtitled/
报错,估计是 ffmpeg
合成加字幕的视频的时候指令出问题,
查看到时读不到字幕地址,也许因为 windows
的地址问题。。。
实际上也不需要合成字幕和视频。。。
另外就是 wav
是在 %temp%
应该不是自动清除。。。
windows
下的拖拽文件:
@echo off
chcp 65001>>nul
set as="%temp%\..\..\roaming\python\python312\scripts\auto_subtitle.exe"
%as% "%~nx1" --srt_only "True"
del /f %temp%\%~n1.wav
::pause
保存成 .bat
拖拽到上面就能生成字幕了
或者来看看这个
https://github.com/leejohannes/ffmpeg-win-drag_CN
推荐阅读:
扫描二维码,在手机上阅读