[File] [bug] Unable to properly detect MP4 file, major_brand iso5

Haelwenn Monnier (lanodan) haelwenn at cloudsdale.the-delta.net.eu.org
Fri Nov 6 07:03:11 UTC 2020


Hi,

We use libmagic to detect file formats and we got a report[1] that some MP4 files aren't detected properly. The file in question has a "\0\0\0$ftypiso5" signature of which "ftyp" is correctly detected as "ISO Media" (which annoyingly gives a application/octet-steam MIME type instead of some video/* fallback).

The "iso5" part isn't detected by libmagic and looking into /magic/Magdir/animation and https://github.com/FFmpeg/FFmpeg/blob/290de647595051034d8f021f24bb4610b2f39943/libavformat/movenc.c#L4925-L4961 you seem to be lacking a lot of MP4(-ish?) signatures.

Best regards,
Haelwenn (lanodan) Monnier

1: https://git.pleroma.social/pleroma/pleroma/-/issues/2287


More information about the File mailing list