-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the detection of mp4 types #86 #98
Conversation
lib/src/magic_number.dart
Outdated
@@ -122,14 +122,500 @@ const List<MagicNumber> initialMagicNumbers = [ | |||
0x74, | |||
0x79, | |||
0x70, | |||
0x33, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it removes the version with the last 4 bytes [0x33, 0x67, 0x70, 0x35]
or 3gp5
According to https://www.ftyps.com this mime type should be video/3gpp
though - so I don't know if it was useful when it was mapped to video/mp4
. I think it's OK to overwrite this old entry with the new one.
Looking at just the types that are marked as registered and map to video/mp4
it looks fairly close to your list. However there are some differences.
mp71
does not link directly to the mime typevideo/mp4
, this resource lists it as "various" - maybe it's OK to include anyway?msnv
is capitalized asMSNV
and maps toaudio/mp4
ndsc
throughndxs
are all capitalized, and none are marked as registered.
I think we can probably prune the list down to avc1
, iso2
, isom
, mp41
, and mp42
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I returned the type "3gp5 = 33 67 70 35" and marked it as video/3gpp. And also I pruned the MP4 list down to avc1, iso2, isom, mp41 and mp42.
I'm not sure if the ISO standard would have an even more authoritative list than https://www.ftyps.com/ https://www.iso.org/standard/83102.html I don't think it's worth buying it to check though... I think it's probably safe to go with the pruned list I mentioned above. |
Add more byte patterns for the values that can follow `ftyp` in an mp4 file.
Fixes dart-lang/tools#419
I added MPEG-4 types based on the article https://www.file-recovery.com/mp4-signature-format.htm
avc1 = 61 76 63 31
iso2 = 69 73 6F 32
isom = 69 73 6F 6D
mmp4 = 6D 6D 70 34
mp41 = 6D 70 34 31
mp42 = 6D 70 34 32
mp71 = 6D 70 37 31
msnv = 6D 73 6E 76
ndas = 6E 64 61 73
ndsc = 6E 64 73 63
ndsh = 6E 64 73 68
ndsm = 6E 64 73 6D
ndsp = 6E 64 73 70
ndss = 6E 64 73 73
ndxc = 6E 64 78 63
ndxh = 6E 64 78 68
ndxm = 6E 64 78 6D
ndxp = 6E 64 78 70
ndxs = 6E 64 78 73