immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
44.87k stars 2.17k forks source link

[Bug] Use iOS LivePhoto image timezone offset for movie file #4375

Open jrasm91 opened 11 months ago

jrasm91 commented 11 months ago

Discussed in https://github.com/immich-app/immich/discussions/4373

Originally posted by **dpantel** October 6, 2023 ### The feature My understanding is that there is a limitation for MOV files, that they don't have the correct timezone offset for the create-date. (I guess that is why there is a TZ setting in the .env file.) However, since the MOV file is part of the iOS LivePhoto, it has a correlating image file that should have all the proper exif information. Is it possible to adjust MOV file create date to match the image information on upload? This way, if the storage template uses dates and times, the two file names will match. ### Platform - [X] Server - [ ] Web - [ ] Mobile
BigCheeZ commented 11 months ago

In my testing the MOV file portion of Live Photos does have the correct timezone adjusted time, but it is in the 'Creation Date' field of the EXIF data instead of 'Create Date'.

https://github.com/ivandokov/phockup/pull/218

jrasm91 commented 11 months ago

I will have to take a look at this and get back to you.

dpantel commented 11 months ago

Looking through the exif data for some of the uploaded videos, they do have a tag that has the appropriate timezone offset.

If I get one, my vote would go to the fix using a tag with a timezone offset, if it's available, rather than pegging it to the photo's exif data. This fix would be more generic and apply to other videos, that are not part of a LivePhoto, but do have the tag set.

edit: At least for Apple, standalone videos also have this tag, not just LivePhoto video snippets.

edit2: I just realized that the times for the tags are different. It's weird, since they are actual times from a single video file. I looked at a couple of other videos, and their times are more consistent. Not sure what happened to this one.

Creation Date                  : YYYY:MM:DD 14:45:32+03:00
...
Create Date                    : YYYY:MM:DD 11:53:46
Track Create Date              : YYYY:MM:DD 11:53:46
Media Create Date              : YYYY:MM:DD 11:53:46
jrasm91 commented 9 months ago

Is this still an issue?

dpantel commented 9 months ago

Just tested with 1.88.2 and yes, it's still there.

Here is my storage template: {{y}}-{{MM}}-{{dd}}_{{HH}}-{{mm}}-{{ss}}_{{filename}}

And here is an uploaded iOS LivePhoto:

2023-11-23_08-51-52_IMG_8786.HEIC
2023-11-23_15-51-52_IMG_8786.mov

Of note, internally, Immich does link the two files together properly.

Nordlicht-13 commented 1 week ago

Mov-Files from Android also have the wrong time. File was named: 2024-09-01_-_19-07-50-000.mov (7:07:50 PM) File was created (changed): 01.09.2024 - 21:07 (09/01/2024 - 9:07 PM)