Thursday, July 14, 2011

How to fix 'sort folder by date' for *.avi video files in Picasa

Recently I bought some storage space from Google in an effort to finally move everything to the cloud so I don't have to worry about my data being lost anymore. Well, one part of the job was to sync the pictures and videos from my camera between Picasa and Picasa Web Albums. One of the syncing options was to "Sync Photo Order", and of course I wanted my pics to be chronologically ordered. However, when I started to review them, I noticed that most of the video files were in the wrong places even after sorting a folder by date in Picasa. This was weird because if you open that same folder in Windows 7 and sort by the 'Date' column in detailed view, everything looks nice.

It turned out that the actual date&time is stored in a tag inside an avi file, much like Exif is used to store time stamps in JPEG's, and apparently Picasa doesn't recognize it. Instead, it sorts by the file creation date&time which unfortunately had been screwed up on my computer for some reason. So I needed a way to extract the actual time from a tag inside an avi file, and write it in the date&time attribute of a file. Of course, I didn't want to do it by hand. After some research I found a wonderful command-line tool, ExifTool, which, after several hours of reading the manual )), does exactly what I needed. It takes the data from the tag and writes it into file's attributes. Here is the command line that I wanted to share with anyone who has the same problem:
exiftool.exe -tagsfromfile @ "-filemodifydate<datetimeoriginal" *.avi
 which fixes all the avi files in a folder, given that exiftool.exe is in that same folder.

Enjoy.

No comments:

Post a Comment