Batch Shifting of Time/Date for movie Files

Started by grole, April 27, 2015, 01:36:38 PM

Previous topic - Next topic

grole

Hello,

I'm looking for a way to batch shift the date/time of movies taken by various digital cameras after I've noticed that the setting was wrong. I do this regularly with the "-AllDates" function for .jpg files. Sorry in advance if this is a dumb question. I've managed to find out that the newest version of Exiftool will shift some dates such as "created" and "modified". However the one I need in oder to use Downloader Pro appears to be "Date/Time Original", which remains unchanged.

I've attached the output before and after for mp4 and mov files. In both cases the command used was:

exiftool "-AllDates+=:: 9::" DIR

in order to shift 9 hours ahead. Note: disregard the file name as it has been adjusted already.

Is there a different command which can be used successfully for "Date/Time Original"? The best would be to also shift the create and modified dates as Dowloader Pro I believe takes whichever is later. Hence the practicality of "AllDates" for the .jpgs.

Thanks in advance!

Phil Harvey

Use this command to see all date/times and where they are located:

exiftool -a -G1 -time:all FILE

And consult the QuickTime tags documentation to see if the ones you need are writable.

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

grole

Hi Phil,

Thanks for your answer. I used that command and indeed the only time/date changed were the QuickTime ones.

I suppose there is no command for changing the ExifIFD values?


[System]        File Modification Date/Time     : 2015:04:27 19:29:09+02:00
[System]        File Access Date/Time           : 2015:04:27 19:29:08+02:00
[System]        File Creation Date/Time         : 2015:04:27 19:28:23+02:00
[IFD0]          Modify Date                     : 2015:04:17 17:13:53
[ExifIFD]       Date/Time Original              : 2015:04:17 17:13:53
[ExifIFD]       Create Date                     : 2015:04:17 17:13:53
[Canon]         Time Zone                       : +01:00
[Canon]         Time Zone City                  : Paris
[Canon]         Daylight Savings                : Off
[ExifIFD]       Sub Sec Time                    : 84
[ExifIFD]       Sub Sec Time Original           : 84
[ExifIFD]       Sub Sec Time Digitized          : 84
[QuickTime]     Create Date                     : 2015:04:18 02:13:53
[QuickTime]     Modify Date                     : 2015:04:18 02:13:53
[Track1]        Track Create Date               : 2015:04:17 17:13:53
[Track1]        Track Modify Date               : 2015:04:17 17:13:53
[Track1]        Media Create Date               : 2015:04:17 17:13:53
[Track1]        Media Modify Date               : 2015:04:17 17:13:53
[Track2]        Track Create Date               : 2015:04:17 17:13:53
[Track2]        Track Modify Date               : 2015:04:17 17:13:53
[Track2]        Media Create Date               : 2015:04:17 17:13:53
[Track2]        Media Modify Date               : 2015:04:17 17:13:53
[Track3]        Track Create Date               : 2015:04:17 17:13:53
[Track3]        Track Modify Date               : 2015:04:17 17:13:53
[Track3]        Media Create Date               : 2015:04:17 17:13:53
[Track3]        Media Modify Date               : 2015:04:17 17:13:53
[Composite]     Create Date                     : 2015:04:17 17:13:53.84
[Composite]     Date/Time Original              : 2015:04:17 17:13:53.84
[Composite]     Modify Date                     : 2015:04:17 17:13:53.84

Phil Harvey

I am surprised if anything but ExifTool reads these EXIF tags from MOV/MP4 videos.  But you are right, current ExifTool does not write these.

ExifTool will write the QuickTime and Track date/time tags though.

Perhaps I should have suggested -G0 instead of -G1.  The family 1 Track group is still within the QuickTime metadata.

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

grole


Phil Harvey

I looked in more detail how the EXIF information is stored in Canon MOV videos, because I thought that ExifTool should be able to write this.  But in Canon videos, the EXIF is inside the embedded JPEG thumbnail image in MOV videos, and ExifTool does not write the thumbnail.  But there should be no need to do this because I can't imagine that any other metadata utility but Canon utilities and ExifTool (and perhaps ExifTool-derived software) would ever read this.

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

grole

I've written the developer of downloader pro to confirm which data it reads and see if they have another solution. I'll write back once I know.

I'm surprised that this isn't something more people are looking for. I routinely need to make adjustments and movie clips, as I use the same archive system, are now just as important.

grole

Sorry to open an old topic, but I'm still having issues with movie files.

As I wrote before I use Downloader Pro to rename and file all photos and movies. If the movie time/date is wrong, because the camera was set wrong, I'd want to shift it.

I know Phil looked at Canon MOV/MP4 files back then and it didn't look good. I didn't get an answer about what DP uses at the time. But I've noticed recently it seems to use the file modify date.

I've seen recently that movies shot in Pacific Time with correct camera time show a file modify date of +9h when I process them back home in Germany - which is 9 time zones ahead. It must be a windows thing? Anyway, DP diligently names the files using the time +9h.

I've had some success using -filemodifydate-=:: 9:: to force the time back to the correct one, for example on movies from a Canon G7xII. But this doesn't work for all files.

Right now I'm working on some AVI files from 2003 and noticed the same thing. Exiftool reads the following:

