After converting video files, setting the datecreated-tag to the source file

Started by Wernher, March 20, 2021, 05:21:44 PM

Previous topic - Next topic

Wernher

Dear experts,
here is a newbie with no terminal background trying to keep his video memory in chronological order :)

What I want to do:
- Convert a lot of video files to a new codex (with Apple Automator) and keep the created on-information of the source file. So if I import the video files in Apple photos afterwards, a video from March 20 2015 should show up in the timeline in 2015, not 2021.

Problem:
Converting the files create new files with same file name, but different extension. The date-created info is lost and after importing the files in Apple Photos, they show up under todays date.

I read through terminal and ExifTool documentation and found the -tagsfromfile command should be the right one. But I don't manage to make it work, the command does not get access to any files - and I need to batch process a lot of files.

My structure:

Folder1 contains
video1.mts
video2.mts
...

Folder2 contains converted files
video1.mov (or .m4v or whatever, need to test what works afterwards)
video2.mov

>>files in folder2 should have the same date created info as the files with the corresponding names in folder 1.

My best attempt was this one:

exiftool -tagsfromfile /users/holger/desktop/testfeld/legacy/%f /users/holger/desktop/testfeld/convert/%f
Warning: Error opening file - /users/holger/desktop/testfeld/legacy/%f
Error: File not found - /users/holger/desktop/testfeld/convert/%f
    0 image files updated
    1 files weren't updated due to errors

>> so this command obviously expected images instead of video, but how do I change this?

How do I set up the right ExifTool -tagsfromfile command so that it fetches the info from all source files and applies it to all target files?

I appreciate your help VERY much :-)

Cheers!

Wernher

Phil Harvey

Hi Wernher,

I think you want to do something like this:

exiftool -tagsfromfile /users/holger/desktop/testfeld/legacy/%f.mts /users/holger/desktop/testfeld/convert "-createdate<datetimeoriginal"

MTS videos contain DateTimeOriginal, but MP4/MOV videos use CreateDate, so this command sets CreateDate for files in the "convert" folder from DateTimeOriginal of the .mts files.

If you get a "file not found" error for the "convert" directory, try dragging and dropping the folder instead of typing the directory name.  (It avoids typos like this.)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Wernher

Thanks Phil. Looks like I can move forward with your suggestion. Need to test with different video formats (unfortunately, I have more than .mts. Need to look up that command to read out the fields included in the data to determine which carries the right "datecreated"-info.