Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Live Photo #16401

Open
1 of 3 tasks
mentex23 opened this issue Feb 27, 2025 · 12 comments
Open
1 of 3 tasks

iOS Live Photo #16401

mentex23 opened this issue Feb 27, 2025 · 12 comments

Comments

@mentex23
Copy link

mentex23 commented Feb 27, 2025

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
  • 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 mentex23 changed the title iOS Live Phote iOS Live Photo Feb 27, 2025
@bo0tzz
Copy link
Member

bo0tzz commented Feb 27, 2025

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

@mentex23
Copy link
Author

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
Copy link
Author

iOS Version 18.3.1

@alextran1502
Copy link
Contributor

Are these files coming from external library as separate files?

@mentex23
Copy link
Author

yes correct..

@jrondo
Copy link

jrondo commented Feb 28, 2025

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

@Salvoxia
Copy link

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.

@mentex23
Copy link
Author

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

@RobWW
Copy link

RobWW commented Feb 28, 2025

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?

@Salvoxia
Copy link

@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.

@thorsten-hehn
Copy link

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.

@RobWW
Copy link

RobWW commented Mar 1, 2025

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants