Import: Extract metadata with Exiftool so that video filepath uses the actual creation date #810
tl;dr - importing mp4 videos from import/ -> originals/ seems to be ignoring the exif data for determining the new filename in originals/, it's using the file modification time only causing new filename to be incorrect.
I'm importing mp4 video files from import directory to originals directory. Import is being triggered via web interface with the 'move' option selected.
The photos were all correctly moved to year/month/filename structure using exif data to determine when they were taken, but the mp4 videos were all moved into that structure using the file modification times only (ignoring exif). Looking in the logs, I noticed all the mp4 files have messages similar to this one, showing file mod time was used:
Note, despite this, the photoprism web interface correctly shows the file as being taken in 2015, but the file has been renamed to a 2021 filename based on the file modification time which is a bit confusing if looking directly at the 'originals' directory.
The exif data for one of the renamed files is as below:
Using docker version 201231-8e22fbf8-Linux-x86_64
The text was updated successfully, but these errors were encountered:
This is because files are first moved, then indexed. However, PhotoPrism can't natively read video metadata - so the "real" date is unknown and the file system date is used. The indexer later won't move any files, so the "mistake" is not corrected.
For now, it seems best for you to manually copy files to originals if the correct folder with the right date is critical for you. Mobile sync apps often already structure uploads in sub-folders using YEAR/MONTH, so you don't need to use import in this case.
Ah - so I'm curious then, PhotoPrism is correctly identifying the date in the UI, and the sidecar .yml file has picked up the 'TakenAt' date:
Shouldn't the 'TakenAt' date be used for the file naming too?
Thank you for your help - one quick question if I may, for the files that are already imported, as there's no delete function - if I simply remove the files from the originals/ directory will PhotoPrism automatically clean up all associated sidecar files and so on? If so, do I need to re-index for that clean up to happen?