Never re-encode damaged originals; check the copy's frames against the original #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "khyretos/fix/never-keep-cut-off-copies"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A copy shorter than its original was kept since PR 8 with a "cut off" note.
Those originals were partial downloads (video stopping before the audio, or
holes with no video), the copy had the same damage and played out of sync,
and Finalize deleted the only original. Now the original's video packets are
read before encoding: holes over 2 s or video ending over 2 s early skip the
file and leave it as it is. The copy must have the original's frame count,
end and holes, or it fails (after one CPU-decode try for GPU encodes).
Co-Authored-By: Claude Opus 5.5 (1M context) noreply@anthropic.com
Title
Never re-encode damaged originals; check the copy's frames against the original
PR Type
Bug fix, Tests
Description
Prevents re-encoding damaged originals with missing video or holes.
Validates AV1 copies against original frame counts and timing.
Skips files where video ends early or contains gaps longer than 2 seconds.
Diagram Walkthrough
File Walkthrough
rx_config.py
Increment version number to 1.0.1app/rx_config.py
rx_media.py
Add timeline analysis for damaged video detectionapp/rx_media.py
video_packets_afterwithvideo_timelineto extract packetdata without decoding.
GAP_Sconstant to define hole duration threshold of 2 seconds._damageand_lost_videoanalyze timeline data forerrors.
rx_worker.py
Integrate damage checks into worker processing flowapp/rx_worker.py
video_timelinebefore encoding to detect damaged originals.test_damaged_sources.py
Update tests for new timeline and damage detectiontests/test_damaged_sources.py
test_video_packets_aftertotest_video_timeline.test_fixes_2026_11_07.py
Align fallback tests with new timeline APItests/test_fixes_2026_11_07.py
video_timelineinstead ofvideo_packets_after.CHANGELOG.md
Document version 1.0.1 release notesCHANGELOG.md
PR Reviewer Guide 🔍
Here are some key observations to aid the review process: