immich icon indicating copy to clipboard operation
immich copied to clipboard

iOS Live Photo

Open mentex23 opened this issue 8 months ago • 12 comments
trafficstars

The bug

Live Photos in iOS App not showing correctly. There are 2 files shown, one with an image and the other one is black with a "!" in it. On Safari and other web browsers live photo is shown correctly.

The OS that Immich Server is running on

Docker, Ubuntu 22.10

Version of Immich Server

v1.127.0

Version of Immich Mobile App

v.1.127.0

Platform with the issue

  • [ ] Server
  • [ ] Web
  • [x] Mobile

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH}:/usr/src/app/external/:ro
      - ${EXTERNAL_PATH_...}:/usr/src/app/external/:ro
    env_file:
      - .env
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
       file: hwaccel.transcoding.yml
       service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    ports:
      - 2283:2283
    security_opt:
      - "label=disable"
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
#    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
#       file: hwaccel.ml.yml
#       service: openvino # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH}:/usr/src/app/external/:ro
      - ${EXTERNAL_PATH_....}:/usr/src/app/external/:ro
    env_file:
      - .env
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
       file: hwaccel.transcoding.yml
       service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    ports:
      - 2283:2283
    security_opt:
      - "label=disable"
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
#    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
#       file: hwaccel.ml.yml
#       service: openvino # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

  immich-folder-album-creator:
    container_name: immich_folder_album_creator
    image: salvoxia/immich-folder-album-creator:latest
    restart: unless-stopped
    environment:
      API_URL: http://192.168.1.5:2283/api
      API_KEY: j3qIV2W9ZjdQGYYl5sVHZrXx1oWcNw3NbilbaBmLzI
      ROOT_PATH: /usr/src/app/external/
      CRON_EXPRESSION: "*/5 * * * *"
      TZ: Europe/Berlin
      ALBUM_LEVELS: 10
      ALBUM_SEPARATOR: " - "

  immich-folder-album-creator_f:
    container_name: immich_folder_album_creator_f
    image: salvoxia/immich-folder-album-creator:latest
    restart: unless-stopped
    environment:
      API_URL: http://192.168.1.5:2283/api
      API_KEY: WSMecMt7itoDCYQAADKQcWQjJ2xhwBqRmgNZ48R0
      ROOT_PATH: /usr/src/app/external/
      CRON_EXPRESSION: "*/5 * * * *"
      TZ: Europe/Berlin
      ALBUM_LEVELS: 10
      ALBUM_SEPARATOR: " - "

volumes:
  pgdata:
  model-cache:
    restart: always

  immich-folder-album-creator:
    container_name: immich_folder_album_creator
    image: salvoxia/immich-folder-album-creator:latest
    restart: unless-stopped
    environment:
      API_URL: http://192.168.1.5:2283/api
      API_KEY: j3qIV2W9ZjdQGYYl5sVHZrXx1oWcNw3NbilbaBmLzI
      ROOT_PATH: /usr/src/app/external/
      CRON_EXPRESSION: "*/5 * * * *"
      TZ: Europe/Berlin
      ALBUM_LEVELS: 10
      ALBUM_SEPARATOR: " - "

  immich-folder-album-creator_f:
    container_name: immich_folder_album_creator_f
    image: salvoxia/immich-folder-album-creator:latest
    restart: unless-stopped
    environment:
      API_URL: http://192.168.1.5:2283/api
      API_KEY: WSMecMt7itoDCYQAADKQcWQjJ2xhwBqRmgNZ48R0
      ROOT_PATH: /usr/src/app/external/
      CRON_EXPRESSION: "*/5 * * * *"
      TZ: Europe/Berlin
      ALBUM_LEVELS: 10
      ALBUM_SEPARATOR: " - "

volumes:
  pgdata:
  model-cache:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/.../Photos/immich-lib

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=...

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=...
DB_DATABASE_NAME=..

REDIS_HOSTNAME=immich_redis
EXTERNAL_PATH=/mnt/.../Photos/Bilder
EXTERNAL_PATH_...=/mnt/../Bilder
MACHINE_LEARNING_WORKER_TIMEOUT=600

Reproduction steps

...

Relevant log output


Additional information

No response

mentex23 avatar Feb 27 '25 21:02 mentex23

Please provide more info. Does it display correctly on the web? Is it still broken if you log out and back in?

bo0tzz avatar Feb 27 '25 21:02 bo0tzz

sorry just updated my first post. it is shown correctly on any web browser. Logout and login did not change the problem.

it looks like this

Image

I first noticed it with 1.126.0. After that i decided to just wait the next update. but with 1.127.0 the problem still exists

mentex23 avatar Feb 27 '25 21:02 mentex23

iOS Version 18.3.1

mentex23 avatar Feb 27 '25 21:02 mentex23

Are these files coming from external library as separate files?

alextran1502 avatar Feb 27 '25 23:02 alextran1502

yes correct..

mentex23 avatar Feb 28 '25 07:02 mentex23

