feat: add video file support (MP4, WebM, MKV) (re-land of #22)#30
Merged
Conversation
is_video() detects MKV/WebM (EBML header), AVI (RIFF...AVI), MP4/MOV/M4V (ftyp box, excluding M4A/M4B/M4P audio brands), and MPEG-1/2 (sequence/pack header), with extension fallback for mp4/mkv/avi/mov/webm/m4v/wmv/flv/mpeg/ mpg/3gp/ogv/ts/mts/m2ts. Routes video files through the same metadata-only path as audio (ffprobe for tags/duration/codec; no raw bytes sent to the LLM) — collect_metadata and build_user_content already handle both 'audio' and 'video' modes. Adds 9 bats tests (mp4/webm/mkv detection + negative cases + e2e naming) and 3 tiny test fixtures (sample.mp4/.webm/.mkv). Re-land of #22 (hai-pilgrim's PR is 3 months stale). Cherry-pick conflict in hat's is_audio() resolved in favour of HEAD's richer version with #26 context; conflict in test.sh export -f resolved by combining both sides (needs is_image AND is_video). Closes #18.
Owner
Author
|
Conflict from merging #28 (preview flag) just now — that landed first and touched the same |
…-video # Conflicts: # test.sh
marksverdhei
added a commit
that referenced
this pull request
Jun 27, 2026
) (#31) README claimed 'Video and other binary files are not supported.' but video support landed today via #30 (closes #18). Also adds the --preview flag from #28 (closes #6) to the Features and Usage sections. Changes: - Features: list video alongside images/audio + new --preview bullet - Supported Formats table: add Video row (15 extensions, ffprobe metadata path identical to audio) - Remove the contradicting 'not supported' line - Update 'Image naming requires...' note to 'Audio and video naming require ffprobe' - Usage: add --preview example
marksverdhei
added a commit
that referenced
this pull request
Jun 27, 2026
Adds (newest first, matching existing style): - #32 stem-less dotfile guard - #30 video file support - #28 --preview / -p flag - #27 is_audio ftyp false-positive fix - #20 audio file support Skipped pure-docs (#15, #16, #17, #31), CI infra (#29), and test-only rebases (#25) — same selection rule the prior entries used.
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.
Draft re-land of #22 — hai-pilgrim's PR was 3 months stale. The audio commit on PR22's branch already landed separately as #20, and the video commit had a real cherry-pick conflict:
hat: PR22 had an older version ofis_audio's ftyp brand check; main has a richer version with comments referencing is_audio false-positive on HEIC images and MP4/MOV videos (ftyp box detection too loose) #26 (the iPhone-photos / video false-positive incident that motivated it). Resolved in favour of HEAD.test.sh:export -fline — PR22 droppedis_imagewhile addingis_video; resolved by keeping both.bats.yml workflow that PR22 also wanted to add was already added separately by #29 today, so left main's version alone.
Summary
is_video()detects MKV/WebM (EBML), AVI (RIFF…AVI), MP4/MOV/M4V (ftyp, excluding M4A/M4B/M4P brands), MPEG-1/2 (sequence/pack header), plus extension fallback for 14 video formats. Video files route through the same metadata-only path as audio (ffprobe → tags/duration/codec, no raw bytes to LLM).3 tiny test fixtures (
sample.mp4/.webm/.mkv) + 9 new bats tests (detection + negative cases + e2e naming).Closes #18.
Test plan
bats test.sh→ 71/71 pass locally (was 62 before; this adds 9)