copy created date to exif

Started by boombass, May 16, 2017, 07:26:38 PM

Previous topic - Next topic

boombass

I've got mp4 files from a Canon S120. When I upload them to Google Photos, the creation date is wrong. How can I use exiftool to fix them?

Here is the result:
ExifTool Version Number         : 10.47
File Name                       : MVI_2205.MP4
Directory                       : xxxxxxxx
File Size                       : 20 MB
File Modification Date/Time     : 2017:05:08 18:11:26-06:00
File Access Date/Time           : 2017:05:16 17:16:38-06:00
File Inode Change Date/Time     : 2017:05:16 17:14:20-06:00
File Permissions                : rw-------
File Type                       : MP4
File Type Extension             : mp4
MIME Type                       : video/mp4
Major Brand                     : MP4 v2 [ISO 14496-14]
Minor Version                   : 0.0.1
Compatible Brands               : mp42, avc1, CAEP
Compressor Version              : CanonMP4_002/05.00.00/00.00.02
Exif Byte Order                 : Little-endian (Intel, II)
Image Description               :
Orientation                     : Horizontal (normal)
Resolution Unit                 : inches
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/125
F Number                        : 8.0
Sensitivity Type                : Standard Output Sensitivity and Recommended Exposure Index
Exif Version                    : 0230
Date/Time Original              : 2017:05:08 18:11:26
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 3
Shutter Speed Value             : 1/125
Aperture Value                  : 8.0
Exposure Compensation           : 0
Max Aperture Value              : 3.5
Metering Mode                   : Multi-segment
Flash                           : Off, Did not fire
Focal Length                    : 10.9 mm
Macro Mode                      : Normal
Self Timer                      : Off
Quality                         : Normal Movie
Canon Flash Mode                : Off
Continuous Drive                : Movie
Focus Mode                      : Single
Record Mode                     : MP4
Canon Image Size                : 1920x1080 Movie
Easy Mode                       : Full auto
Digital Zoom                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : 0
Camera ISO                      : Auto
Focus Range                     : Auto
AF Point                        : Face Detect
Canon Exposure Mode             : Program AE
Lens Type                       : n/a
Max Focal Length                : 26 mm
Min Focal Length                : 5.2 mm
Focal Units                     : 1000/mm
Max Aperture                    : 3.6
Min Aperture                    : 8
Flash Bits                      : (none)
Focus Continuous                : Continuous
AE Setting                      : Normal AE
Image Stabilization             : On (2)
Zoom Source Width               : 4000
Zoom Target Width               : 4000
Spot Metering Mode              : Center
Manual Flash Output             : n/a
Auto ISO                        : 100
Measured EV                     : 5.00
Target Aperture                 : 8
Target Exposure Time            : 1/125
White Balance                   : Auto
Slow Shutter                    : Off
Shot Number In Continuous Burst : 0
Optical Zoom Code               : 58
Flash Guide Number              : 0
Flash Exposure Compensation     : 0
Auto Exposure Bracketing        : Off
AEB Bracket Value               : 0
Control Mode                    : Camera Local Control
Focus Distance Upper            : 65.53 m
Focus Distance Lower            : 0 m
Bulb Duration                   : 0
Camera Type                     : Compact
Auto Rotate                     : None
ND Filter                       : Off
Self Timer 2                    : 0
Flash Output                    : 0
Canon Image Type                : MVI:PowerShot S120 Movie
Canon Firmware Version          : Firmware Version 1.01
File Number                     : 141-2205
Camera Temperature              : 27 C
Canon Model ID                  : PowerShot S120
Thumbnail Image Valid Area      : 0 159 15 104
Date Stamp Mode                 : Off
My Color Mode                   : Off
Firmware Revision               : 1.01 rev 1.00
Categories                      : (none)
AF Area Mode                    : Auto
Num AF Points                   : 9
Valid AF Points                 : 63
Canon Image Width               : 1920
Canon Image Height              : 1080
AF Image Width                  : 100
AF Image Height                 : 100
AF Area Widths                  : 11 58 512 -7144 138 83 -5536 4 60
AF Area Heights                 : 11 117 -1 -1 10641 276 443 23191 0
AF Area X Positions             : -33 641 526 117 58 1 0 0 0
AF Area Y Positions             : -33 578 487 101 23 0 0 0 0
AF Points In Focus              : (none)
Primary AF Point                : 6
Intelligent Contrast            : Off
Image Unique ID                 : b49494e024f109b682f473ac1d5a2786
Faces Detected                  : 65535
Time Zone                       : -06:00
Time Zone City                  : (not set)
Daylight Savings                : On
Aspect Ratio                    : 16:9
Cropped Image Width             : 1920
Cropped Image Height            : 1080
Cropped Image Left              : 0
Cropped Image Top               : 0
VRD Offset                      : 0
User Comment                    :
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 160
Exif Image Height               : 120
Interoperability Index          : THM - DCF thumbnail file
Interoperability Version        : 0100
Related Image Width             : 1920
Related Image Height            : 1080
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 1
Scene Capture Type              : Standard
Owner Name                      :
GPS Version ID                  : 2.3.0.0
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Thumbnail Image                 : (Binary data 11067 bytes, use -b option to extract)
Make                            : Canon
Camera Model Name               : Canon PowerShot S120
Copyright                       :
Author                          :
User Rating                     : 0
Movie Header Version            : 0
Create Date                     : 2017:05:09 00:11:26
Modify Date                     : 2017:05:09 00:11:26
Time Scale                      : 90000
Duration                        : 4.84 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                   : 3
Track Header Version            : 0
Track Create Date               : 2017:05:09 00:11:26
Track Modify Date               : 2017:05:09 00:11:26
Track ID                        : 1
Track Duration                  : 4.84 s
Track Layer                     : 0
Track Volume                    : 0.00%
Image Width                     : 1920
Image Height                    : 1080
Graphics Mode                   : srcCopy
Op Color                        : 0 0 0
Compressor ID                   : avc1
Source Image Width              : 1920
Source Image Height             : 1080
X Resolution                    : 72
Y Resolution                    : 72
Bit Depth                       : 24
Color Representation            : nclx 1 1 1
Video Frame Rate                : 59.94
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Media Header Version            : 0
Media Create Date               : 2017:05:09 00:11:26
Media Modify Date               : 2017:05:09 00:11:26
Media Time Scale                : 48000
Media Duration                  : 4.82 s
Media Language Code             : eng
Handler Type                    : Audio Track
Balance                         : 0
Audio Format                    : mp4a
Audio Channels                  : 2
Audio Bits Per Sample           : 16
Audio Sample Rate               : 48000
Movie Data Size                 : 21297808
Movie Data Offset               : 98312
XMP Toolkit                     : Image::ExifTool 10.47
GPS Altitude Ref                : Above Sea Level
GPS Latitude                    : 53 deg 31' 45.30" N
GPS Longitude                   : 113 deg 17' 47.67" W
Aperture                        : 8.0
Avg Bitrate                     : 35.2 Mbps
Drive Mode                      : Continuous Shooting
GPS Altitude                    : 719.9 m Above Sea Level
GPS Latitude Ref                : North
GPS Longitude Ref               : West
Image Size                      : 1920x1080
Lens                            : 5.2 - 26.0 mm
Lens ID                         : Unknown 5-26mm
Megapixels                      : 2.1
Rotation                        : 0
Shooting Mode                   : Program AE
Shutter Speed                   : 1/125
Focal Length                    : 10.9 mm
GPS Position                    : 53 deg 31' 45.30" N, 113 deg 17' 47.67" W
Lens                            : 5.2 - 26.0 mm


