title: How to get meta data with MMPython for images and video
body: <p>I'm trying to get the creation date for all the photos and videos in a folder, and having mixed success. I have .jpg, .mov, and .mp4 videos in this folder.</p>
  
  <p>I spent a long time looking at other posts, and I saw quite a few references to the MMPython library here: <a href="http://sourceforge.net/projects/mmpython/" rel="nofollow noreferrer">http://sourceforge.net/projects/mmpython/</a></p>
  
  <p>Looking through the MMPython source I think this will give me what I need, but the problem is that I don't know how to invoke it. In other words, I have my file, but I don't know how to interface with MMPython and I can't see any examples </p>
  
  <p>Here is my script:</p>
  
  <pre><code>import os
  import sys
  import exifread
  import hashlib
  import ExifTool
  
  if len(sys.argv) &gt; 1:
      var = sys.argv[1]
  else:
      var = raw_input("Please enter the directory: ")
      direct = '/Users/bbarr233/Documents/Personal/projects/photoOrg/photos'
      print "direct: " + direct
      print "var: " + var
  var = var.rstrip()
  for root, dirs, filenames in os.walk(var):
      print "root " + root
      for f in filenames:
          #make sure that we are dealing with images or videos
          if f.find(".jpg") &gt; -1 or f.find(".jpeg") &gt; -1 or f.find(".mov") &gt; -1 or f.find(".mp4") &gt; -1:
              print "file " + root + "/" + f
              f = open(root + "/" + f, 'rb')
  
              #Now I want to do something like this, but don't know which method to call:
              #tags = mmpython.process_file(f)
              # do something with the creation date
  </code></pre>
  
  <p>Can someone hint me on on how I can use the MMPython library?</p>
  
  <p>Thanks!!!</p>
  
  <p>PS. I've looked at some other threads on this, such as: </p>
  
  <p><a href="https://stackoverflow.com/questions/10075115/call-exiftool-from-a-python-script/10075210#10075210">Link to thread</a>:This one didn't make sense to me</p>
  
  <p><a href="https://stackoverflow.com/questions/21355316/getting-metadata-for-mov-video/21395803#21395803">Link to thread</a>: This one worked great for mov but not for my mp4s, it said the creation date was 1946</p>
  
  <p><a href="https://stackoverflow.com/questions/2999444/python-file-meta-tag-reading/2999947#2999947">Link to thread</a>: This thread is one of the ones that suggested MMPython, but like I said I don't know how to use it.</p>