I have the same issue. For me the problem only shows up when I create the album structure using immich-folder-album-creator. The live photo gets separated with the same name. Snapshot saved my day

jrondo avatar Feb 28 '25 12:02 jrondo

Maintainer of said script here. I don't really see how the Folder Album Creator could cause this issue. All it does is using API calls to create albums and add assets to said albums. @jrondo Are you saying you don't have this issue when you create an album manually and add a live photo to it? Does the problem only occur when the live photo was added to an album by the script and you view the photo in the album, or also when viewing it in the timeline?

I'm not familiar with live photos at all, so I cannot rule out it has something to do with the script. If I understand correctly, live photos are a still image (HEIC) and a video component (mov or HEVC). The only thing I can think of is that a problem might occur if only one of these assets are added to the album while the other is not, but Folder Album Creator does not differentiate on a file level, only on folder level. Also, I don't know if live photos are represented as a single asset in Immich or as multiple assets.

Salvoxia avatar Feb 28 '25 19:02 Salvoxia

and how could the folder creator cause this issue if pictures in a webbrowser showing correct? the web view does use the same albums

mentex23 avatar Feb 28 '25 20:02 mentex23

I have the same problem -- but with my own script that creates albums.

I have not conclusively tracked down the problem, but have noticed that the search api returns two assets for Live Photos, an image and a video. My script in turn (naively) adds each asset separately to the album. Maybe having both parts separately added to the album is tripping up the IOS app?

RobWW avatar Feb 28 '25 21:02 RobWW

@RobWW If it works for you when manually adding a live photo to an album in the web interface, you could observe the network calls from your browser to the API to see if it does something special for live photos.

Salvoxia avatar Feb 28 '25 21:02 Salvoxia

I also have this issue, it is still persistent with the current v1.128.0. I described the behavior in this issue. I feel that it definitely must be related to the creation of albums from external libraries, but I'm afraid I'm lacking programming experience preventing me to dig deeper into the cause of the problem.

thorsten-hehn avatar Mar 01 '25 10:03 thorsten-hehn

@Salvoxia I tried your suggesting of testing in the browser:

When viewing a live photo (id': '02cb1ad1-395c-4985-a849-cc7037114df9), with the browser URL: http://192.168.1.84:2283/photos/02cb1ad1-395c-4985-a849-cc7037114df9

Selecting the 3 dots -> Add to album produced only one api call:

PUT: /api/albums/e731c42d-9e44-4026-b80c-8548cee8e7fe/assets with Request JSON: {"ids":["02cb1ad1-395c-4985-a849-cc7037114df9"]}

I did not see any call for the video part of the file.

As a quick test I removed all videos from all albums: Using the following apis calls (in pseudocode):

for each assets with type VIDEO: get all albums the asset belongs to: data = {'assetId': id} r = requests.get(apiUrl + 'api/albums', params = data, **requests_kwargs)

for each album, remove the asset: data = {'ids':[assetID]} r = requests.delete(apiUrl + 'api/albums/' + f"{albumID}" + '/assets', json=data, **requests_kwargs)

This worked, live photos no longer have duplicate icons. However, for live photos my script had originally added to albums, I had to run several jobs: rescanning the external library, updating metadata, generating thumbnails and transcoding video to get the video part of the live photos to play without the error 'No video with supported format and MIME type found". (Live photos not in albums or added to albums with the web interface always played successfully.) I am not sure why this simple change was causing so much disruption, some documentation on managing live photos would really help.

In terms of fixing the album script, I am not sure what best the solution is. The immich api easily maps from live photo images to the corresponding video (each image has a 'livePhotoVideoId' value that points to the video), but I cannot find a parameter in video files that indicate they are part of a live photo, and not just an independent video.

RobWW avatar Mar 01 '25 23:03 RobWW

Any news how to fix it?

mentex23 avatar Mar 06 '25 12:03 mentex23

in the other issue EricChen1248 mentions a possible solution "Once I updated my script to preemptively handle live photos to only add the image part to an album now everything displays as expected. On both web and mobile, only one single image shows in the gallery with all thumbnails showing, and clicking into the image, it is able to play the video as a live photo." https://github.com/immich-app/immich/issues/2665#issuecomment-2567314814

i am also seeing the same issue with the web versions showing live photos fine but ios showing the live photo and the video with a black thumbnail separately. I have also created albums with @Salvoxia 's https://github.com/Salvoxia/immich-folder-album-creator (Thank you very much for this)

/le did a test and removed in ios the .mov from the album and both the web version and the ios version still worked with showing the live photo as intended

tzapu avatar Mar 10 '25 15:03 tzapu

@tzapu Thanks for the hint! I reopened issue https://github.com/Salvoxia/immich-folder-album-creator/issues/128 on my end and added a comment. Could you and @RobWW (or anyone experiencing this issue with Folder Album Creator) please drop by there?

Salvoxia avatar Mar 10 '25 18:03 Salvoxia

whatever gets changed in immich-folder-album-creator doesn t change that there is some inconsistency on how immich itself lists/views the heic/mov combo on the web and in the ios app. for the same listing the web version looks perfect, ios app shows the video as a separate entity even if it is part of a live photo like described in this issue

