Skip to content

Clean an MP4's User Data Box in the Media Normalizer #433

Closed as not planned

Description

@ptr727

scripts/normalize-media.py cannot clean an MP4. Its stream copy runs ffmpeg with -map_metadata -1, and ffmpeg's mp4 and ipod muxers still write a udta box holding an empty meta/ilst, which the gate reports as ISO udta atom. The mov and 3gp muxers write none.

A constructed case: a short clip from ffmpeg -f lavfi -i testsrc carrying a title tag, saved as clip.mp4, clip.m4v, and clip.mov.

  • clip.mov: removed ISO udta atom, and the result passes the gate.
  • clip.mp4 and clip.m4v: needs a re-encode, dropping cannot reach ISO udta atom, rewrite would still not pass, in report mode and in --apply alike.

Inside an archive the outcome is worse, since normalize_archive does not run the gate over a rewritten member the way the loose-file branch does. A report names such a member as removed, and the apply repacks a member that still fails the gate.

Candidate fix: pass a muxer option that suppresses the empty user data box for the MP4 family, if ffmpeg has one, or drop the box after the copy. Separately, judge a rewritten archive member against the gate before counting it as removed.

Pre-existing. Found while fixing the report for a video the normalizer cannot remux.

Activity

  1. added
    pre-existing
    script
    on Oct 7, 2026
  2. ptr727 commented on Oct 7, 2026

    @ptr727
    OwnerAuthor

    Closing as not planned, at the maintainer's direction. No .mp4 or .m4v is carried, loose or inside an archive, and the only carried video is a .mov, which the normalizer already cleans. An MP4 added later still fails the gate in CI on its udta box, so nothing reaches the site uncleaned, and the fix can be taken up then. Reopen if an MP4 needs carrying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existingscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions