Author Topic: Changing only the timezone  (Read 3317 times)

js29pub

  • Jr. Member
  • **
  • Posts: 11
Changing only the timezone
« on: November 26, 2016, 03:51:46 PM »
I've combed the manual and the forums, can't seem to figure out how to change only the timezone (and nothing else) on a Sony XAVC MP4 file (I'm running this on OS X Yosemite 10.10.5 using 'exiftool' in the terminal):

ExifTool Version Number         : 10.36
---- File ----
File Type                       : MP4
File Type Extension             : mp4
MIME Type                       : video/mp4
---- QuickTime ----
Major Brand                     : Sony XAVC
Minor Version                   : 100.1f.ff
Compatible Brands               : XAVC, mp42, iso2

For example, here is the time info:

> exiftool -time:all -G0:1 -s C0003.MP4

[File:System]   FileModifyDate                  : 2016:11:18 06:30:14-08:00
[File:System]   FileAccessDate                  : 2016:11:26 12:34:24-08:00
[File:System]   FileInodeChangeDate             : 2016:11:26 12:33:27-08:00
[QuickTime]     CreateDate                      : 2016:11:18 14:30:04
[QuickTime]     ModifyDate                      : 2016:11:18 14:30:04
[QuickTime:Track1] TrackCreateDate              : 2016:11:18 14:30:04
[QuickTime:Track1] TrackModifyDate              : 2016:11:18 14:30:04
[QuickTime:Track3] MediaCreateDate              : 2016:11:18 14:30:04
[QuickTime:Track3] MediaModifyDate              : 2016:11:18 14:30:04
[QuickTime]     TimeZone                        : +02:00
[XML]           LastUpdate                      : 2016:11:18 16:30:04+02:00

I just want to modify the two bolded/red "+02:00" values to "-07:00".  I tried the following:

> exiftool -v2 -TimeZone=-07:00 C0003.MP4

Writing Ricoh:TimeZone if tag exists
Writing Canon:TimeZone if tag exists
Writing Nikon:TimeZone if tag exists
======== C0003.MP4
Rewriting C0003.MP4...
  FileType = MP4
  FileTypeExtension = MP4
  MIMEType = video/mp4
  Editing tags in: MakerNotes
  Creating tags in:
  Rewriting Movie
  Rewriting MovieHeader
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
Nothing changed in C0003.MP4
    0 image files updated
    1 image files unchanged

I also tried:

> exiftool -v2 -QuickTime:TimeZone=-07:00 C0003.MP4
Warning: Tag 'QuickTime:TimeZone' is not supported
Nothing to do.

Can someone explain how to do this?

Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 974
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Changing only the timezone
« Reply #1 on: November 26, 2016, 04:25:57 PM »
Exiftool only has limited write support for MP4 files so you'll need another tool for this.  In answer to a question on this forum a while ago, I wrote a script to alter mts and other movie files (matchdatetime) perhaps it also suits your needs. If not, let me know and I might be able to alter the script.
Hayo Baan – Photography
Web: www.hayobaan.nl

js29pub

  • Jr. Member
  • **
  • Posts: 11
Re: Changing only the timezone
« Reply #2 on: November 26, 2016, 06:00:43 PM »
Thanks for the reply.  Too bad about the limited support for MP4.  I tried your matchdatetime, but it gave me this message:

> matchDateTime -tz -07 C0003.MP4
Skipped: Unable to find MakerNotes DateTimeOriginal in C0003.MP4

I guess I'll just focus on changing the file system timestamps.

Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 974
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Changing only the timezone
« Reply #3 on: November 27, 2016, 06:15:48 AM »
Right, one of the two current modes is that it tries to find the datetime in the Nikon makernotes. If you could mail me a small sample file, I will have a look at extending my script so it covers your case too.
Hayo Baan – Photography
Web: www.hayobaan.nl

ragnor

  • Newbie
  • *
  • Posts: 7
Re: Changing only the timezone
« Reply #4 on: March 23, 2019, 10:48:00 AM »
Hello all,

I have the same request, so I´m answering to this old post.

GoPro is messing with my dates, apparently because the files are saved with the dates taken as UTC, and when files are stored to my PC it takes into account my local timezone (+1) so it adds 1h to all videos.
I would like to know if it would be possible to just add a +1GMT in the metadata to correct this issue.

Some years passed since the original post, so I guess there has been some improvement in MP4 management?

Thank you!

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2413
Re: Changing only the timezone
« Reply #5 on: March 23, 2019, 11:35:50 AM »
GoPro is messing with my dates, apparently because the files are saved with the dates taken as UTC, and when files are stored to my PC it takes into account my local timezone (+1) so it adds 1h to all videos.

Yes, the time stamps embedded in .mp4/.mov files is supposed to be stored as UTC time as per the spec and Windows takes it as such and corrects appropriately.  Most non-phone cameras are usually not aware of time zones and save it as local time.  Not all programs/web sites will correct automatically.  I believe, for example, you'll run into the reverse problem if you upload the video to Google Photos.

Quote
I would like to know if it would be possible to just add a +1GMT in the metadata to correct this issue.

You'll have to figure out which tag is the correct one to edit, as I can't remember off hand, but the basic command would be:
exiftool -TAG+=1 FileOrDir

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.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14554
    • ExifTool Home Page
Re: Changing only the timezone
« Reply #6 on: March 26, 2019, 10:03:18 PM »
If all goes well, I plan a big improvement to MP4 writing in the next release.

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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14554
    • ExifTool Home Page
Re: Changing only the timezone
« Reply #7 on: March 27, 2019, 12:35:51 PM »
(This update is turning out to be a real pain in the ass.  But then, this is expected or else I would have done it a lot sooner.)
...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 ($).

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2413
Re: Changing only the timezone
« Reply #8 on: March 27, 2019, 01:02:22 PM »
Even though I don't do much with video, I'm very interested in what you are working up.  I can hardly wait to see.
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.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14554
    • ExifTool Home Page
Re: Changing only the timezone
« Reply #9 on: March 28, 2019, 01:15:54 PM »
ExifTool 11.33 is now available.

With this version you should be able to edit most QuickTime tags, but you still won't be able to add any new ones.  Only XMP tags may be added.

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

ragnor

  • Newbie
  • *
  • Posts: 7
Re: Changing only the timezone
« Reply #10 on: April 10, 2019, 11:19:45 AM »
Thank you so much for the update!

The problem seems that my GoPro is not adding any Timezone tag.

For instance:
Code: [Select]
ExifTool Version Number         : 11.35
File Name                       : GX011182.MP4
Directory                       : C:/Users/xxxx
File Size                       : 12 MB
[b]File Modification Date/Time     : 2019:03:23 12:00:43+01:00[/b]
File Access Date/Time           : 2019:04:10 17:08:38+02:00
File Creation Date/Time         : 2019:04:10 17:08:38+02:00
File Permissions                : rw-rw-rw-
File Type                       : MP4
File Type Extension             : mp4
MIME Type                       : video/mp4
Major Brand                     : MP4 v1 [ISO 14496-1:ch13]
Minor Version                   : 2013.10.18
Compatible Brands               : mp41
Movie Data Size                 : 12908548
Movie Data Offset               : 28
Movie Header Version            : 0
[b]Create Date                     : 2019:03:23 12:00:39
Modify Date                     : 2019:03:23 12:00:39[/b]
Time Scale                      : 60000
Duration                        : 2.09 s
Preferred Rate                  : 1
Preferred Volume                : 100.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 6
Lens Serial Number              : LAJ8082436601367
Camera Serial Number Hash       : aaa1c890f8dabf18748907aa17a01ab5
Camera Serial Number            : C3281325274627
Camera Model Name               : HERO7 Black
Firmware Version                : HD7.01.01.70.00
Auto Rotation                   : Up
Digital Zoom                    : No
Pro Tune                        : Off
White Balance                   : AUTO
Sharpness                       : HIGH
Color Mode                      : GOPRO
Auto ISO Max                    : 3200
Auto ISO Min                    : 100
Exposure Compensation           : 0.0
Rate                            : 1_60SEC
Field Of View                   : Wide
Audio Setting                   : AUTO
Device Name                     : Highlights
Track Header Version            : 0
Track Create Date               : 2019:03:23 12:00:39
Track Modify Date               : 2019:03:23 12:00:39
Track ID                        : 1
Track Duration                  : 2.09 s
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 3840
Image Height                    : 2160
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Compressor ID                   : hvc1
Source Image Width              : 3840
Source Image Height             : 2160
X Resolution                    : 72
Y Resolution                    : 72
Compressor Name                 : GoPro H.265 encoder
Bit Depth                       : 24
Video Frame Rate                : 59.94
Time Code                       : 3
Balance                         : 0
Audio Format                    : mp4a
Audio Channels                  : 2
Audio Bits Per Sample           : 24
Audio Sample Rate               : 48000
Text Font                       : Unknown (21)
Text Face                       : Plain
Text Size                       : 10
Text Color                      : 0 0 0
Background Color                : 65535 65535 65535
Font Name                       : Helvetica
Other Format                    : tmcd
Warning                         : [minor] The ExtractEmbedded option may find more tags in the movie data
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2019:03:23 12:00:39
Media Modify Date               : 2019:03:23 12:00:39
Media Time Scale                : 60000
Media Duration                  : 2.09 s
Handler Class                   : Media Handler
Handler Type                    : NRT Metadata
Handler Description             : GoPro SOS
Gen Media Version               : 0
Gen Flags                       : 0 0 0
Gen Graphics Mode               : srcCopy
Gen Op Color                    : 0 0 0
Gen Balance                     : 0
Meta Format                     : fdsc
Avg Bitrate                     : 49.4 Mbps
Image Size                      : 3840x2160
Megapixels                      : 8.3
Rotation                        : 0

The problem here is that the correct time was not 2019:03:23 12:00:39, but 2019:03:23 11:00:39+01:00. Windows seems to get that time thinking that is UTC and then adds a +01:00, so then it displays incorrectly in Windows and also when uploading them to Google photos, for example.

I uploaded the same clip in case anyone wants to take a look: https://drive.google.com/file/d/1DXUyazWnd_KX6gOA7G6Z3I1cwLY2KMQu/view
Any idea of how to fix the times?
I have over 2000 clips to fix already, and the number is increasing day by day, so it´s really a problem.
GoPro doesn´t seem to be going to fix it.

Thank you!

Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 974
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Changing only the timezone
« Reply #11 on: April 10, 2019, 12:01:30 PM »
It's a real pity there's no time zone / offset information in those files. But have you already tried simply subtracting an hour from the current times?

E.g.
Code: [Select]
exiftool -ModifyDate-=1:0:0 -CreateDate-=1:0:0 -FileModifyDate-=1:0:0 GX011182.MP4
(To make the dates consistent, consider doing the same to the TrackCreateDate, TrackModifyDate, MediaCreateDate, and MediaModifyDate)
Hayo Baan – Photography
Web: www.hayobaan.nl

ragnor

  • Newbie
  • *
  • Posts: 7
Re: Changing only the timezone
« Reply #12 on: April 10, 2019, 12:21:48 PM »
Thanks for your fast reply!
That would indeed be an option. But wouldn´t that create a ¨fake¨ time on the clip, showing a createtime that is not actually correct?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14554
    • ExifTool Home Page
Re: Changing only the timezone
« Reply #13 on: April 10, 2019, 12:29:02 PM »
Try using the -api quicktimeutc option when extracting tags.  Could it be that these tags are already written correctly?

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

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2413
Re: Changing only the timezone
« Reply #14 on: April 10, 2019, 12:30:54 PM »
As I said in my first response, the time stamp is supposed to be in UTC according to the spec.  Windows, for once, is actually reading the data correctly.  But other programs might not.  I'm not sure how Google Photos reads it.

You have to decide based upon what programs you use and how they read the timestamp if you want it to be technically correct and set to UTC time or set it the actual, local time it was shot.
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.