Author Topic: Batch Shifting of Time/Date for movie Files  (Read 6343 times)

grole

  • Full Member
  • ***
  • Posts: 33
Batch Shifting of Time/Date for movie Files
« on: April 27, 2015, 01:36:38 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15346
    • ExifTool Home Page
Re: Batch Shifting of Time/Date for movie Files
« Reply #1 on: April 27, 2015, 01:43:17 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

grole

  • Full Member
  • ***
  • Posts: 33
Re: Batch Shifting of Time/Date for movie Files
« Reply #2 on: April 27, 2015, 02:13:42 PM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15346
    • ExifTool Home Page
Re: Batch Shifting of Time/Date for movie Files
« Reply #3 on: April 27, 2015, 02:26:45 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

grole

  • Full Member
  • ***
  • Posts: 33
Re: Batch Shifting of Time/Date for movie Files
« Reply #4 on: April 27, 2015, 03:48:19 PM »
OK, well thanks anyway for the help.


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15346
    • ExifTool Home Page
Re: Batch Shifting of Time/Date for movie Files
« Reply #5 on: April 27, 2015, 06:20:55 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

grole

  • Full Member
  • ***
  • Posts: 33
Re: Batch Shifting of Time/Date for movie Files
« Reply #6 on: April 28, 2015, 12:39:59 AM »
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

  • Full Member
  • ***
  • Posts: 33
Re: Batch Shifting of Time/Date for movie Files
« Reply #7 on: January 15, 2017, 04:31:24 PM »
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

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2909
Re: Batch Shifting of Time/Date for movie Files
« Reply #8 on: January 15, 2017, 06:13:37 PM »
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.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

grole

  • Full Member
  • ***
  • Posts: 33
Re: Batch Shifting of Time/Date for movie Files
« Reply #9 on: February 05, 2017, 06:41:45 AM »
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