• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Edit capture time via SDK

Community Beginner ,
Nov 02, 2018 Nov 02, 2018

Copy link to clipboard

Copied

I'd like to reproduce the behavior of Metadata -> Edit Capture Time in a script. Is it possible to do so?

(I know I can use ExifTool and refresh the file's metadata. But I'm specifically interested in setting the "Date Time Original" of a video, and that can't be controlled by the video file's metadata—it seems to be a property that is only tracked internally by Lightroom, and only possible to set via "Edit Capture Time".)

TOPICS
SDK

Views

592

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Nov 16, 2018 Nov 16, 2018

Thanks for the helpful background.

So the short answer is "no". The "Date Time Original" metadata tag is read-only for the SDK.

Investigating the use of IPTC Date Created a little more:

  • The standard behavior is for newly-imported videos to have neither a "Date Time Original" nor a (IPTC) "Date Created". The "Capture Date" and the <sort date> at this point is the "Date Time Digitized". (Using <sort date> to refer to the observed sorting behavior of the video, which may not correspond to any viewable
...

Votes

Translate

Translate
LEGEND ,
Nov 02, 2018 Nov 02, 2018

Copy link to clipboard

Copied

LR does read the metadata initially from a video when its imported to read the capture time, though that's buggy for some video formats. When it can't read the capture time, it uses the file system's last-modified or created date maintained by the operating systems of the camera and the computer (LR has changed which one it uses over the years, and I can never remember).   But that's buggy too.

Unfortunately, ExifTool / metadata refresh doesn't work with video because LR doesn't implement photo:readMetadata() for videos:

Adobe did a rushed, sloppy job of implementing video in LR 3 and 4, never finishing the missing features and leaving many bugs.

Doubly unfortunately, the SDK doesn't allow you to do photo:setRawMetadata ("dateTimeOriginal").

However, on a lark just now, I retested photo:setRawMetadata ("dateCreated"), which sets the IPTC Date Created field. In past versions, editing the IPTC Date Created field (either in the user interface or via the SDK) would correctly set that field, but LR's internal notion of capture date/time would not change (e.g. the date/time showed under thumbnails in Library grid view or in the Metadata Default view).

But in LR 8, it seems to work.  I haven't tested it thoroughly yet -- it may still trigger existing various inconsistencies (bugs) in capture date that have long been preset and Adobe hasn't been able to fix.  If setting IPTC Date Created does work consistently, that would be a major convenience for many plugins that set capture date/time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 16, 2018 Nov 16, 2018

Copy link to clipboard

Copied

Thanks for the helpful background.

So the short answer is "no". The "Date Time Original" metadata tag is read-only for the SDK.

Investigating the use of IPTC Date Created a little more:

  • The standard behavior is for newly-imported videos to have neither a "Date Time Original" nor a (IPTC) "Date Created". The "Capture Date" and the <sort date> at this point is the "Date Time Digitized". (Using <sort date> to refer to the observed sorting behavior of the video, which may not correspond to any viewable metadata field.)
  • If, at this point, "Date Created" is set (either manually or via the SDK), this updates the "Capture Date", though it has no effect on <sort date>.
  • At some point, I can do a "Edit Capture Time" with a shift of 0 hours. This has the effect of copying the "Capture Date" (I think) into the "Date Time Original" field. It also updates <sort date>.
  • Once the video has a "Date Time Original", subsequent changes to "Date Created" are ignored by "Capture Date" and <sort date>.

There are some useful tools here for special-purpose use cases, but nothing good enough for a general-purpose workaround.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 17, 2018 Nov 17, 2018

Copy link to clipboard

Copied

LATEST
  • If, at this point, "Date Created" is set (either manually or via the SDK), this updates the "Capture Date", though it has no effect on <sort date>.
  • At some point, I can do a "Edit Capture Time" with a shift of 0 hours. This has the effect of copying the "Capture Date" (I think) into the "Date Time Original" field. It also updates <sort date>.
  • Once the video has a "Date Time Original", subsequent changes to "Date Created" are ignored by "Capture Date" and <sort date>.

Shoot, so doing photo:setRawMetadata ("dateCreated") still creates an internal inconsistency: Lightroom: Still inconsistent capture date/time for photos and videos | Photoshop Family Customer Co... . And thus, plugins can't use it for changing the capture date/time. :-<

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines