Created
November 1, 2015 21:25
-
-
Save dnicolson/ea1d8b7614a588d98d97 to your computer and use it in GitHub Desktop.
Extract mdat atoms from QuickTime files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from hachoir_core.cmd_line import unicodeFilename | |
from hachoir_parser import createParser | |
import sys | |
def find_atoms(filename): | |
parser = createParser(unicodeFilename(filename)) | |
atoms = [] | |
for field in parser: | |
print '%s: %s %s + %s' % (field.description, field.name, field.absolute_address, field.size) | |
if 'mdat' in field.description: | |
atoms.append({'addr': field.absolute_address / 8, | |
'size': field.size / 8}) | |
return atoms | |
def extract(src, dst, start, size): | |
f = open(src) | |
f.seek(start) | |
open(dst, 'w').write(f.read(size)) | |
info = find_atoms(sys.argv[1]) | |
print info | |
extract(sys.argv[1], sys.argv[2], info[0]['addr'], info[0]['size']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Eric - did you ever get anywhere with your pursuit to extract the GPS data from the FalconZero F170 mov files?