Fix guide for M4 video endpoints 500

This commit is contained in:
Accusys
2026-05-08 12:52:12 +08:00
parent d6ba74a61a
commit 0977a04002

View File

@@ -0,0 +1,36 @@
# Video Endpoints 500 修復
M5 測試正常,問題在 M4 的 launchd service PATH 沒有 ffmpeg。
## 解法 1launchd 加 PATH
```bash
# 找出 momentry 的 plist
ls ~/Library/LaunchAgents/*momentry* /Library/LaunchAgents/*momentry* 2>/dev/null
# 在 plist 的 <dict> 內加入:
# <key>EnvironmentVariables</key>
# <dict>
# <key>PATH</key>
# <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
# </dict>
# 重新載入
launchctl unload ~/Library/LaunchAgents/com.momentry.server.plist
launchctl load ~/Library/LaunchAgents/com.momentry.server.plist
```
## 解法 2測試 ffmpeg 路徑
```bash
# 確認 ffmpeg 在哪
which ffmpeg
# 應該回傳 /opt/homebrew/bin/ffmpeg
# 手動測試影片能否處理
ffmpeg -ss 1800 -i "/path/to/Charade.mp4" -vframes 1 -f image2 /tmp/test.jpg
```
## 解法 3改用絕對路徑不建議改 code
如果需要M5 可以將 `media_api.rs``ffmpeg` 改成 `/opt/homebrew/bin/ffmpeg`