How can one find which requested tags are not writable?

Started by Martin B., July 16, 2024, 09:27:33 AM

Previous topic - Next topic

Martin B.

Hi,

I'm trying to change the time of an MP4 video taken in the wrong time zone. The ExifTool command I use doesn't change the file, presumably because some of the tags I'm trying to change are not writable (many QuickTime tags are not writable). Other than trial and error, cross-checking my command-line options with the documentation, or carefully interpreting the output generated with the -v3 option, is there an ExifTool option that will tell me which of the tags I specified on the command line are/aren't writable?

Here's what I'm trying to do:
exiftool -P -canon:timezone=+1:00 -canon:timezonecity=Paris "-exif:offsettime*=+2:00" "-exif:*datetimeoriginal*+=6" "-exif:*modifydate*+=6" MVI_0219.MP4
    0 image files updated
    1 image files unchanged

I get more output with the -v3 option, but nothing that clearly indicates why the file isn't updated:
exiftool -v3 -P -canon:timezone=+1:00 -canon:timezonecity=Paris "-exif:offsettime*=+2:00" "-exif:*datetimeoriginal*+=6" "-exif:*modifydate*+=6" MVI_0219.MP4
Writing Canon:TimeZone if tag exists
Writing Canon:TimeZoneCity if tag exists
Writing ExifIFD:OffsetTime
Writing ExifIFD:OffsetTimeDigitized
Writing ExifIFD:OffsetTimeOriginal
Shifting ExifIFD:DateTimeOriginal if tag exists
Shifting IFD0:ModifyDate if tag exists
======== MVI_0219.MP4
Rewriting MVI_0219.MP4...
  FileType = MP4
  FileTypeExtension = MP4
  MIMEType = video/mp4
  Editing tags in: ExifIFD IFD0 MakerNotes
  Creating tags in: ExifIFD
  Rewriting Movie
  Rewriting UUID-Canon
  Rewriting CanonCNTH
    [nothing changed in CanonCNTH]
    [nothing changed in UUID-Canon]
  Rewriting UserData
    [nothing changed in UserData]
  Rewriting MovieHeader
    [nothing changed in MovieHeader]
  Rewriting Track
  Rewriting TrackHeader
    [nothing changed in TrackHeader]
  Rewriting Media
  Rewriting MediaHeader
    [nothing changed in MediaHeader]
  Rewriting MediaInfo
  Rewriting DataInfo
  Rewriting DataRef
    [nothing changed in DataRef]
    [nothing changed in DataInfo]
  Rewriting SampleTable
    [nothing changed in SampleTable]
    [nothing changed in MediaInfo]
    [nothing changed in Media]
    [nothing changed in Track]
  Rewriting Track
  Rewriting TrackHeader
    [nothing changed in TrackHeader]
  Rewriting Media
  Rewriting MediaHeader
    [nothing changed in MediaHeader]
  Rewriting MediaInfo
  Rewriting DataInfo
  Rewriting DataRef
    [nothing changed in DataRef]
    [nothing changed in DataInfo]
  Rewriting SampleTable
    [nothing changed in SampleTable]
    [nothing changed in MediaInfo]
    [nothing changed in Media]
    [nothing changed in Track]
    [nothing changed in Movie]
Nothing changed in MVI_0219.MP4
    0 image files updated
    1 image files unchanged

I can find which time tags exist in the file with this:
exiftool -time:all -G1 -a -s MVI_0219.MP4
[System]        FileModifyDate                  : 2024:06:30 11:18:50-04:00
[System]        FileAccessDate                  : 2024:07:16 09:12:30-04:00
[System]        FileCreateDate                  : 2024:07:15 20:55:23-04:00
[IFD0]          ModifyDate                      : 2024:06:30 11:18:20
[ExifIFD]       DateTimeOriginal                : 2024:06:30 11:18:20
[ExifIFD]       CreateDate                      : 2024:06:30 11:18:20
[ExifIFD]       OffsetTime                      : -04:00
[ExifIFD]       OffsetTimeOriginal              : -04:00
[ExifIFD]       OffsetTimeDigitized             : -04:00
[Canon]         TimeZone                        : -04:00
[Canon]         TimeZoneCity                    : New York
[Canon]         DaylightSavings                 : On
[ExifIFD]       SubSecTime                      : 05
[ExifIFD]       SubSecTimeOriginal              : 05
[ExifIFD]       SubSecTimeDigitized             : 05
[QuickTime]     CreateDate                      : 2024:06:30 15:18:20
[QuickTime]     ModifyDate                      : 2024:06:30 15:18:20
[Track1]        TrackCreateDate                 : 2024:06:30 15:18:20
[Track1]        TrackModifyDate                 : 2024:06:30 15:18:20
[Track1]        MediaCreateDate                 : 2024:06:30 15:18:20
[Track1]        MediaModifyDate                 : 2024:06:30 15:18:20
[Track2]        TrackCreateDate                 : 2024:06:30 15:18:20
[Track2]        TrackModifyDate                 : 2024:06:30 15:18:20
[Track2]        MediaCreateDate                 : 2024:06:30 15:18:20
[Track2]        MediaModifyDate                 : 2024:06:30 15:18:20
[Composite]     SubSecCreateDate                : 2024:06:30 11:18:20.05-04:00
[Composite]     SubSecDateTimeOriginal          : 2024:06:30 11:18:20.05-04:00
[Composite]     SubSecModifyDate                : 2024:06:30 11:18:20.05-04:00

