Repository navigation
Fix frame extraction with '%' in the output path, and caption pick when several -orig tracks exist - #259
Open
MrAndyPuppy wants to merge 2 commits into
Open
Fix frame extraction with '%' in the output path, and caption pick when several -orig tracks exist#259MrAndyPuppy wants to merge 2 commits into
MrAndyPuppy wants to merge 2 commits into
Conversation
ffmpeg's image2 muxer parses every '%' in the output path as part of the sequence pattern. A work dir named after a video such as "Get Ahead of 95% in 11 Minutes" made ffmpeg write a single literal frame_%04d.jpg (or fail), so no frames were extracted. All three frame_%04d.jpg call sites now go through _frame_pattern(), which escapes '%' as '%%'. Adds a regression test across the keyframe and scene/uniform engines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
select_caption() replaced any auto-mode match with originals[0], the alphabetically first '-orig' track. Some YouTube videos list more than one original ASR track (youtu.be/yf2OwchM9nw, an en-US video, offers both ar-orig and en-orig), so watch returned an Arabic transcript. With several originals, prefer the one matching the metadata language, else English-first. A single original still overrides dubbed metadata, as before. Adds a regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 changed
frames.py— escape%in the output directory. ffmpeg's image2 muxer treats every%in the output path as a sequence-pattern token. A work dir named after a video such as "Get Ahead of 95% in 11 Minutes" made ffmpeg write a single literalframe_%04d.jpg(or fail), so no frames were extracted. All threeframe_%04d.jpgcall sites now go through a small_frame_pattern()helper that escapes%as%%.download.py— pick the right original caption track. In auto mode,select_caption()replaced the language match withoriginals[0], the alphabetically first-origtrack. Some videos list several: https://youtu.be/yf2OwchM9nw isen-USbut offers bothar-origanden-orig, so/watchreturned an Arabic transcript. (YouTube's own player also defaults to Arabic captions on this video.) With several originals it now prefers the one matching the metadata language, else English-first. A single original still overrides dubbed metadata exactly as before, sotest_original_track_overrides_dubbed_metadatais unchanged.Tests
test_percent_in_output_dir_is_literalacross the keyframe and scene/uniform engines;test_multiple_originals_follow_metadata_language). Each fails without its fix.248 passed, 6 skipped.--start 0:30 --end 1:00and an--out-dircontaining95%: 60 frames, English captions (en-orig).🤖 Generated with Claude Code