title: How to read exif data of movies in Python?
body: <p>I use <a href="https://github.com/ianare/exif-py" rel="noreferrer"><code>exifread</code></a> (installed with <code>python3 -m pip install exifread</code>) to read EXIF tags from photos. The same camera takes videos with extension <code>.MOV</code> and a <code>Create Date</code> EXIF field that I am able to view with <a href="https://exiftool.org/" rel="noreferrer"><code>exiftool</code></a> (installed with <code>brew install exiftool</code>):</p>
  
  <pre>
  $ exiftool DSC_0002.MOV | grep Date
  File Modification Date/Time     : 2020:02:20 18:13:14+00:00
  File Access Date/Time           : 2020:03:07 08:11:57+00:00
  File Inode Change Date/Time     : 2020:03:04 11:24:51+00:00
  Modify Date                     : 2020:02:20 18:13:21
  Track Create Date               : 2020:02:20 18:13:21
  Track Modify Date               : 2020:02:20 18:13:21
  Media Create Date               : 2020:02:20 18:13:21
  Media Modify Date               : 2020:02:20 18:13:21
  Create Date                     : 2020:02:20 18:13:15
  Date/Time Original              : 2020:02:20 18:13:15
  Date Display Format             : Y/M/D
  </pre>
  
  <p>I suppose <code>exifread</code> was built for photos, as the code below shows an empty list of tags for this video:</p>
  
  <pre class="lang-py prettyprint-override"><code>import exifread
  
  f = open("/path/to/file", "rb")
  tags = exifread.process_file(f)
  print(tags)
  </code></pre>
  
  <p>One solution is to make a subprocess call to <code>exiftool</code> and parse the result:</p>
  
  <pre class="lang-py prettyprint-override"><code>EXIFTOOL_DATE_TAG_VIDEOS = "Create Date"
  EXIF_DATE_FORMAT = "%Y:%m:%d %H:%M:%S"
  
  cmd = "exiftool '%s'" % filepath
  output = subprocess.check_output(cmd, shell=True)
  lines = output.decode("ascii").split("\n")
  for l in lines:
      if EXIFTOOL_DATE_TAG_VIDEOS in l:
              datetime_str = l.split(" : ")[1]
              print(datetime.datetime.strptime(datetime_str,
                                               EXIF_DATE_FORMAT))
  </code></pre>
  
  <p>How can I access the list of EXIF tags without a subprocess call?</p>