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']) |
Eric - did you ever get anywhere with your pursuit to extract the GPS data from the FalconZero F170 mov files?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am testing this on a FalconZero F170HD Dashcam. Ultimately, my goal is to extract out the realtime GPS data. I installed "hachoir_core" and "hachoir_parse" (note, a comment that those were required might be nice). I first tried the script as written, but ulitmately, was going to change this to look at the "ftyp" and "frea" atoms, as I think that might have the data I want.
python qt-extract.py 2016_0829_160810_056.MOV
Any suggestions? I tried AtomicParsley but that's only mp4, not quicktime containers.