CLAP Atom Support for MP4 Files (via `AV_PKT_DATA_FRAME_CROPPING`)
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Expected behavior of the wanted feature
CLAP (Clean Aperture) is an official standard for defining video crop values in MP4—essentially the MP4 equivalent of the MKV crop values that mpv already supports. QuickTime, for example, honors these values and displays the video as intended (e.g., cropping a 1920×1080 video to 1920×960 using a “1= 1920,1,960,1,0,1,0,1” setup where 1 is the track ID).
Adding CLAP support would enable mpv to automatically apply the correct crop metadata from MP4 files, ensuring consistent playback across different file formats.
upper left: QuickTime Player cropping the video according to the included CLAP atom
lower right: mpv ignoring CLAP values
Sample Files
https://github.com/user-attachments/assets/df96028c-68bd-4318-bc13-39e2bebcd938
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating mpv's existing MKV crop handling and the code path associated with FFmpeg's AV_PKT_DATA_FRAME_CROPPING metadata. Use the supplied MP4 sample to inspect the CLAP values and verify playback behavior. Done means mpv applies the intended crop from the sample file, matching the behavior shown in QuickTime.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100