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

Generating Thumbnails fails for certain Videos #9444

Closed
1 of 3 tasks
watn3y opened this issue May 13, 2024 · 2 comments · Fixed by #9808
Closed
1 of 3 tasks

Generating Thumbnails fails for certain Videos #9444

watn3y opened this issue May 13, 2024 · 2 comments · Fixed by #9808

Comments

@watn3y
Copy link

watn3y commented May 13, 2024

The bug

A few weeks ago, I noticed Immich throwing some errors when trying to generate Thumbnails for certain Media. These were mostly Videos, but I there might also have been some pictures (I'll have to double-check when I have the time).

I grabbed the file in question, started a new Immich instance, and was able to reproduce the error.

Note that this issue occurs with both webp and jpeg.

The OS that Immich Server is running on

Docker 26.1.2 on Debian Bookworm

Version of Immich Server

v1.104.0

Version of Immich Mobile App

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}
    command: ['start.sh', 'immich']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env

    depends_on:
      - redis
      - database
    restart: unless-stopped
    labels:
      traefik.http.services.immich.loadbalancer.server.port: 3001
      traefik.http.routers.immich.rule: Host(`photos.watn3y.de`)
    networks:
      expose:
      internal:
      
  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: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    devices:
      - /dev/dri:/dev/dri
    command: ['start.sh', 'microservices']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
    restart: unless-stopped
    networks:
      internal:
      
  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
    device_cgroup_rules:
      - "c 189:* rmw"
    devices:
      - /dev/dri:/dev/dri
    volumes:
      - /dev/bus/usb:/dev/bus/usb

      - model-cache:/cache
    env_file:
      - stack.env
    restart: unless-stopped
    networks:
      internal:
      
  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672
    restart: unless-stopped
    networks:
      internal:
      
  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}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    restart: unless-stopped
    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"]
    networks:
      internal:
      
volumes:
  model-cache:

networks:
  expose:
    external: true
  internal:
    external: false

Your .env content

UPLOAD_LOCATION=/tank/immich/data
DB_DATA_LOCATION=/tank/immich/config
IMMICH_VERSION=release
DB_PASSWORD=postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

1. Start a thumbnail generation job for the Video:
2. That's it.

Relevant log output

[Nest] 7  - 05/13/2024, 9:54:39 PM   ERROR [MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  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 --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --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=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/library/c1a1f64d-36ce-4254-9c69-3a2a19851483/2024/02/27/IMG_1515.MOV':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2024-02-27T09:54:14.000000Z
    com.apple.quicktime.location.accuracy.horizontal: 3000.000000
    com.apple.quicktime.location.ISO6709: +51.3990+009.7378+134.436/
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: iPhone 15 Pro
    com.apple.quicktime.software: 17.3.1
    com.apple.quicktime.creationdate: 2024-02-27T10:54:14+0100
  Duration: 00:00:06.96, start: 0.000000, bitrate: 54453 kb/s
  Stream #0:0[0x1](und): Video: hevc (Main 10), 1 reference frame (hvc1 / 0x31637668), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67, left), 3840x2160, 54258 kb/s, 59.93 fps, 59.94 tbr, 600 tbn (default)
    Metadata:
      creation_time   : 2024-02-27T09:54:14.000000Z
      handler_name    : Core Media Video
      vendor_id       : [0][0][0][0]
      encoder         : HEVC
    Side data:
      DOVI configuration record: version: 1.0, profile: 8, level: 10, rpu flag: 1, el flag: 0, bl flag: 1, compatibility id: 4
      displaymatrix: rotation of -90.00 degrees
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 94 kb/s (default)
    Metadata:
      creation_time   : 2024-02-27T09:54:14.000000Z
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2024-02-27T09:54:14.000000Z
      handler_name    : Core Media Metadata
  Stream #0:3[0x4](und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2024-02-27T09:54:14.000000Z
      handler_name    : Core Media Metadata
  Stream #0:4[0x5](und): Data: none (mebx / 0x7862656D), 69 kb/s (default)
    Metadata:
      creation_time   : 2024-02-27T09:54:14.000000Z
      handler_name    : Core Media Metadata
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> webp (libwebp_anim))
Press [q] to stop, [?] for help
[Parsed_scale_0 @ 0x330f8133b40] w:480 h:-1 flags:'lanczos+accurate_rnd+bitexact+full_chroma_int' interl:0
[graph 0 input from stream 0:0 @ 0x330f8133f00] w:3840 h:2160 pixfmt:yuv420p10le tb:1/600 fr:60000/1001 sar:0/1
[transpose @ 0x330f80c0c80] w:3840 h:2160 dir:1 -> w:2160 h:3840 rotation:clockwise vflip:0
[Parsed_scale_0 @ 0x330f8133b40] w:2160 h:3840 fmt:yuv420p10le sar:0/1 -> w:480 h:853 fmt:yuv420p10le sar:0/1 flags:0x000C2200
    Last message repeated 3 times
[Parsed_zscale_1 @ 0x330f8133c00] code 1027: image dimensions must be divisible by subsampling factor
    Last message repeated 25 times
Error while filtering: Generic error in an external library
Failed to inject frame into filter network: Generic error in an external library
Error while processing the decoded data for stream #0:0
[AVIOContext @ 0x330f83c02c0] Statistics: 0 bytes written, 0 seeks, 0 writeouts
Terminating demuxer thread 0
[AVIOContext @ 0x330f8240180] Statistics: 2546254 bytes read, 3 seeks
Conversion failed!

[Nest] 7  - 05/13/2024, 9:54:39 PM   ERROR [JobService] Unable to run job handler (thumbnailGeneration/generate-thumbnail): Error: ffmpeg exited with code 1: Conversion failed!

[Nest] 7  - 05/13/2024, 9:54:39 PM   ERROR [JobService] Error: ffmpeg exited with code 1: Conversion failed!

    at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (node:events:518:28)
    at ChildProcess._handle.onexit (node:internal/child_process:294:12)
[Nest] 7  - 05/13/2024, 9:54:39 PM   ERROR [JobService] Object:
{
  "id": "b7cbe930-be3f-40c8-9763-f792718c9552"
}

Additional information

No response

@watn3y
Copy link
Author

watn3y commented May 13, 2024

Here's the Video file. Hopefully you can use it to reproduce this.

@watn3y
Copy link
Author

watn3y commented May 15, 2024

I did some more debugging, and this only seems to happen with the Thumbnail Resolution set to 480p.

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

Successfully merging a pull request may close this issue.

1 participant