Fix guide for M4 video endpoints 500
This commit is contained in:
36
docs_v1.0/M4_workspace/2026-05-08_fix_video_endpoints.md
Normal file
36
docs_v1.0/M4_workspace/2026-05-08_fix_video_endpoints.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Video Endpoints 500 修復
|
||||
|
||||
M5 測試正常,問題在 M4 的 launchd service PATH 沒有 ffmpeg。
|
||||
|
||||
## 解法 1:launchd 加 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`。
|
||||
Reference in New Issue
Block a user