tzapu avatar Mar 11 '25 07:03 tzapu

I'd like to point out that this display problem also affects the Immich Android App. There it does not seem to make any difference whether the live photo is added to an album or not, it is shown as two separate assets in the main timeline as well as in albums (if both assets are added to an album using the API). Using a browser, everything looks fine. Main Timeline on Android (App and Server v1.129.0): Image

Album created via API, images and videos added to the album:

Image

Salvoxia avatar Mar 12 '25 19:03 Salvoxia

I'm also affected by this issue but have never used Album Creator, for what it's worth. I did however have immich-go create albums out of folders I'd downloaded from Google Photos which contained live photos. Not sure if related.

See attached what my timeline looks like via the WebUI and via iOS - showing the same exclamation points others have highlighted.

Image Image

GameKing505 avatar Mar 26 '25 19:03 GameKing505

Not sure if my issue same, but in 1.130.3 live photos broken: video and image are not combined into 1 item. I don't use folder creator. In logs I see "Missing file creation or modification date for asset" for heic file and it's video.

AlexanderIlyanok avatar Mar 29 '25 15:03 AlexanderIlyanok

@AlexanderIlyanok do you know how do you upload those LivePhotos?

alextran1502 avatar Mar 29 '25 17:03 alextran1502

immich-20250329_205946.zip

@AlexanderIlyanok do you know how do you upload those LivePhotos?

Yes, its external lib. Just copied them to folder from iPhone. Attached photo with issue. It seems, Alex you have fixed such issue earlier.

AlexanderIlyanok avatar Mar 29 '25 17:03 AlexanderIlyanok

Normal Live Photos are still working for m with 1.130.3 but I always get the warning:

WARN [Microservices:MetadataService] Missing file creation or modification date for asset ....

for both, MOV and HEIC file. But at the end the date is okay in the browser and app. Exif data is also good.

What's broken for me are special live photos, which using the bounce effect for example (they are automtaically in the iOS album Animated) If I upload them via iOS Immich app (I'm refering only to uploads via app), no date can be infered and the get the current date.

I've reverted the server to 1.129.0 and the issue is gone: No warning and always correct date assignment, even for the animated live photos (with bounce effect).

The wrong date assignment doesn't happen if I upload via web. Only via iOS App (1.130.3).

timaschew avatar Mar 29 '25 18:03 timaschew

@AlexanderIlyanok your files do not match together

➜  immich-test-files exiftool alex/IMG_0688.JPG | grep Content
Content Identifier              : 377AA472-DFCB-4EC2-A8EC-356B5408C3B3
➜  immich-test-files exiftool alex/IMG_0688.MOV | grep Content
Content Identifier              : 520C1DA1-D13D-4215-AC91-CBF509762650

Content Identifier must be the same for the image and video.

timaschew avatar Mar 29 '25 18:03 timaschew

@AlexanderIlyanok your files do not match together

➜  immich-test-files exiftool alex/IMG_0688.JPG | grep Content
Content Identifier              : 377AA472-DFCB-4EC2-A8EC-356B5408C3B3
➜  immich-test-files exiftool alex/IMG_0688.MOV | grep Content
Content Identifier              : 520C1DA1-D13D-4215-AC91-CBF509762650

Content Identifier must be the same for the image and video.

File name is same, so I think both files are from 1 live photo. I downloaded them from immich, could it break this identifier some way?

AlexanderIlyanok avatar Mar 29 '25 18:03 AlexanderIlyanok

@AlexanderIlyanok file name doesn't matter. Do you still have original files on your phone? You can send them via air drop (just enable in the options to send all data) after you select the photo and before sending

timaschew avatar Mar 29 '25 18:03 timaschew

Just checked with exiftool several new files, Content Identifier is same and they imported correctly. I don't have copies of old files, so can't check their original exif. Don't understand how it could be broken. I have about 1000 files in current folder with broken Content attribute. Is any guid how to fix them in batch?

AlexanderIlyanok avatar Mar 29 '25 18:03 AlexanderIlyanok

I also have the same issue, the web seems okay whereas the iOS app shows the Live videos separately. App version 1.131.3 build.201. The images were imported using immich-cli

Fethbita avatar Apr 06 '25 09:04 Fethbita

@Fethbita can you try log out and log back in?

alextran1502 avatar Apr 06 '25 10:04 alextran1502

Still the same after logging out and back in. The timeline appears and after a second, the videos also appear.

Fethbita avatar Apr 06 '25 11:04 Fethbita

@alextran1502 I can also confirm this issue. I am using Salvoxia's immich-folder-album-creator, but had the same issue with Davidacampos' create-immich-albums-from-external-library-folders.js. There is an active discussion going on here. Did some extensive testing and found out that the problem (both in the album and in the timeline!) only occurs when creating albums by one of these scripts. It does not occur when creating albums manually.

thorsten-hehn avatar Apr 06 '25 13:04 thorsten-hehn