immich icon indicating copy to clipboard operation
immich copied to clipboard

Video not playing ( App & mobile browser)

Open Pumpedplop opened this issue 1 year ago • 9 comments

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

  • [ ] Server
  • [X] 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}
    # 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

...

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)

Pumpedplop avatar Oct 30 '24 12:10 Pumpedplop

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

mmomjian avatar Oct 30 '24 12:10 mmomjian

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

Pumpedplop avatar Oct 30 '24 21:10 Pumpedplop

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

alextran1502 avatar Oct 30 '24 21:10 alextran1502

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))

Pumpedplop avatar Oct 31 '24 13:10 Pumpedplop

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

  • [ ] Server

  • [ ] Web

  • [x] Mobile

docker-compose.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
# --- 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
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.<anonymous> (/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

Transcode settings

immich bb_admin_system-settings_isOpen=video-transcoding

saumil-sh avatar Oct 31 '24 23:10 saumil-sh

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.

lukaszwawrzyk avatar Nov 04 '24 21:11 lukaszwawrzyk

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

Pumpedplop avatar Nov 04 '24 21:11 Pumpedplop

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

alextran1502 avatar Nov 04 '24 21:11 alextran1502

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

lukaszwawrzyk avatar Nov 05 '24 08:11 lukaszwawrzyk

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

@alextran1502 could you please provide more info on that. what is meant with retranscode? i've got 10000 of mobile videos in immich playing fine in browser but not on TV APP. So does this imply i have to 1.) find all affected 2.) retranscode them 3.) delete original incopatible 4.) re-ingest the transcoded vids?

MRi-LE avatar Feb 19 '25 20:02 MRi-LE

@VaillantHassIo it means running the Video Transcoding job for all

alextran1502 avatar Feb 19 '25 20:02 alextran1502

@alextran1502 thx for the reply. i am fairly new. would you please point me to the subject. thx

edit: ok found it unter Settings -> Tasks

Question: I just want to transcode some of them not all, as some of them play well and i want to keep the original container/codec. Also how can i configure Transcoding Quality?

MRi-LE avatar Feb 20 '25 06:02 MRi-LE

I found this thread because I have a similar issue.

I downloaded my entire library from Google Photos, from several accounts. Afterwards, I started uploading the photos and videos into immich.

The videos play without issues on the web, but when running them from the app, iOS and Android, I observed some estrange behaviour. They also work fine if I play the videos using the phone browser. So the issues appeart to be happening only with the apps.

Some of them appear with the aspect ratio crippled, turned from 16:9 into 4:3, with the remaining of the screen showing the first frame.

Others don't play the image, only the audio is playing, they load only the first frame.

Do you think this has something to do with the issue of the video codec?

Can the transcoding fix the issue? What does it imply if I run the Video Transcoding job for all? Will all my videos be processed and transcoded?

@VaillantHassIo Did you find the answers you were looking for? Are your issues fixed?

I attach an example of what I'm talking about.

Image

stardust20 avatar Mar 13 '25 08:03 stardust20

I found this thread because I have a similar issue.

I downloaded my entire library from Google Photos, from several accounts. Afterwards, I started uploading the photos and videos into immich.

The videos play without issues on the web, but when running them from the app, iOS and Android, I observed some estrange behaviour. They also work fine if I play the videos using the phone browser. So the issues appeart to be happening only with the apps.

Some of them appear with the aspect ratio crippled, turned from 16:9 into 4:3, with the remaining of the screen showing the first frame.

Others don't play the image, only the audio is playing, they load only the first frame.

Do you think this has something to do with the issue of the video codec?

Can the transcoding fix the issue? What does it imply if I run the Video Transcoding job for all? Will all my videos be processed and transcoded?

@VaillantHassIo Did you find the answers you were looking for? Are your issues fixed?

I attach an example of what I'm talking about.

Image

+1 on this bug, having the same weird artifact issue on Android app. Using latest version as of right now 1.311.3. Sometimes videos get stretched and playback is artifacted (noticed that mostly happens with vertical filmed videos). In web they play fine, so the issue is probably app related.

morphixas avatar Apr 07 '25 17:04 morphixas

Have had the exact same issue very frequently and it only happens with videos. I have the latest updated version of Immich on Android.

kunal-bhadra avatar Apr 20 '25 11:04 kunal-bhadra

Having the same problem with the Android app via an nginx server that is also doing SSL (with self signed certificate + DDNS). Video is not playing, clicking download also results in "failed to download ...". But it works fine in the browser (Chrome).

Connecting directly to the local hosted Immich server from the Android app (with no SSL) also works fine.

Couldn't see any failures in the nginx logs. I suspect it has something to do with the self signed certificate. Is the app sending the stream url to some system component that is not accepting self-signed certificates?

andrei-tatar avatar May 06 '25 18:05 andrei-tatar

Having the same problem with the Android app via an nginx server that is also doing SSL (with self signed certificate + DDNS). Video is not playing, clicking download also results in "failed to download ...". But it works fine in the browser (Chrome).

Connecting directly to the local hosted Immich server from the Android app (with no SSL) also works fine.

Couldn't see any failures in the nginx logs. I suspect it has something to do with the self signed certificate. Is the app sending the stream url to some system component that is not accepting self-signed certificates?

I can confirm this. I have got the same setup.

A direct connection using http://immich_ip:2283 works to play the video, using a redirected version over nginx reverse ssl proxy https://immich.home with a self signed certificate does not work to play the video using the app.

Using chrome with https://immich.home with the self signed certificate works.

t1mg3i avatar May 06 '25 22:05 t1mg3i

@andrei-tatar @t1mg3i your issues are a duplicate of #15230

I am not sure what actual issue this ticket is tracking, at this point.

mmomjian avatar May 06 '25 22:05 mmomjian

Closing as it seems like the original issue was fixed and the rest is offtopic.

bo0tzz avatar May 07 '25 07:05 bo0tzz