{"id":1154,"date":"2015-10-24T23:25:42","date_gmt":"2015-10-25T05:25:42","guid":{"rendered":"https:\/\/www.netjeff.com\/wp\/?p=1154"},"modified":"2022-10-09T20:58:14","modified_gmt":"2022-10-10T02:58:14","slug":"using-exiftool-to-make-mp4-video-file-dates-match-contents","status":"publish","type":"post","link":"https:\/\/www.netjeff.com\/wp\/?p=1154","title":{"rendered":"Using ExifTool to make .mp4 video file dates match contents"},"content":{"rendered":"<p>I had a bunch of .mp4 and .3gpp video files whose file \"create\" and \"last modified\" filesystem dates did not match the meta data inside of the file, and this was causing problems because many apps use the filesystem dates when sorting video files (rather than using the metadata inside the video files).<\/p>\n<p>I found <strong><a href=\"http:\/\/owl.phy.queensu.ca\/~phil\/exiftool\/\">ExifTool<\/a><\/strong> could fix this.\u00a0 Using the <a href=\"https:\/\/exiftool.org\/gui\/\">ExifToolGUI<\/a> I could fix them one at a time.\u00a0 By using the ExifTool cmd-line tool I was able to change them all at once.\u00a0\u00a0 The biggest challenge was that most of the documentation was on how to modify the internal meta data, but I wanted to \"copy\" from the meta data to the filesystem timestamps.<\/p>\n<p>The first trick is to figure out what the \"tags\" are for the internal metadata and the file system.\u00a0\u00a0 I found the <a href=\"http:\/\/www.sno.phy.queensu.ca\/~phil\/exiftool\/faq.html#Q24\">ExifTool FAQ #24<\/a> which shows how to query for the times:<\/p>\n<pre>&gt; exiftool -time:all -a -G0:1 -s MyVideo.mp4\n\n[File:System]\u00a0\u00a0 FileModifyDate\u00a0\u00a0 : 2014:09:07 19:35:32-06:00\n[File:System]\u00a0\u00a0 FileAccessDate\u00a0\u00a0 : 2015:10:24 22:55:22-06:00\n[File:System]\u00a0\u00a0 FileCreateDate\u00a0\u00a0 : 2015:10:24 22:55:22-06:00\n[QuickTime]\u00a0\u00a0\u00a0\u00a0 CreateDate\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 2013:09:14 00:52:38\n[QuickTime]\u00a0\u00a0\u00a0\u00a0 ModifyDate\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : 2013:09:14 00:52:38\n<\/pre>\n<p>From the above the <em>CreateDate<\/em> &amp; <em>ModifyDate<\/em> are the internal meta data, and the <em>FileModifyDate<\/em> etc are the filesystem.<\/p>\n<p>So to update the filesystem date to match the metadata <em>CreateDate<\/em> I used this command:<\/p>\n<pre>&gt; exiftool \"-CreateDate&gt;FileModifyDate\" MyVideo.mp4\n<\/pre>\n<p>To modify multiple files I used wild-cards on the filename, like *.mp4 to update all mp4 files in the current directory.<\/p>\n<p>=========================<\/p>\n<p>Related, to update the file system time for <strong>image<\/strong> files to match the meta data:<\/p>\n<pre>&gt; exiftool \"-DateTimeOriginal&gt;FileModifyDate\" MyPicture.jpg\n<\/pre>\n<p>Note that most apps know how to look into image metadata, so setting the filesystem dates is not as important as for video files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a bunch of .mp4 and .3gpp video files whose file \"create\" and \"last modified\" filesystem dates did not match the meta data inside of the file, and this was causing problems because many apps use the filesystem dates when sorting video files (rather <a class=\"more-link\" href=\"https:\/\/www.netjeff.com\/wp\/?p=1154\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,5],"tags":[],"class_list":["post-1154","post","type-post","status-publish","format-standard","hentry","category-programming","category-tech"],"_links":{"self":[{"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1154"}],"version-history":[{"count":10,"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1154\/revisions"}],"predecessor-version":[{"id":1296,"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1154\/revisions\/1296"}],"wp:attachment":[{"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netjeff.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}