immich-app / immich

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

Video not playing ( App & mobile browser) #13825

Open Pumpedplop opened 3 weeks ago

Pumpedplop commented 3 weeks ago

The bug

Video's dont play when using the app or vieuwing with a mobile browser. In the app the video doesn't load any frames (blank screen). In a mobile browser the first few frames are shown and then it freezes. ( Even when toggeling my browser to emulate desktop)

The OS that Immich Server is running on

Ubuntu 22.04.5

Version of Immich Server

V1.119.1

Version of Immich Mobile App

1.118.0 buikd.163

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

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  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
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command:
      [
        'postgres',
        '-c',
        'shared_preload_libraries=vectors.so',
        '-c',
        'search_path="$$user", public, vectors',
        '-c',
        'logging_collector=on',
        '-c',
        'max_wal_size=2GB',
        '-c',
        'shared_buffers=512MB',
        '-c',
        'wal_compression=on',
      ]
    restart: always

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=./library
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# 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
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=MTRkMGQ0ZD

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

IMMICH_IGNORE_MOUNT_CHECK_ERRORS=true

Reproduction steps

  1. Sync DJI videos with immich through app
  2. Video only plays on pc. Not in app or Mobile browser
  3. ...

Relevant log output

No response

Additional information

PC and mobile devices are both connected to the same internal network. Immich is reached through local DNS => NGINX ( with websocket enabled) => Immich VM ( running in truenas core TrueNAS-13.0-U6)

mmomjian commented 3 weeks ago

Please connect directly to http://immich_ip:2283 and test again

Pumpedplop commented 3 weeks ago

When trying to connect directly to the IP it still freezes. After couple of frames. Just noticed I saw it wrong and it also doesnt work on PC

alextran1502 commented 3 weeks ago

Can you include a sample video as well as your transcoding settings?

Pumpedplop commented 3 weeks ago

Transcoding settings: CRF: 23 Preset: ultrafast Video codec: h264 Accepted video codecs: H.264 Accepted audio codecs: AAC,MP3,Opus,PCM (16bit) Accepted containers: MOV, Ogg, WebM Target resolution: 720p Maximum bitrate: 0 Threads: 0 Transcode policy: Only videos not in accepted format Tone-mapping: Habla Acceleration API: Disabled Tone mapping NPL: 0 Maximum B-frames: -1 Reference frames: 0 Maximum keyframe interval: 0

https://fotos.pajotten.duckdns.org/share/t3vHVpM2Ivy5UW-fhwp0TlRTxyRZzlBIO2keoZoURGQun6tu6AApahxgk0BuCEUvuQ0

With re transcoding all videos it appears to be fixed on PC but it is still broken on the APP. ( Even when playing from the server (so no local file))

saumil-sh commented 3 weeks ago

I experience almost similar symptoms!

The bug

Videos will not play on the Android app. I can play them on a web browser via phone or a PC.

The OS that Immich Server is running on

Debian GNU/Linux 12 (bookworm) Raspberry Pi OS

Immich server version

v1.119.1

Immich mobile app version

1.119.0 build.164

Platform with the issue

