You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
search_recording grabs thumbnails one at a time, then re-encodes them with a second ffmpeg #405
Hit thumbnails are extracted serially, one ffmpeg per hit, and then passed through another ffmpeg to resize. With the default hit count that is a noticeable wait per query.
Where
src/tools/searchRecording.ts:86-99
src/utils/images.ts:51-62
Details
for (const [i, hit] of hits.slice(0, want).entries()) { ... await runFfmpeg(buildSampleAtTimestampArgs(source.path, at, out), 60_000, ...) }. That is one ffmpeg spawn and seek at a time, for up to MAX_INLINE_IMAGES (20) hits. encodeInlineImages then spawns another ffmpeg per PNG to scale it and convert it to JPEG. All other per-timestamp grabs use mapPool (#290: "each spawn costs ~200 ms before decoding").
Impact
images: 20 costs about 40 serial-ish spawns. That is several seconds that a pooled single pass would cut 2-4x. It matters only when thumbnails are requested (the default is 0).
Steps to reproduce
search_recording { input, query, images: 20 } on a long recording.
Suggested fix
Use mapPool for the grabs, and grab straight to a scaled JPEG (-vf scale=480:-2 -q:v 5 out.jpg) so the encodeInlineImages re-encode can be skipped, or pass width to the grab.
Acceptance criteria
Thumbnails are extracted with bounded concurrency and scaled in the same ffmpeg call
Activity