Organize images/videos in folders by month(date taken)

Is there an open source tool or a script available on the web for that?

Exiftool and/or Exiv2 will certainly do that.

Also Rapid Photo Downloader (it can work against the file system as well as removable cards).

I thought I only copies files from an external storage to a hard drive. I will give it a shot for sure

Yeah I already found an article on doing this with Exiftool. I will see which one of them is easier to use.

I use a few shell aliases to exiftool to sort almost everything. Exiftool can read metadata from an astounding number of formats.

Indeed it can but it’s not 100% reliable with movie metadata. I’ve not found anything that is, however.

In my opinion ExifTool is the best tool for reading/writing metadata from/to mp4 and avi files I came across so far. It can read pretty much everything. Writing is a bit limited but it is still pretty impressive.

Could you describe more what these are, please?

Between ExifTool and MediaInfo, I don’t know which is most reliable in extracting video metadata. All I do know is that based on user reports, ExifTool sometimes gets it wrong e.g. with Sony HV400 files. MediaInfo is not perfect either. Consequently Rapid Photo Downloader uses the output of both:

http://bazaar.launchpad.net/~dlynch3/rapid/zeromq_pyqt/view/head:/raphodo/metadatavideo.py#L144

PHOTODIR="/home/user/Pictures_Raw_Files" && exiftool -r -o "${PHOTODIR}" "-FileName<CreateDate" -d "${PHOTODIR}/%Y-%m-%d/%Y-%m-%d_%H-%M-%S%%-c.%%le" .

1 Like

I left Rapid Photo Downloader working on my Unsorted folder overnight. Hopefully video files went to correct folders. I will check the results later this afternoon.

I just noticed that the source has 2995 JPG files (15.9 Gb) while the destination has 2976 (16.1Gb). It is hard to find what files are missing since the folders structure does not match. I know for sure that the files are JPG’s because I searched both folders for JPG in dolphin twin panel mode.
DNGs and MP4s match.
Also, RPD did not copy neither PNG files nor sidecar files (xmp and zps in my case)

Now I am trying to figure out which files are missing.

They were duplicates

Recognized file types are:

$ rapid-photo-downloader -e
Photos: ARW, DCR, CR2, CRW, DNG, MOS, MEF, MRW, NEF, NRW, ORF, PEF, RAF, RAW, RW2, SR2, SRW, JPG, JPE, JPEG, TIF, TIFF and MPO
Videos: 3GP, AVI, M2T, M2TS, MOV, MP4, MPEG, MPG, MOD, TOD and MTS

Regarding XMP files, see the discussion here:

i made myself a script a while ago to import my photos from my camera to my nas.
Of course you have to change some things and its all in german, but maybe its worth a try :slight_smile:

in fact you have to change the path to your SD-Card
QUELLE="/media/martin/SD_CAM/DCIM/100OLYMP"
The path to save the images
ZIEL="/media/nas/Bilder/Camera"
and the ending of the raw files in line 60.

I use Exiftool to organize my images by year, month, day, and time. I also add the camera file number, which takes care of multiple shots taken within the same minute.

Exiftool syntax is a bit complicated, so I wrote some articles explaining various commands for reading and modifying metadata, and for moving files around the computer:

ExifTool Commands for Image Organization (http://ninedegreesbelow.com/photography/exiftool-commands.html)

Digital Asset Management using digiKam and Exiftool: cleaning up messy metadata (http://ninedegreesbelow.com/photography/dam-software-metadata.html)

Digital Asset Management using digiKam, Geeqie, and Exiftool: ingestion (http://ninedegreesbelow.com/photography/dam-ingest.html)

The last article has sample commands for renaming and moving image files by date and time.

I don’t find it very easy to remember Exiftool syntax, so I wrote these articles mostly so I don’t have to remember “how to do whatever it was I did the last time I modified and moved files around”. Maybe other people also might find the articles useful.

3 Likes

Great knowledge, thanks for sharing ! I might use your tutorial on the cleaning junk metadata. I have noticed that I have all sorts of information added by different software there too.

As for the subject, I definitely liked Rapid Photo Downloader. Since the bicycle (read - script, code) has already been invented why would I invent it again ?

This was a helpful article; thank you very much. (I realize this is an old thread but I have a couple of comments which might be helpful to others.)

In the section on renaming image files according to their creation date, you suggest a command like this:
exiftool ‘-filename<CreateDate’ -d %y%m%d_%H%M%S%%-c.%%le <folder or file name(s)>

Two things I found useful in my own renaming efforts:

  • %Y instead of %y will give a 4-digit instead of 2-digit year, which is essential for me.
  • adding -v1 option (exiftool -v1) will list each file as it processes it, so you can keep track of progress (or hit CTRL-C to abort if you realize you made a blunder).

Speaking of blunders, if for month and day you put %M%D instead of %m%d, then exiftool creates two subfolders and moves the photo there with an undesirable name. Example:
%Y%m%d yields 20180827_154058.JPG as desired, but
%Y%M%D yields 20184008/27/18_154058.JPG
(Year,Minute,day/month/year_HourMinSec).

Finally, as you point out, sometimes 2 percent signs are needed instead of one for some obscure reason. I think this is because %-, %l, and %e have their own meanings in the date specifier (see ‘man strftime’ on your Mac/Linux machine). E.g., “%l is replaced by the hour (12-hour clock) as a decimal number (1-12); single digits are preceded by a blank.”

Cheers,
Jeff DLB
First post here – I know, I know, created an account just to comment on a two-year-old post; what a noob! :slight_smile:

2 Likes