Is it possible to combine both these commands into one?

Started by metalhead, October 31, 2019, 11:24:04 PM

Previous topic - Next topic

metalhead

I've written two commands that appear to work fine.  Is it possible to combine them into a single command?

Output before changes:
exiftool -G1 -a -s -time:all -api QuickTimeUTC ".\MK.mp4"
[System]        FileModifyDate                  : 2013:05:10 12:17:10+01:00
[System]        FileAccessDate                  : 2019:10:31 14:16:16+00:00
[System]        FileCreateDate                  : 2019:10:31 14:15:20+00:00
[QuickTime]     CreateDate                      : 2013:05:10 21:05:25+01:00
[QuickTime]     ModifyDate                      : 2013:05:10 21:05:25+01:00
[Track1]        TrackCreateDate                 : 2013:05:10 21:05:25+01:00
[Track1]        TrackModifyDate                 : 2013:05:10 21:05:25+01:00
[Track1]        MediaCreateDate                 : 2013:05:10 21:05:25+01:00
[Track1]        MediaModifyDate                 : 2013:05:10 21:05:25+01:00
[Track2]        TrackCreateDate                 : 2013:05:10 21:05:25+01:00
[Track2]        TrackModifyDate                 : 2013:05:10 21:05:25+01:00
[Track2]        MediaCreateDate                 : 2013:05:10 21:05:25+01:00
[Track2]        MediaModifyDate                 : 2013:05:10 21:05:25+01:00


exiftool -CreateDate-=1 -MediaCreateDate-=1 -TrackCreateDate-=1 -FileModifyDate+="0:0:0 8:00:0" -P ".\MK.mp4"
exiftool -api QuickTimeUTC "-QuickTime:ModifyDate<FileModifyDate" "-MediaModifyDate<FileModifyDate" "-TrackModifyDate<FileModifyDate" -P ".\MK.mp4"

Output after changes:
[System]        FileModifyDate                  : 2013:05:10 20:17:10+01:00
[System]        FileAccessDate                  : 2013:05:10 20:17:10+01:00
[System]        FileCreateDate                  : 2019:10:31 14:15:20+00:00
[QuickTime]     CreateDate                      : 2013:05:10 20:05:25+01:00
[QuickTime]     ModifyDate                      : 2013:05:10 20:17:10+01:00
[Track1]        TrackCreateDate                 : 2013:05:10 20:05:25+01:00
[Track1]        TrackModifyDate                 : 2013:05:10 20:17:10+01:00
[Track1]        MediaCreateDate                 : 2013:05:10 20:05:25+01:00
[Track1]        MediaModifyDate                 : 2013:05:10 20:17:10+01:00
[Track2]        TrackCreateDate                 : 2013:05:10 20:05:25+01:00
[Track2]        TrackModifyDate                 : 2013:05:10 20:17:10+01:00
[Track2]        MediaCreateDate                 : 2013:05:10 20:05:25+01:00
[Track2]        MediaModifyDate                 : 2013:05:10 20:17:10+01:00



StarGeek

#1
They can be combined with the -execute option, but it will still take two passes over the files.

exiftool -CreateDate-=1 -MediaCreateDate-=1 -TrackCreateDate-=1 -FileModifyDate+="0:0:0 8:00:0" -execute -api QuickTimeUTC "-QuickTime:ModifyDate<FileModifyDate" "-MediaModifyDate<FileModifyDate" "-TrackModifyDate<FileModifyDate" -common_args -P ".\MK.mp4"
* 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).

Phil Harvey

I think this can be done in one pass using the -globalTimeShift option:

exiftool -CreateDate-=1 -MediaCreateDate-=1 -TrackCreateDate-=1 -globaltimeshift 8 "-filemodifydate<filemodifydate" -api QuickTimeUTC "-QuickTime:ModifyDate<FileModifyDate" "-MediaModifyDate<FileModifyDate" "-TrackModifyDate<FileModifyDate" ".\MK.mp4"

- 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 ($).

StarGeek

Ah, better.  GlobalTimeShift crossed my mind but since there were two different time values being shifted, I didn't give it further thought.
* 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).