immich-app / immich

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

Motion photos do not work on Android, but they do work on web #9790

Closed andrej-zirko closed 3 weeks ago

andrej-zirko commented 4 months ago

The bug

Motion photos have no thumbnail on Android. Instead they are showing exclamation mark. When I open them, they are handled as videos. The video is even stutterring.

The same motion photos are working as expected on the web version.

The OS that Immich Server is running on

Docker on Synology

Version of Immich Server

v1.105.1

Version of Immich Mobile App

v1.105.0

Platform with the issue

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

networks:
  cloudflare:
    external: true
  immich:
    driver: bridge

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ['start.sh', 'immich']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always
    networks:
      - cloudflare
      - immich

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    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
    command: ['start.sh', 'microservices']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always
    networks:
      - immich

  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}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # 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
    networks:
      - immich

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672
    restart: always
    networks:
      - immich

  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:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    restart: always
    networks:
      - immich

volumes:
  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=/volume1/playgroundDoNotBackup/immich/library
# The location where your database files are stored
DB_DATA_LOCATION=/volume1/playgroundDoNotBackup/immich/postgres

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

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

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

The motion photos were taken by a Samsung device. I did google takeout. Then it was imported via immich-go.

Relevant log output

Exception: HttpException: Invalid statusCode: 404, uri = https://xxxx/api/asset/thumbnail/b567f107-271c-4b3d-8dac-71897eafb057?format=WEBP
Library: image resource service
Context: resolving an image codec

Additional information

No response

aviv926 commented 4 months ago

Without providing a sample file it will be difficult to handle this problem. Consider adding a file to the demo inside a zip (to keep the metadata values) and upload it here.

robserverbase commented 4 months ago

I experienced the same bug on iOS. The playback of motion pictures fails. No moving frame or audio is playing back. The pictures are stored in the .heic format and uploaded via the immich iOS app. Also, the photos are stored on the phone as well. I also tested some older photos I've taken with my Samsung phone (also .heic) and there I can play back the motion photo. These pictures are just stored in the immich server (v.105.1). Playback via the web app works fine. I also test the app connection via www and IP address.

I checked the logs in the app and these are the only results while trying to play back the iPhone picture:

2024-05-28 19:36:24.898550 | FINE | socket_io_client:engine.Socket | socket receive: type "message", data "2["on_new_release",{"isAvailable":0,"checkedAt":"2024-05-28T18:36:12.787+02:00","serverVersion":{"major":1,"minor":105,"patch":1},"releaseVersion":{"major":1,"minor":105,"patch":1}}]" | 2024-05-28 19:36:24.898383 | FINE | socket_io_client:engine.Socket | socket receive: type "message", data "2["on_server_version",{"major":1,"minor":105,"patch":1}]" | 2024-05-28 19:36:24.898054 | FINE | socket_io_client:engine.Socket | socket receive: type "message", data "0{"sid":"8cmprabbC1EouRK9AACp"}" | 2024-05-28 19:36:24.476704 | FINE | socket_io_client:engine.Socket | flushing 1 packets in socket | 2024-05-28 19:36:24.476691 | FINE | socket_io:parser.Encoder | encoded {type: 0, data: null, nsp: /} as 0 | 2024-05-28 19:36:24.476678 | FINE | socket_io:parser.Encoder | encoding packet {type: 0, data: null, nsp: /} | 2024-05-28 19:36:24.476658 | FINE | socket_io_client:Manager | writing packet {type: 0, data: null, nsp: /} | 2024-05-28 19:36:24.476630 | FINE | socket_io_client:Socket | transport is open - connecting | 2024-05-28 19:36:24.476612 | FINE | socket_io_client:Manager | cleanup | 2024-05-28 19:36:24.476594 | FINE | socket_io_client:Manager | open | 2024-05-28 19:36:24.476579 | FINE | socket_io_client:engine.Socket | socket open | 2024-05-28 19:36:24.476495 | FINE | socket_io_client:engine.Socket | socket receive: type "open", data "{"sid":"i-huTw1R5fb3QH-ZAACo","upgrades":[],"pingInterval":25000,"pingTimeout":20000,"maxPayload":1000000}" |

andrej-zirko commented 4 months ago

I have isolated the problem further. The issue occurs only when using immich-go with Google Takeout. The web version of immich displays the motion photo properly. The Android version DOES display the motion photo, but it also adds a video for that motion photo with a non-existent thumbnail. I will open an issue with immich-go as well. I'm not sure who owns the issue, whether it's immich Android or immich-go. I'm attaching a sample Google Takeout file that is causing the issue.

takeout-20240529T131543Z-001.zip

jrasm91 commented 3 weeks ago

Upstream issue has been resolved.