docker-compose.yml ```yml x-bb-common: &common networks: - internal restart: unless-stopped deploy: resources: limits: cpus: "2" memory: "3G" restart_policy: condition: any delay: 20s window: 60s networks: internal: external: false driver: bridge services: # ... # --- Immich for photo and video management 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 # - "./gosia:/import" env_file: - .env ports: - "2283:2283" depends_on: - immich-redis - immich-db - pihole <<: *common immich-ML: container_name: immich_ML image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} depends_on: - pihole volumes: - ./immich/ML-cache:/cache env_file: - .env <<: *common immich-redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5 depends_on: - pihole healthcheck: test: redis-cli ping || exit 1 <<: *common immich-db: container_name: immich_postgres image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 depends_on: - pihole env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: # - ${DB_DATA_LOCATION}:/alt - ${DB_DATA_LOCATION}:/var/lib/postgresql/data healthcheck: test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1 interval: 5m start_interval: 30s start_period: 5m command: [ 'postgres', '-c', 'shared_preload_libraries=vectors.so', '-c', 'search_path="$$user", public, vectors', '-c', 'logging_collector=on', '-c', 'max_wal_size=2GB', '-c', 'shared_buffers=512MB', '-c', 'wal_compression=on', ] <<: *common # ... ```
.env ```sh # --- Immich # 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/immich # The location where your database files are stored DB_DATA_LOCATION=./immich/pgdata # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC # 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=REDACTED # The values below this line do not need to be changed ################################################################################### REDIS_HOSTNAME=immich_redis DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich ```
Logs ```sh immich_server | [Nest] 2 - 10/31/2024, 10:14:53 PM ERROR [Microservices:JobService] Unable to run job handler (videoConversion/video-conversion): Error: ffprobe exited with code 1 immich_server | ffprobe version 7.0.2-Jellyfin Copyright (c) 2007-2024 the FFmpeg developers immich_server | built with gcc 12 (Debian 12.2.0-14) immich_server | configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=arm64 --cross-prefix=/usr/bin/aarch64-linux-gnu- --toolchain=hardened --enable-cross-compile --enable-rkmpp --enable-rkrga immich_server | libavutil 59. 8.100 / 59. 8.100 immich_server | libavcodec 61. 3.100 / 61. 3.100 immich_server | libavformat 61. 1.100 / 61. 1.100 immich_server | libavdevice 61. 1.100 / 61. 1.100 immich_server | libavfilter 10. 1.100 / 10. 1.100 immich_server | libswscale 8. 1.100 / 8. 1.100 immich_server | libswresample 5. 1.100 / 5. 1.100 immich_server | libpostproc 58. 1.100 / 58. 1.100 immich_server | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3bcae150180] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible! immich_server | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3bcae150180] moov atom not found immich_server | upload/library/fd4f9682-4583-4591-8f0d-2fad51df9fe8/2023/Aug/e9ea7476-122e-440d-8f23-6676e35a2f2e.mp4: Invalid data found when processing input immich_server | immich_server | [Nest] 2 - 10/31/2024, 10:14:53 PM ERROR [Microservices:JobService] Error: ffprobe exited with code 1 immich_server | ffprobe version 7.0.2-Jellyfin Copyright (c) 2007-2024 the FFmpeg developers immich_server | built with gcc 12 (Debian 12.2.0-14) immich_server | configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=arm64 --cross-prefix=/usr/bin/aarch64-linux-gnu- --toolchain=hardened --enable-cross-compile --enable-rkmpp --enable-rkrga immich_server | libavutil 59. 8.100 / 59. 8.100 immich_server | libavcodec 61. 3.100 / 61. 3.100 immich_server | libavformat 61. 1.100 / 61. 1.100 immich_server | libavdevice 61. 1.100 / 61. 1.100 immich_server | libavfilter 10. 1.100 / 10. 1.100 immich_server | libswscale 8. 1.100 / 8. 1.100 immich_server | libswresample 5. 1.100 / 5. 1.100 immich_server | libpostproc 58. 1.100 / 58. 1.100 immich_server | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3bcae150180] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible! immich_server | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3bcae150180] moov atom not found immich_server | upload/library/fd4f9682-4583-4591-8f0d-2fad51df9fe8/2023/Aug/e9ea7476-122e-440d-8f23-6676e35a2f2e.mp4: Invalid data found when processing input immich_server | immich_server | at ChildProcess. (/usr/src/app/node_modules/fluent-ffmpeg/lib/ffprobe.js:233:22) immich_server | at ChildProcess.emit (node:events:519:28) immich_server | at ChildProcess._handle.onexit (node:internal/child_process:294:12) immich_server | [Nest] 2 - 10/31/2024, 10:14:53 PM ERROR [Microservices:JobService] Object: immich_server | { immich_server | "id": "f0ba2b44-fb79-4e63-9959-ea999f61fff5" immich_server | } ```
Version info ![immich bb_admin_jobs-status](https://github.com/user-attachments/assets/5426977c-85f8-4a98-882f-0720bb428eaa)
Transcode settings ![immich bb_admin_system-settings_isOpen=video-transcoding](https://github.com/user-attachments/assets/c6937463-858c-4ae3-af9f-7fb4179419f6)
lukaszwawrzyk commented 2 weeks ago

I have similar problems. On mobile, I can't play videos of my partner, but I can play my local videos. It is all fine on web.

Pumpedplop commented 2 weeks ago

Just some more info / ideas. I think it might be because it's a video without any sound. ( Because drone footage).

alextran1502 commented 2 weeks ago

There was a recent fix about video codec. You guys will need to retranscode them to apply the fix

lukaszwawrzyk commented 2 weeks ago

@alextran1502 Thanks! It fixed it for me. It is great that I can retranscode just selected video to see if the fix would work. I guess that you are thinking about this fix: fix(server): encodes iPhone 16 Pro video with unknown audio codec. I was reading the release notes when this appeared, but I ignored it and forgot about it, because latest iphone that uses my immich instance is 13, yet it seems to be affected too.