Skip to content

Commit

Permalink
Add some brand names for MP4/QT 'ftyp' designations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mindeng committed Jul 13, 2024
1 parent b4f80e0 commit afbee48
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,28 @@ const HEIF_FTYPS: &[&[u8]] = &[
b"mif1", b"MiHE", b"miaf", b"MiHB", // HEIC file's compatible brands
];

// TODO: Refer to the information on the website https://www.ftyps.com to add
// other less common MP4 brands.
const MP4_BRAND_NAMES: &[&str] = &[
"3g2a", "3gp4", "3gp5", "3gp6", "mp41", "mp42", "iso2", "isom", "vfj1",
"3g2a", "3g2b", "3g2c", "3ge6", "3ge7", "3gg6", "3gp4", "3gp5", "3gp6", "3gs7", "avc1", "mp41",
"mp42", "iso2", "isom", "vfj1",
];

const QT_BRAND_NAMES: &[&str] = &["qt ", "CAEP"];
const QT_BRAND_NAMES: &[&str] = &["qt ", "mqt "];

#[allow(unused)]
#[derive(Debug, PartialEq, Eq)]
pub enum FileType {
Jpeg,
Heif,

// Currently, there is not much difference between QuickTime and MP4 when
// parsing metadata, and they share the same parsing mechanism.
//
// The only difference is that if detected as an MP4 file, the
// `moov/udta/©xyz` atom is additionally checked and an attempt is made to
// read GPS information from it, since Android phones store GPS information
// in that atom.
QuickTime,
MP4,
}
Expand Down

0 comments on commit afbee48

Please sign in to comment.