I'd like to find the subset of the above tags that are writable. So I tried this, which lists all writable time tags (and not just the ones I'm interested in), and seemingly all tags and their values):
exiftool -listw -time:all -G1 -a -s MVI_0219.MP4
Writable time tags:
  ArtworkCircaDateCreated ArtworkDateCreated AudioModDate CameraPoseTimestamp
  CaptionsDateTimeStamps CircaDateCreated ContentCreateDate CopyrightYear
  CoverDate CreateDate CreationDate CreationTime Date DateAcquired DateCreated
  DateDisplayFormat DateIdentified DateRecieved DateSent DateTime
  DateTimeDigitized DateTimeOriginal DateTimeUTC DayOfWeek DaylightSavings
  DeprecatedOn DerivedFromLastModifyDate DestinationCity DestinationDST
  DigitalCreationDate DigitalCreationTime EarthPosTimestamp EmbargoDate
  EncodingTime EventDate EventDay EventEarliestDate EventEndDayOfYear
  EventLatestDate EventMonth EventStartDayOfYear EventTime
  EventVerbatimEventDate EventYear ExclusivityEndDate ExpirationDate
  ExpirationTime FileCreateDate FileModifyDate FirstPhotoDate
  FirstPublicationDate GPSDateStamp GPSDateTime GPSTimeStamp HistoryWhen
  HometownCity HometownDST HumanObservationDay HumanObservationEarliestDate
  HumanObservationEndDayOfYear HumanObservationEventDate
  HumanObservationEventTime HumanObservationLatestDate HumanObservationMonth
  HumanObservationStartDayOfYear HumanObservationVerbatimEventDate
  HumanObservationYear IPTCLastEdited ImageProcessingFileDateCreated
  IngredientsLastModifyDate KillDateDate LastPhotoDate LicenseEndDate
  LicenseStartDate LicenseTransactionDate LocationDate MDItemFSCreationDate
  MachineObservationDay MachineObservationEarliestDate
  MachineObservationEndDayOfYear MachineObservationEventDate
  MachineObservationEventTime MachineObservationLatestDate
  MachineObservationMonth MachineObservationStartDayOfYear
  MachineObservationVerbatimEventDate MachineObservationYear
  ManagedFromLastModifyDate ManifestReferenceLastModifyDate ManufactureDate
  ManufactureDate1 ManufactureDate2 MeasurementDeterminedDate MediaCreateDate
  MediaModifyDate MetadataDate MetadataLastEdited MetadataModDate MinoltaDate
  MinoltaTime ModDate ModificationDate ModifyDate MonthDayCreated MoonPhase
  OffSaleDateDate OffsetTime OffsetTimeDigitized OffsetTimeOriginal
  OnSaleDateDate OptionEndDate OriginalCreateDateTime PanasonicDateTime
  PatientBirthDate PlanePoseTimestamp PoseTimestamp PowerUpTime PreviewDate
  PreviewDateTime ProductionDate PublicationDateDate PublicationDisplayDateDate
  PublicationEventDate ReferenceDate RegionInfoDateRegionsValid
  RelationshipEstablishedDate ReleaseDate ReleaseTime RenditionOfLastModifyDate
  RicohDate SeriesDateTime ShotDate SonyDateTime SonyDateTime2 StudyDateTime
  SubSecCreateDate SubSecDateTimeOriginal SubSecModifyDate SubSecTime
  SubSecTimeDigitized SubSecTimeOriginal TemporalCoverageFrom
  TemporalCoverageTo Time TimeCreated TimeSent TimeStamp TimeStamp1 TimeZone
  TimeZoneCity TimeZoneCode TimeZoneInfo TrackCreateDate TrackModifyDate
  UnknownDate VersionCreateDate VersionModifyDate VersionsEventWhen
  VersionsModifyDate VideoModDate WorldTimeLocation Year YearCreated
