Hi -
Can you use Exiftool to write EXIF group tags in an MP4 file?
Exiftool is fantastic and I think this is a newbie question and I've searched everywhere for an answer... I made the mistake of setting the year wrong on my new Canon G7 X camera and took many pictures and videos.
I am able to use Exiftool to adjust all of the dates/times on the images, but having some trouble with the videos.
Exiftool writes the metadata correctly in the Quicktime group, but I can't figure out how to write the "IFD0:ModifyDate", "ExifIFD:DateTimeOriginal" and "ExifIFD:CreateDate" tags.
Here's what I see when I try to write these tags:
$ exiftool -v "-ExifIFD:DateTimeOriginal+=1:0:0 0:0:0" ./MVI_1659.MP4
======== ./MVI_1659.MP4
Rewriting ./MVI_1659.MP4...
FileType = MP4
FileTypeExtension = MP4
MIMEType = video/mp4
Editing tags in: ExifIFD
Rewriting Movie
Rewriting UserData
Rewriting MovieHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Nothing changed in ./MVI_1659.MP4
0 image files updated
1 image files unchanged
Below is detail on all the tags.
Thank you very much for your help!
Kevin
--
The original files:
$ exiftool -a -s -G1 -time:all *
======== IMG_1658.JPG
[System] FileModifyDate : 2014:06:04 08:26:42-04:00
[System] FileAccessDate : 2015:06:14 13:08:25-04:00
[System] FileInodeChangeDate : 2015:06:14 13:08:24-04:00
[IFD0] ModifyDate : 2014:06:04 08:26:42
[ExifIFD] DateTimeOriginal : 2014:06:04 08:26:42
[ExifIFD] CreateDate : 2014:06:04 08:26:42
[Canon] TimeZone : +02:00
[Canon] TimeZoneCity : (not set)
[Canon] DaylightSavings : On
[GPS] GPSTimeStamp : 06:26:34
[GPS] GPSDateStamp : 2015:06:04
[Composite] GPSDateTime : 2015:06:04 06:26:34Z
======== MVI_1659.MP4
[System] FileModifyDate : 2014:06:04 08:26:50-04:00
[System] FileAccessDate : 2015:06:14 13:08:50-04:00
[System] FileInodeChangeDate : 2015:06:14 13:08:24-04:00
[IFD0] ModifyDate : 2014:06:04 08:26:51
[ExifIFD] DateTimeOriginal : 2014:06:04 08:26:51
[ExifIFD] CreateDate : 2014:06:04 08:26:51
[Canon] TimeZone : +02:00
[Canon] TimeZoneCity : (not set)
[Canon] DaylightSavings : On
[GPS] GPSTimeStamp : 06:26:34
[GPS] GPSDateStamp : 2015:06:04
[QuickTime] CreateDate : 2014:06:04 06:26:51
[QuickTime] ModifyDate : 2014:06:04 06:26:51
[Track1] TrackCreateDate : 2014:06:04 06:26:51
[Track1] TrackModifyDate : 2014:06:04 06:26:51
[Track1] MediaCreateDate : 2014:06:04 06:26:51
[Track1] MediaModifyDate : 2014:06:04 06:26:51
[Track2] TrackCreateDate : 2014:06:04 06:26:51
[Track2] TrackModifyDate : 2014:06:04 06:26:51
[Track2] MediaCreateDate : 2014:06:04 06:26:51
[Track2] MediaModifyDate : 2014:06:04 06:26:51
[Composite] GPSDateTime : 2015:06:04 06:26:34Z
2 image files read
Editing the dates with AllDates:
$ exiftool -v -AllDates+="1:0:0 0:0:0" IMG_1658.JPG MVI_1659.MP4
======== IMG_1658.JPG
Rewriting IMG_1658.JPG...
Editing tags in: APP0 APP1 CIFF ExifIFD IFD0 JFIF MIE-Doc MakerNotes PDF PNG QuickTime XMP
JPEG APP1 (27644 bytes):
Rewriting IFD0
ExifByteOrder = II
Rewriting ExifIFD
Rewriting MakerNoteCanon
Rewriting CanonCameraSettings
Rewriting CanonShotInfo
Rewriting CanonCameraInfoUnknown32
Rewriting MyColors
Rewriting ContrastInfo
Rewriting FaceDetect3
Rewriting TimeInfo
Rewriting AspectInfo
Rewriting InteropIFD
Rewriting GPS
Rewriting IFD1
JPEG APP1 (3994 bytes):
Rewriting XMP
[XMP rewritten with no changes]
JPEG APP2 (94 bytes):
JPEG DQT (130 bytes):
JPEG SOF0:
JPEG DHT (416 bytes):
JPEG SOS
======== MVI_1659.MP4
Rewriting MVI_1659.MP4...
FileType = MP4
FileTypeExtension = MP4
MIMEType = video/mp4
Editing tags in: ExifIFD IFD0 MIE-Doc MOV MakerNotes PDF PNG QuickTime XMP
Rewriting Movie
Rewriting UserData
Rewriting MovieHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Creating XMP
2 image files updated
$ exiftool -a -s -G1 -time:all IMG_1658.JPG MVI_1659.MP4
======== IMG_1658.JPG
[System] FileModifyDate : 2015:06:14 13:09:51-04:00
[System] FileAccessDate : 2015:06:14 13:10:20-04:00
[System] FileInodeChangeDate : 2015:06:14 13:09:51-04:00
[IFD0] ModifyDate : 2015:06:04 08:26:42
[ExifIFD] DateTimeOriginal : 2015:06:04 08:26:42
[ExifIFD] CreateDate : 2015:06:04 08:26:42
[Canon] TimeZone : +02:00
[Canon] TimeZoneCity : (not set)
[Canon] DaylightSavings : On
[GPS] GPSTimeStamp : 06:26:34
[GPS] GPSDateStamp : 2015:06:04
[Composite] GPSDateTime : 2015:06:04 06:26:34Z
======== MVI_1659.MP4
[System] FileModifyDate : 2015:06:14 13:09:51-04:00
[System] FileAccessDate : 2015:06:14 13:10:20-04:00
[System] FileInodeChangeDate : 2015:06:14 13:09:51-04:00
[IFD0] ModifyDate : 2014:06:04 08:26:51
[ExifIFD] DateTimeOriginal : 2014:06:04 08:26:51
[ExifIFD] CreateDate : 2014:06:04 08:26:51
[Canon] TimeZone : +02:00
[Canon] TimeZoneCity : (not set)
[Canon] DaylightSavings : On
[GPS] GPSTimeStamp : 06:26:34
[GPS] GPSDateStamp : 2015:06:04
[QuickTime] CreateDate : 2015:06:04 06:26:51
[QuickTime] ModifyDate : 2015:06:04 06:26:51
[Track1] TrackCreateDate : 2014:06:04 06:26:51
[Track1] TrackModifyDate : 2014:06:04 06:26:51
[Track1] MediaCreateDate : 2014:06:04 06:26:51
[Track1] MediaModifyDate : 2014:06:04 06:26:51
[Track2] TrackCreateDate : 2014:06:04 06:26:51
[Track2] TrackModifyDate : 2014:06:04 06:26:51
[Track2] MediaCreateDate : 2014:06:04 06:26:51
[Track2] MediaModifyDate : 2014:06:04 06:26:51
[Composite] GPSDateTime : 2015:06:04 06:26:34Z
2 image files read
Adjusting the Track1 & Track2 group dates
$ exiftool -v "-TrackCreateDate+=1:0:0 0:0:0" "-TrackModifyDate+=1:0:0 0:0:0" "-MediaCreateDate+=1:0:0 0:0:0" "-MediaModifyDate+=1:0:0 0:0:0" ./MVI_1659.MP4
======== ./MVI_1659.MP4
Rewriting ./MVI_1659.MP4...
FileType = MP4
FileTypeExtension = MP4
MIMEType = video/mp4
Editing tags in: QuickTime
Rewriting Movie
Rewriting UserData
Rewriting MovieHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
1 image files updated
$ exiftool -a -s -G1 -time:all MVI_1659.MP4
[System] FileModifyDate : 2015:06:14 13:25:12-04:00
[System] FileAccessDate : 2015:06:14 13:25:20-04:00
[System] FileInodeChangeDate : 2015:06:14 13:25:12-04:00
[IFD0] ModifyDate : 2014:06:04 08:26:51
[ExifIFD] DateTimeOriginal : 2014:06:04 08:26:51
[ExifIFD] CreateDate : 2014:06:04 08:26:51
[Canon] TimeZone : +02:00
[Canon] TimeZoneCity : (not set)
[Canon] DaylightSavings : On
[GPS] GPSTimeStamp : 06:26:34
[GPS] GPSDateStamp : 2015:06:04
[QuickTime] CreateDate : 2015:06:04 06:26:51
[QuickTime] ModifyDate : 2015:06:04 06:26:51
[Track1] TrackCreateDate : 2015:06:04 06:26:51
[Track1] TrackModifyDate : 2015:06:04 06:26:51
[Track1] MediaCreateDate : 2015:06:04 06:26:51
[Track1] MediaModifyDate : 2015:06:04 06:26:51
[Track2] TrackCreateDate : 2015:06:04 06:26:51
[Track2] TrackModifyDate : 2015:06:04 06:26:51
[Track2] MediaCreateDate : 2015:06:04 06:26:51
[Track2] MediaModifyDate : 2015:06:04 06:26:51
[Composite] GPSDateTime : 2015:06:04 06:26:34Z
Attempting to set the EXIF group date/time tags
$ exiftool -v "-IFD0:ModifyDate+=1:0:0 0:0:0" ./MVI_1659.MP4
======== ./MVI_1659.MP4
Rewriting ./MVI_1659.MP4...
FileType = MP4
FileTypeExtension = MP4
MIMEType = video/mp4
Editing tags in: IFD0
Rewriting Movie
Rewriting UserData
Rewriting MovieHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Nothing changed in ./MVI_1659.MP4
0 image files updated
1 image files unchanged
$ exiftool -v "-ExifIFD:CreateDate+=1:0:0 0:0:0" ./MVI_1659.MP4
======== ./MVI_1659.MP4
Rewriting ./MVI_1659.MP4...
FileType = MP4
FileTypeExtension = MP4
MIMEType = video/mp4
Editing tags in: ExifIFD
Rewriting Movie
Rewriting UserData
Rewriting MovieHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Nothing changed in ./MVI_1659.MP4
0 image files updated
1 image files unchanged
$ exiftool -v "-ExifIFD:DateTimeOriginal+=1:0:0 0:0:0" ./MVI_1659.MP4
======== ./MVI_1659.MP4
Rewriting ./MVI_1659.MP4...
FileType = MP4
FileTypeExtension = MP4
MIMEType = video/mp4
Editing tags in: ExifIFD
Rewriting Movie
Rewriting UserData
Rewriting MovieHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Rewriting Track
Rewriting TrackHeader
Rewriting Media
Rewriting MediaHeader
Nothing changed in ./MVI_1659.MP4
0 image files updated
1 image files unchanged
Quote from: ksamborn on June 14, 2015, 01:48:55 PM
Can you use Exiftool to write EXIF group tags in an MP4 file?
In general, no. But there are a few exceptions. The write ability in MP4 videos is very limited.
QuoteI am able to use Exiftool to adjust all of the dates/times on the images, but having some trouble with the [Canon] videos.
Yes. ExifTool won't write EXIF in Canon MP4 videos. Sorry. The video formats are a real hairball, and ExifTool only has cursory support for writing them.
- Phil
Edit: Fixed typo
Hi Phil - Thanks for your quick response! Much appreciated.
I guess I have to ask - is there any alternative out there in any way? Is the Canon format spec published anywhere?
Thanks,
Kevin
Hi Kevin,
The EXIF information is actually stored in the embedded thumbnail image. So if you can rewrite the thumbnail, you can change this information. However, the thumbnail is stored in a non-standard Canon-specific location, and I'm not aware of anything that will write this.
- Phil
Thanks, Phil. Very clear - i'll take a look.
Kevin
I'm having the same problem and was wondering if the limitations also apply to videos by Panasonic cameras.
The date seems to be within the EXIF section of the PanasonicPANA tag (https://www.exiftool.org/TagNames/Panasonic.html#PANA):
exiftool -exif:time:*date* -a -s -G0:1:5 video.mp4
[EXIF:IFD0:MOV-Movie-UserData-PanasonicPANA-EXIF-IFD0] ModifyDate: 2018:12:16 01:29:26
[EXIF:ExifIFD:MOV-Movie-UserData-PanasonicPANA-EXIF-IFD0-ExifIFD] DateTimeOriginal: 2018:12:16 01:29:26
[EXIF:ExifIFD:MOV-Movie-UserData-PanasonicPANA-EXIF-IFD0-ExifIFD] CreateDate: 2018:12:16 01:29:26
Any ideas on how to modify this data?
ExifTool won't do this for you, but you could do a straight string replacement if the date/time is stored as a string. I can't check this right now, but you can use the -v3 option to see how/where this information is stored in the file.
- Phil