Author: dmeyer
Date: Thu Dec  7 19:55:45 2006
New Revision: 2176

Modified:
   trunk/metadata/src/fourcc.py
   trunk/metadata/src/video/movinfo.py

Log:
support mpeg4/3gp container

Modified: trunk/metadata/src/fourcc.py
==============================================================================
--- trunk/metadata/src/fourcc.py        (original)
+++ trunk/metadata/src/fourcc.py        Thu Dec  7 19:55:45 2006
@@ -609,8 +609,9 @@
     'RV30': 'RealVideo 8',
     'RV40': 'RealVideo 9',
     'RVX ': 'Intel RDX (RVX )',
-    'S263': 'S263 codec',
+    'S263': 'Sorenson Vision H.263',
     'S422': 'Tekram VideoCap C210 YUV 4:2:2',
+    'SAMR': 'Adaptive Multi-Rate (AMR) audio codec',
     'SAN3': 'MPEG-4 codec (direct copy of DivX 3.11a)',
     'SDCC': 'Sun Communication Digital Camera Codec',
     'SEDG': 'Samsung MPEG-4 codec',

Modified: trunk/metadata/src/video/movinfo.py
==============================================================================
--- trunk/metadata/src/video/movinfo.py (original)
+++ trunk/metadata/src/video/movinfo.py Thu Dec  7 19:55:45 2006
@@ -74,8 +74,21 @@
         (size,type) = unpack('>I4s',h)
 
         if type == 'ftyp':
-            # graphic type at the beginning, skip
-            file.seek(size)
+            # file type information
+            if size >= 12:
+                # this should always happen
+                if file.read(4) != 'qt  ':
+                    # not a quicktime movie, it is a mpeg4 container
+                    self.mime = 'video/mp4'
+                    self.type = 'MPEG-4 Video'
+                size -= 4
+            file.seek(size-8, 1)
+            h = file.read(8)
+            (size,type) = unpack('>I4s',h)
+
+        while type == 'mdat':
+            # movie data at the beginning, skip
+            file.seek(size-8, 1)
             h = file.read(8)
             (size,type) = unpack('>I4s',h)
 
@@ -347,5 +360,5 @@
         return atomsize
 
 
-factory.register( 'video/quicktime', ('mov', 'qt'), mediainfo.TYPE_AV, MovInfo)
-
+exts = ('mov', 'qt', 'mp4', 'mp4a', '3gp', '3gp2', 'mk2')
+factory.register( 'video/quicktime', exts, mediainfo.TYPE_AV, MovInfo)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to