Codex 可對 MP4 直接產生日文逐字搞,且包含中文翻譯與單字解釋。
Version
Codex 0.139.0
Homebrew
$ brew install ffmpeg
$ python3 -m pip install -U openai-whisper
- 安裝 ffmpeg
- 安裝 openai-whisper
Whisper Model
$ mkdir -p /Users/oomusou/whisper_models
- 建立 model 的目錄:
whisper_models
python3 - <<'PY'
import whisper
model_dir = "/Users/oomusou/whisper_models"
whisper.load_model("medium", download_root=model_dir)
print("medium model downloaded to", model_dir)
PY
- 下載 model
$ ls -lh /Users/oomusou/whisper_models
- 應顯示
medium.pt
Model to Cache
> Whisper Model 目前放在 /Users/oomusou/whisper_models 下,將 medium.pt 放到 Cache 下方便 Codex 調用
- 在 Codex 下將 Whisper Model 放到 Cache 下方便Codex 調用
Prompt
1. new.mp4 的逐字稿為 lecture40.md
2. 幫我用 whisper 重新校正其正確性與斷句
3. Whisper Model 目前放在 /Users/oomusou/whisper_models
4. 最後將每一句參考 fill skill 加上單字解釋
- 以上為基本的 prompt,告知 Whisper model 放在哪裡,要做哪些事情
Conclusion
- 之後可直接在 Codex CLI 下直接使用 ffmpeg 與 whisper 產生 mp4 的逐字稿
- Model 可挑
small或medium,基本上small就已經可用,medium會更精確些