C:\Users\Administrator>exiftool -a -G0 -time:all E:\Temp\Shift\MVI_2784.avi
[File]          File Modification Date/Time     : 2003:06:28 06:18:54+02:00
[File]          File Access Date/Time           : 2017:01:15 21:51:49+01:00
[File]          File Creation Date/Time         : 2017:01:15 21:51:49+01:00
[RIFF]          Date/Time Original              : 2003:06:27 21:18:53


Note that the Date/Time Original is correct. DP reads 2003:06:28 05:18:54, which I assume must have something to due with daylight savings time? I looked some more and the different software show different times:

Windows: 06:18:54
ACDSee: 05:18:54
ExiftoolGUI: 05:18:54 +2:00

Anyway I attempted to shift this and nothing worked. Can Exiftool just not shift AVI files?

C:\Users\Administrator>exiftool "-datetimeoriginal-=:: 9::" e:\temp\shift
    1 directories scanned
    0 image files read

C:\Users\Administrator>exiftool "-alldates-=:: 9::" e:\temp\shift
    1 directories scanned
    0 image files read

C:\Users\Administrator>exiftool "-filemodifydate-=:: 9::" e:\temp\shift
    1 directories scanned
    0 image files read




StarGeek

That DateTimeOriginal tag is in the RIFF group.  If you check that link, you'll see that Exiftool cannot write to DateTimeOriginal in the RIFF group.

After looking around, it might be that FFMPeg can do what you want.  I found this StackOverflow answer that might help.  The command there is
ffmpeg -i old.avi -metadata ICRD="2013-05-02 22:01:04" -c copy new.avi
You might also add -map_metadata 0 to that command.

Actually, the command you want to use may be
ffmpeg -i old.avi -metadata IDIT="2013-05-02 22:01:04" -c copy new.avi

ICRD is the creation date.  According to the RIFF page, DateTimeOriginal is IDIT.

From the looks of it, Phil's RIFF page has more complete data than any FFMpeg page I could find.
* 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).

grole

I just realized I haven't replied to this.

Thanks a lot for the info. I haven't read into how to use ffmeg yet but I'll do that when the time comes.

I also tried a trial version of Attribute Magic, which seemed to do the trick and also has a batch feature. So there are some options.

Cheers

scottb5612

I'd like to time-shift MOV files produced by a Nikon Z6
Is it still the case that exiftool won't enable me to shift times,
that I should use ffmpeg instead, as suggested by Stargeed in 2017?

StarGeek

Exiftool has had the ability to shift times in MP4/MOV files since Version 11.39 - May 3, 2019.  It cannot yet edit data in an AVI file, but that ability may be coming soon.
* 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).

scottb5612

#12
I'm running  OSX 11.7 (Big Sur) and using the following version of exiftool

11.89 [Warning: Library version is 11.99]

As mentioned, I'm working with an MOV file produced by a Nikon Z6

What I'm trying to do is to shift the time to correct it
For NEF files, the following command works

exiftool "-DateTimeOriginal-=7" "-ModifyDate-=7" "-CreateDate-=7" FILE

It doesn't change DateTimeOriginal and CreateDate in the MOV file,
just  ModifyDate

I used the command suggested in FAQ #3 which does indeed show that these two tags are present (I include the Nikon camera information, too


exiftool -a -G1 -s FILE

[QuickTime]    CreateDate                      : 2022:10:22 05:22:37
[QuickTime]    ModifyDate                      : 2022:10:22 05:22:37
[Nikon]        Model                          : NIKON Z 6
[Nikon]        Software                        : NIKON Z 6 Ver.02.00
[Nikon]        CreateDate                      : 2022:09:30 05:06:37
[Nikon]        DateTimeOriginal                : 2022:09:30 05:06:37

The issue is that I use another exiftool command to extract CreateDate
and prepend it to the file name:

exiftool -d %Y-%m%d_%H%M-%%f.%%e "-filename<CreateDate" FILE
This command is picking up the Nikon Create date, which has not been shifted.


I could use the QT CreateDate tag reported above, however, the file
name changing command works with still images of all kinds (and has for some time)
and I was hoping not to avoid using a different command for MOV files. Perhaps that's not realistic

If that's the case,  how to I specify the QT CreateDate in my file renaming command
I've named it  ?CreateDate? below, a placeholder for a supported name

exiftool -d %Y-%m%d_%H%M-%%f.%%e "-filename<?CreateDate?" FILE.MOV


Scott

Phil Harvey

Hi Scott,

Quote from: scottb5612 on October 30, 2022, 03:57:32 AMexiftool -d %Y-%m%d_%H%M-%%f.%%e "-filename<CreateDate" FILE
This command is picking up the Nikon Create date, which has not been shifted.

Try this:

exiftool -d %Y-%m%d_%H%M-%%f.%%e "-filename<QuickTime:CreateDate" FILE

If you want to use the same command for other file types, try this:

exiftool -d %Y-%m%d_%H%M-%%f.%%e "-filename<CreateDate" "-filename<QuickTime:CreateDate" FILE

This will use QuickTime:CreateDate if it exists, otherwise default to any other CreateDate (the latter argument overrides earlier ones).


- 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

Quote from: scottb5612 on October 30, 2022, 03:57:32 AMIt doesn't change DateTimeOriginal and CreateDate in the MOV file,
just  ModifyDate

As shown by the FAQ #3 command output, those tags are in the Nikon group.  If you check the Nikon tags page, most likely the Nikon NCTG Tags section since it's a MOV file, you will see that those tags are not editable.
* 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).