ExifTool Forum

ExifTool => Newbies => Topic started by: TheMasahiro on July 03, 2017, 05:35:23 AM

Title: Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming
Post by: TheMasahiro on July 03, 2017, 05:35:23 AM
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
Title: Re: Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming
Post by: Phil Harvey on July 03, 2017, 09:44:38 AM
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
Title: Re: Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming
Post by: TheMasahiro on July 03, 2017, 10:51:32 AM
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
Title: Re: Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming
Post by: StarGeek on July 03, 2017, 11:31:50 AM
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
Title: Re: Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming
Post by: TheMasahiro on July 03, 2017, 05:31:34 PM
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.


Title: Re: Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming
Post by: Phil Harvey on July 03, 2017, 09:47:42 PM
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
Title: Re: Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming
Post by: TheMasahiro on July 04, 2017, 02:56:59 PM
Thanks guys!

This just saved me WEEKS! of organizing everything by hand.
Title: Re: Comand line to copy CreationDate to all tags (only mp4 and mov) and renaming
Post by: StarGeek on July 04, 2017, 03:00:19 PM
Yeah, that feeling when you've just sorted hundreds, thousands, if not tens of thousands of files with a single command is just amazing.