fix(multimodal): hold every external decode to one demuxer list #10133
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.50) × (1 − Review Confidence (0.29)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 575 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 46% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.380
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #10133"
general
weight: 0.35
claude[bot]
Description
Changed reading: every ffmpeg and ffprobe run on a client's video or audio file now opens it through the file protocol alone and with one of sixteen demuxers:
mov(MP4, M4A, 3GP, QuickTime),matroska(MKV, WebM),avi,ogg,mpeg(program stream),mpegts,wav,flac,mp3,aiff,caf,aac(ADTS),flv,asf(WMV, WMA),amrandgif. A part in a container outside this list is refused where main may decode it, and so is a raw stream with no container (h264,hevc,mjpeg,m4v); the list can be widened. Such a part gets the status and error code main gives a failed external decode.Changed reading where the
opencv-videofeature is built (OpenCV decodes video by default): OpenCV takes a client video only where its leading bytes read as MP4 or QuickTime (ftyp), Matroska or WebM, AVI, Ogg or an MPEG program stream, also underSMG_VIDEO_DECODE_BACKEND=opencv; every other video takes the ffmpeg path above, where main hands it to OpenCV: one outside the list is refused, a listed one (MPEG-TS, FLV, ASF, GIF, QuickTime with no leadingftyp) is decoded by ffmpeg, and a process with no ffmpeg answers it with the error of a decoder it cannot run.Problem
The external decoders (ffmpeg, ffprobe, and OpenCV where it is built) opened a client file with whatever demuxer its bytes probed to, under the protocol list the build gives a local file; they were not held to a list.
Solution
CLIENT_FILE_FORMATS) and the input options built on it (CLIENT_FILE_INPUT:-protocol_whitelist file,-format_whitelistwith the list) stand ahead of the input of every ffmpeg and ffprobe run on a client file (the seven runs of Numbers).opencv_takes_client_filechooses the video decoder byvideo_container_suffix(the signatures the temp file suffix already read); it builds without the feature, so its case runs in every test build.Changes
crates/multimodal/src/media.rs: the list, the options, the buildersffprobe_commandandffmpeg_input_commandand their video callers;video_container_suffix(the table ofvideo_temp_suffix, whose answers stand),opencv_takes_client_fileand its call indecode_video_frames.crates/multimodal/src/audio/decode.rs: the audio decode and probe use the builders.crates/multimodal/src/media/tests/client_file_input.rs: the two new cases; the two cases that pin a video decode's arguments take the options.Test Plan
cargo test -p llm-multimodal: every case passes.every_run_on_a_client_file_names_its_lists_ahead_of_the_inputreads the arguments of each command;opencv_takes_a_client_file_only_in_a_listed_containerreads the choice on short byte literals. No decoder runs. On main neither builds (the functions are new).cargo clippy -p llm-multimodal --all-targets -- -D warningspass.opencv-videocode is built and linted by the all-features lint build of CI alone; the ffmpeg refusal was read, not run. The clips the CI decodes with ffmpeg (MP4, AVI, MKV, WebM) are all on the list.Release note
Media inputs: ffmpeg and ffprobe open a client's video or audio file through the file protocol alone and with one of sixteen containers (MP4 and QuickTime, Matroska and WebM, AVI, Ogg, MPEG-PS, MPEG-TS, WAV, FLAC, MP3, AIFF, CAF, AAC, FLV, ASF, AMR, GIF); others are refused as a failed decode. OpenCV takes a video only in the first five, read by their leading bytes.
Numbers
| metric | before | after | setup |
|---|---|---|---|
| runs on a client file that name the file protocol and the demuxer list ahead of the input | 0 of 7 | 7 of 7 | read from the source: three video probes, the duration probe, the video decode builder, the audio decode and probe |
| demuxer names a run lists for a client file | 0 | 16 |
CLIENT_FILE_FORMATS|| protocol names a run lists for a client file | 0 | 1 |
CLIENT_FILE_INPUT(file) || leading-byte signatures that hand a client video to OpenCV where the feature is built | none read (every video) | 5, each a demuxer of the list |
opencv_takes_client_fileand its case |