Repository navigation
feat: add cut_idle to remove dead air (#122) - #152
Merged
Merged
Conversation
Scans for frozen video and, when there is audio, silence; cuts stretches that are both, keeping a short pad at each edge, in one select/aselect pass. dryRun reports the cuts first, and speech over a still screen is kept unless useAudio is false. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #122.
What
New tool
cut_idle{input, minIdleSec=2, keepSec=0.4, useAudio, dryRun}:freezedetect=n=-60dB:d=MIN(+silencedetect=n=-40dB:d=MINwhen audio counts) → frozen / silent intervals from stderr. A stretch still open at EOF is closed at the duration.intersect), or just frozen withuseAudio: false, so narration over a still screen isn't cut.minIdleSecshrinks bykeepSecat both edges (cutsFor).select='not(between…+…)',setpts=N/FRAME_RATE/TBandaselect…,asetpts=N/SR/TB, viarunEditJob.dryRunreturnscuts,removedSec, and the new duration without writing anything. At most 200 cuts (otherwise it asks for a largerminIdleSec).Verified (end to end through the server)
2.4-5.6; the real cut gives video 4.77 s / audio 4.81 s (about one frame apart).useAudio: false→ cuts 2.4-5.6.Tests
idle.test.ts): marker pairing against real ffmpeg output (incl. a stretch open to EOF), interval intersection, pad and min-length rules, scan args with and without audio, select/aselect expressions.Version 0.26.0; README (36 tools), Pages,
mcp-tools.json, CHANGELOG.🤖 Generated with Claude Code