Can anyone help please? The correct date for this file was 2017:05:08 18:11:26. Google Photos is changing it by 6 hours.

StarGeek

I think Google photos is using Quicktime:CreateDate for the date for your MP4.  The reason it is 6 hours off is because Quicktime:CreateDate is supposed to be set to UTC, which is 6 hours ahead of your time zone.

Try this:
exiftool -CreateDate-=6 MVI_2205.MP4

But take note that this may cause other programs that read the create date correctly to be off.
* 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).

boombass

Thank you! That worked!

For a follow up question, how did you know to use the CreateDate tag? I don't see that at all in the exiftool output that I posted.

QuoteThe reason it is 6 hours off is because Quicktime:CreateDate is supposed to be set to UTC, which is 6 hours ahead of your time zone.

Is this something I set wrong in the camera? Or did Canon not implement Quicktime:CreateDate correctly?

I am keeping an unmodified backup of all of my photos and videos, and uploading the modified videos to Google Photos. I like using Google Photos to organize and arrange all of my photos and videos, but I wish I didn't have to modify my files before posting them. But if I don't, they will not sort by date correctly. A weird bug that I hope Google fixes some day.

Thanks again for your help!

StarGeek

Quote from: boombass on May 17, 2017, 10:23:28 AM
For a follow up question, how did you know to use the CreateDate tag? I don't see that at all in the exiftool output that I posted.

It's in your output, about 60% of the way through.
Camera Model Name               : Canon PowerShot S120
Copyright                       :
Author                          :
User Rating                     : 0
Movie Header Version            : 0
Create Date                     : 2017:05:09 00:11:26
Modify Date                     : 2017:05:09 00:11:26


As for how, I believe there was a similar post on here before and so I worked on the issue before.

Quote
QuoteThe reason it is 6 hours off is because Quicktime:CreateDate is supposed to be set to UTC, which is 6 hours ahead of your time zone.

Is this something I set wrong in the camera? Or did Canon not implement Quicktime:CreateDate correctly?

No, Canon implemented it correctly, though not all cameras do.  Phil had to implement an option to correct for those cases.  The problem is that Google isn't correcting for time zone when they read the file. 

* 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).

boombass

Thanks again!

So "Create Date" in the exiftool output is changed to "CreateDate" when I'm using it in a command. Got it.

And hopefully Google fixes their time zone problem. That happens with .mov files from my phone too.

StarGeek

Quote from: boombass on May 17, 2017, 06:37:44 PM
So "Create Date" in the exiftool output is changed to "CreateDate" when I'm using it in a command. Got it.

See FAQ #2.

QuoteAnd hopefully Google fixes their time zone problem. That happens with .mov files from my phone too.

I think it's unlikely to happen.  The change from the Picasa photo site to Photos.Google actually removed some metadata functionality.  They took a step back for some reason.
* 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).