Repository navigation
fix: size ffmpeg timeouts to the file; input-seek re-encode (0.1.2) - #9
Merged
Merged
Conversation
A 110 GB day master on a 9p mount took longer than the flat 600 s keyframe probe, so keyframes came back unknown and every range fell back to a re-encode that decoded from the start of the file under a flat 3600 s timeout. Probe, copy and concat timeouts now scale with the bytes read at a 20 MB/s floor; the re-encode seeks on the input side with an output-side -ss 0 so copied audio carries no pre-cut packets, and its timeout scales with the range length. Releases 0.1.2.
Contributor
Author
|
Hard-denied (hard-deny: protected path family) and ready to merge -- all checks green. Offending paths:
Human merge: |
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.
What
Release 0.1.2. Every ffmpeg and ffprobe step's timeout now grows with the file it reads, and the re-encode fallback seeks on the input side.
io_timeout(floor_sec, nbytes)andMIN_IO_BYTES_PER_SEC(20 MB/s). The keyframe probe (600 s floor), the stream copy (1800 s floor) and the concat (1800 s floor, double the bytes withfaststart) use it instead of a flat window.reencode_rangerunsffmpeg -ss S -i master -ss 0 -t D …. The demuxer jumps to the keyframe before the cut, and accurate seek drops frames up to the exact start. The output-side-ss 0drops the stream-copied audio's pre-cut packets. Without it, the concat demuxer plays about half a GOP of audio from before the cut; the integration suite caught this. The timeout ismax(timeout, D × 20)(REENCODE_SEC_PER_SEC).__version__was still0.1.0and now matches pyproject.Why
GoMoveShift's Ace Basin day master is 110 GB on a 9p mount. On 2026-10-27 at 12:10 ET,
probe_keyframeshit the flat 600 s timeout, so keyframes came back unknown. Every long-form range then fell toreencode_range. That path used an output-side seek, decoding the master from byte 0 for every range, under a flat 3600 s timeout. LF1 has 8 ranges, up to 1147 s each, through x265-preset slow, so each range would run for hours or time out.Tests
-ss 0after-i, and-t.pytest -q: 152 passed.ruff check .: clean.After merge
Tag
v0.1.2on the merge commit. Then framegrade bumps its keycut pin (pyproject.toml:112) and releases.