Repository navigation
Studio: offer video input only when llama-server can launch ffmpeg and ffprobe - #16094
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41b3fff81a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bin_dir = bin_dir or source.get("LLAMA_ARG_VIDEO_FFMPEG_DIR") | ||
| names = ("ffmpeg.exe", "ffprobe.exe") if sys.platform == "win32" else ("ffmpeg", "ffprobe") | ||
| if bin_dir: | ||
| return all(os.path.isfile(os.path.join(bin_dir, name)) for name in names) |
There was a problem hiding this comment.
Check executable permissions for explicitly configured tools
On Linux and macOS, if --video-ffmpeg-dir or LLAMA_ARG_VIDEO_FFMPEG_DIR points to files without execute permission, this branch still enables video because os.path.isfile() only checks existence. I reproduced the helper returning True for two mode-0644 tools while launching ffprobe raises PermissionError. Users with such an installation will still be offered video attachments and encounter the opaque request failure this change is intended to prevent. Check executability as well as file existence, consistently with the PATH branch.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in d849e75: the explicit dir now goes through shutil.which like PATH does, so non-executable tools no longer count; test added.
… tools do not count [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…with the ffmpeg llama-server uses (unslothai#16098) Follow-up to unslothai#16094 (which closed unslothai#16065). - A video request to a model whose `/props` advertises video, but where llama-server can't find ffmpeg/ffprobe, now gets a 400 naming FFmpeg instead of the generic "cannot take video input". - Clip preprocessing uses the selected `--video-ffmpeg-dir` when available and receives the running server's prepared loader environment. Otherwise it retains normal executable lookup. - A build confirmed to lack `--video-ffmpeg-dir` ignores `LLAMA_ARG_VIDEO_FFMPEG_DIR`, and the reachability check follows that behavior. An inconclusive probe preserves the inherited override. - `supports_video_ffmpeg_dir` is probed from `--help`. A confirmed supported build can receive an automatically found folder on POSIX; Windows keeps native application-directory search precedence. Inconclusive probes preserve explicit and inherited overrides. Edge cases run on macOS against a real llama-server with Homebrew ffmpeg: ffmpeg on PATH, no ffmpeg, ffmpeg and ffprobe in different folders, a user's own `--video-ffmpeg-dir` or env var, and a build without that flag. <!-- video-ffmpeg-evidence:start --> ### API Monitor before and after Merge base `6fe27d2c5` versus corrected head `19b224260`. API Monitor now names llama-server's FFmpeg search path and explains how to correct a configured override. Both sides use independently built Studio installs with the same injected loaded video GGUF state; authentication, the HTTP request, rejection, monitor recording, and frontend rendering are real. This fixture checks the visible error and performs no model inference.  The follow-up fixes preserve native Windows executable lookup and application-directory precedence, inherited overrides after an inconclusive help probe, directory whitespace, and the running server's prepared loader environment during preprocessing. Native Windows controls reproduce the earlier lookup and precedence failures; the corrected head keeps both behaviors working. <!-- video-ffmpeg-evidence:end -->
Fixes #16065
Problem
llama-server decodes chat video by launching the
ffmpegandffprobeexecutables (from--video-ffmpeg-dir, elsePATH), but its/propsreports thevideomodality for every vision projector without checking that either tool exists. Studio copies that flag intohas_video_input, so on a machine without ffmpeg (the usual case for Unsloth Desktop on Windows) the composer accepts the clip and every send fails with an opaquehas_video_inputis documented as "False unless the mmproj, the build and ffmpeg all support it", and the frontend already has the message for that case ("... a llama.cpp build with video enabled and ffmpeg installed on this machine ..."); only the ffmpeg part was never checked.Fix
After the load reads
/props, keep video on only when the spawned llama-server can actually launch both tools, resolved the way llama.cpp resolves them:--video-ffmpeg-dirfrom the launched argv, elseLLAMA_ARG_VIDEO_FFMPEG_DIR, else the child'sPATH(on Windows also the binary's folder and the working directory, whichCreateProcesssearches). When they are missing the load logs one warning and the user gets the existing "cannot accept video" message at attach time instead of a failed request. Hosts with ffmpeg see no change. No UI, flow or install change.Verification
Real Studio
load_modelwith the reporter's llama.cpp prebuilt (b11980-mix-a794a53, linux-x64-cpu) and a small vision GGUF (SmolVLM-256M + mmproj), a 2 s mp4:/propsvideohas_video_inputFailed to load image or audio file--video-ffmpeg-dir /usr/bintests/test_video_needs_ffmpeg.py: resolution rules (PATH, flag, env var, flag beats env) plus load-path cases; the load-path "no ffprobe" case fails with the gate removed.