Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming

Started by TheMasahiro, July 03, 2017, 05:35:23 AM

Previous topic - Next topic

TheMasahiro

Hi, I'm a total newbie on coding stuff, but if you are so kind to help me i would be greatfull.

I was looking for a command line so i could copy all of my videos CreationDate tag to the create, modify, access (FileSystem tags) and trackdate tags all at once (and in case theres no CreationDate tag, i wanted it to copy the trackdate tag to the FileModify tag), and also i needed another command line so I could rename all those files to the trackdate date. On top of this i wanted it to search for only MP4 and MOV files in a sub directory of a specific folder.

(i hope its not very confusing)

I made a very basic line:

exiftool "-FileModifyDate<CreationDate" "-FileCreateDate<CreationDate" "-TrackCreateDate<CreationDate" "-FileModifyDate<TrackCreateDate" "-FileName<TrackCreateDate" -d %Y-%m-%d_%H.%M.%S.%%e 

I dont no how to go from here.

Another thing i was looking for is on a command to change the trackdate because i have some videos with the wrong trackdate, i want to manually insert the date and hour.

Thanks in advance

Phil Harvey

Your command is good so far, but you should use the TrackCreateDate first so that the CreateDate will override this if it exists.  You can't set the FileAccessDate.

Then add -ext options to only process the files you want.  So your command will look something like this:

exiftool "-FileModifyDate<TrackCreateDate" "-FileName<TrackCreateDate" "-FileModifyDate<CreationDate" "-FileCreateDate<CreationDate" "-TrackCreateDate<CreationDate" -d %Y-%m-%d_%H.%M.%S.%%e -ext mp4 -ext mov -o OUTDIR/ DIR

Also, I might suggest writing all this to a different output directory (OUTDIR) to make it easier to distinguish the originals afterward.  Also, you might want to add "-filename<creationdate" in case TrackCreateDate doesn't exist.

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

TheMasahiro

This is amazing, that's exacly what i wanted.
Thanks you so much. Is it possible to prevent it from creating originals?

Can you also guide me on a line so i can change the CreationDate or TrackCreateDate to a specific date and hour?

Thanks Phil

StarGeek

To set a specific date/time, you would use the equal sign, which assigns a static value, instead of the less than sign, which is for copying one tag to another.

The format for a time stamp is YYYY:MM:DD HH:MM:SS or you can use now for the current time. Take note that because there's a space in the time stamp, you'll need to enclose it in quotes.

Examples:
exiftool -CreationDate="2016:07:04 12:24:36" File
exiftool -TrackCreateDate=now File
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

TheMasahiro

Thanks, that worked. i have a big library, can i prevent it from duplicating the video with the new names? cant it just modify the original?

Also is it possible to change the time zone difference of multiple files? i wanted to shift the CreationDate and Trackdate by one hour.



Phil Harvey

If you are writing any metadata then the file will get rewritten anyway.  You can add -overwrite_original to delete the original afterward, but I recommend you keep backups.

Note that writing CreationDate won't work because ExifTool currently doesn't have the ability to write this tag.   Do you mean CreateDate?  You can write/increment TrackCreateDate and CreateDate.  To increment by 1 hour, do this:

-trackcreatedate+=1

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

TheMasahiro

Thanks guys!

This just saved me WEEKS! of organizing everything by hand.

StarGeek

Yeah, that feeling when you've just sorted hundreds, thousands, if not tens of thousands of files with a single command is just amazing.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).