Anonymous avatar Anonymous committed 6f32074

parser/video/mov: add several more metadata tags (mostly ones used by iTunes)

Comments (0)

Files changed (1)

hachoir-parser/hachoir_parser/video/mov.py

         while not self.eof:
             yield String(self, "compat_brand[]", 4, "Compatible brand")
 
+class META(FieldSet):
+    def createFields(self):
+        yield UInt32(self, "unk")
+        yield AtomList(self, "tags")
+
 class Atom(FieldSet):
     tag_info = {
         # TODO: Use dictionnary of dictionnary, like Matroska parser does
         "minf": (AtomList, "minf", ""),
         "stbl": (AtomList, "stbl", ""),
         "dinf": (AtomList, "dinf", ""),
+        "udta": (AtomList, "udta", ""),
+        "ilst": (AtomList, "ilst", ""),
+        "trkn": (AtomList, "trkn", "Metadata: Track number"),
+        "disk": (AtomList, "disk", "Metadata: Disk number"),
+        "tmpo": (AtomList, "tempo", "Metadata: Tempo"),
+        "cpil": (AtomList, "cpil", "Metadata: Compilation"),
+        "gnre": (AtomList, "gnre", "Metadata: Genre"),
+        "\xa9alb": (AtomList, "album", "Metadata: Album name"),
+        "\xa9ART": (AtomList, "artist", "Metadata: Artist name"),
+        "\xa9cmt": (AtomList, "comment", "Metadata: Comment"),
+        "\xa9nam": (AtomList, "name", "Metadata: Track name"),
+        "\xa9too": (AtomList, "tool", "Metadata: Creator program"),
+        "\xa9wrt": (AtomList, "composer", "Metadata: Composer name"),
+        "\xa9day": (AtomList, "date", "Metadata: Date of creation"),
+        "covr": (AtomList, "cover", "Metadata: Cover art"),
+        "----": (AtomList, "misc", "Metadata: Miscellaneous"),
+        "meta": (META, "meta", "File metadata"),
         "elst": (ELST, "edts", ""),
         "tkhd": (TrackHeader, "track_hdr", "Track header"),
         "hdlr": (HDLR, "hdlr", ""),
 
     def createFields(self):
         yield UInt32(self, "size")
-        yield String(self, "tag", 4)
+        yield RawBytes(self, "tag", 4)
         size = self["size"].value
         if size == 1:
             raise ParserError("Extended size is not supported!")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.