[ExifTool]      ExifToolVersion                 : 12.76
[System]        FileName                        : MVI_0219.MP4
[System]        Directory                       : .
[System]        FileSize                        : 116 MB
[System]        FileModifyDate                  : 2024:06:30 11:18:50-04:00
[System]        FileAccessDate                  : 2024:07:16 09:11:04-04:00
[System]        FileCreateDate                  : 2024:07:15 20:55:23-04:00
[System]        FilePermissions                 : -rw-rw-rw-
[File]          FileType                        : MP4
[File]          FileTypeExtension               : mp4
[File]          MIMEType                        : video/mp4
[File]          ExifByteOrder                   : Little-endian (Intel, II)
[File]          ImageWidth                      : 160
[File]          ImageHeight                     : 120
[several lines of non-time related tags edited out]

By the way, I know I can change some tags, such as this one:
exiftool -quicktime:createdate+=6 MVI_0219.MP4
    1 image files updated
Thanks!

-Martin

Phil Harvey

Hi Martin,

This is a very complex issue, but the reason these particular EXIF tags aren't being updated in the video is likely because they exist within a thumbnail image in the file.  ExifTool extracts thumbnail metadata, but can't currently write these tags individually.  However, if you extract the thumbnail then you can edit these tags then write the thumbnail back again.

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

Martin B.

Hi Phil,

From what I read later in other posts in this forum, I think you are right. And I understand it's because some manufacturers put EXIF data in video files, which isn't standard. See EXIF tags unchanged in mp4 files.

However, my general question still stands: is there an ExifTool option that will tell me which of the tags I specified on the command line are/aren't writable?

It feels like this information could be extracted automatically, but I cannot find how. For instance:
exiftool -v2 -canon:TimeZoneCity=Paris MVI_0219.MP4
Writing Canon:TimeZoneCity if tag exists
======== MVI_0219.MP4
Rewriting MVI_0219.MP4...
  FileType = MP4
  FileTypeExtension = MP4
  MIMEType = video/mp4
  Editing tags in: MakerNotes
  Creating tags in:
  Rewriting Movie
  Rewriting UUID-Canon
  Rewriting CanonCNTH
  Rewriting UserData
  Rewriting MovieHeader
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
  Rewriting MediaInfo
  Rewriting DataInfo
  Rewriting DataRef
  Rewriting SampleTable
  Rewriting Track
  Rewriting TrackHeader
  Rewriting Media
  Rewriting MediaHeader
  Rewriting MediaInfo
  Rewriting DataInfo
  Rewriting DataRef
  Rewriting SampleTable
Nothing changed in MVI_0219.MP4
    0 image files updated
    1 image files unchanged
From the output, I can guess that Canon:TimeZoneCity cannot be written because there's no message to that effect, but it's not straightforward, especially if I specify multiple tags on the command line.

By the way, the message Writing Canon:TimeZoneCity if tag exists is misleading because this tag does exist, but cannot be written, as shown here:
exiftool -canon:TimeZoneCity MVI_0219.MP4
Time Zone City                  : New York
Thanks,

-Martin

Phil Harvey

Hi Martin,

Quote from: Martin B. on July 16, 2024, 10:06:05 PMis there an ExifTool option that will tell me which of the tags I specified on the command line are/aren't writable?

Absolutely not.  There is no way to determine this without processing the entire file first.

Quotethe message Writing Canon:TimeZoneCity if tag exists is misleading because this tag does exist, but cannot be written

Notice that this message is sent before ExifTool starts processing the file.  At this time, it is the best that ExifTool can do.

If you want to know which tags can't be written, parse the -v2 output to see which tags were written, and you can surmise that the rest weren't.  This would be the only way that ExifTool would be able to do it.

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

Martin B.

I understand, thanks.

I thought ExifTool had a list of tags to write, and checked off those that were done. Given that some tags may exist in multiple places, it may not be practical to keep track of what's written or not. I'll look at the -v2 output then.

- Martin