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

Server crash on ffmpeg error while processing thumbnail of video #16546

Open
2 of 4 tasks
radqnico opened this issue Mar 3, 2025 · 0 comments
Open
2 of 4 tasks

Server crash on ffmpeg error while processing thumbnail of video #16546

radqnico opened this issue Mar 3, 2025 · 0 comments

Comments

@radqnico
Copy link

radqnico commented Mar 3, 2025

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

I think this is similar to past issues but the problem seems to be still there.
I have ran into a blocking issue with certain pictures or videos.
I am running Immich on docker, on a Alta Libre Computer board.
The server crashes when trying to process a certain video, it exits while generating the thumbnails. it happened with a video and some DNG pictures.

I believe it's a live picture that was exported wrongly from the phone, the files look like this in the galley:

Image

The OS that Immich Server is running on

Debian 12

Version of Immich Server

1.128.0

Version of Immich Mobile App

1.127.0 build.185

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

services:
  immich-server:
    container_name: immich-server
    image: ghcr.io/immich-app/immich-server:release
    volumes:
      - /mnt/nas/immich:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    environment:
      REDIS_HOSTNAME: immich-redis
      DB_HOSTNAME: immich-database
      DB_USERNAME: immich
      DB_PASSWORD: immich
      TZ: Europe/Rome
      IMMICH_PROCESS_INVALID_IMAGES: true
    depends_on:
      - immich-redis
      - immich-database
    restart: "unless-stopped"
    ports:
      - 2283:2283

  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:release
    volumes:
      - model-cache:/cache
    restart: "unless-stopped"

  immich-redis:
    container_name: immich-redis
    image: redis:6.2-alpine
    healthcheck:
      test: redis-cli ping || exit 1
    restart: "unless-stopped"

  immich-database:
    container_name: immich-postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0
    environment:
      POSTGRES_PASSWORD: immich
      POSTGRES_USER: immich
      POSTGRES_DB: immich
      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
      - ./immich/postgres:/var/lib/postgresql/data
    healthcheck:
      test: >-
        pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1;
        Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --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: "unless-stopped"

volumes:
  model-cache:

Your .env content

empty

Reproduction steps

  1. Upload the video attached
MVIMG_20211229_130119.MP4
  1. See immediately the errors
  2. If didn't crash, try to generate the thumbnail of that video.
    ...

Relevant log output

immich-server  | [Nest] 7  - 03/03/2025, 7:38:22 PM   ERROR [Microservices:MediaRepository] ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-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 --disab-enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --emp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enaefix=/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 @ 0x5770e180180] All samples in data stream index:id [2:3] have zero duration, stream set to be discarded by default. Override using AVStream->discard
immich-server  | [h264 @ 0x5770e1b0500] Reinit context to 640x480, pix_fmt: yuvj420p
immich-server  | [h264 @ 0x5770e1b0c00] Reinit context to 2048x1536, pix_fmt: yuv420p
immich-server  | Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/library/admin/2021/12/29/MVIMG_20211229_130119.MP4':
immich-server  |   Metadata:
immich-server  |     major_brand     : mp42
immich-server  |     minor_version   : 0
immich-server  |     compatible_brands: isommp42
immich-server  |     creation_time   : 2021-12-29T12:01:27.000000Z
immich-server  |     com.android.version: 11
immich-server  |   Duration: 00:00:01.56, start: 0.000000, bitrate: 12433 kb/s
immich-server  |   Stream #0:0[0x1](eng): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuvj420p(pc, smpte170m, progressive, left), 640x480, 11296 kb/s, SAR 1:1 DAR 4:3, 17.26 fps
immich-server  |       Metadata:
immich-server  |         creation_time   : 2021-12-29T12:01:27.000000Z
immich-server  |         handler_name    : VideoHandle
immich-server  |         vendor_id       : [0][0][0][0]
immich-server  |   Stream #0:1[0x2](eng): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m, progressive, left), 2048x1536, 3109 kb/s, SAR 1:1
immich-server  |       Metadata:
immich-server  |         creation_time   : 2021-12-29T12:01:27.000000Z
immich-server  |         handler_name    : VideoHandle
immich-server  |         vendor_id       : [0][0][0][0]
immich-server  |   Stream #0:2[0x3](eng): Data: none (mett / 0x7474656D) (default)
immich-server  |       Metadata:
immich-server  |         creation_time   : 2021-12-29T12:01:27.000000Z
immich-server  |         handler_name    : MetadHandle
immich-server  | [out#0/webp @ 0x5770e1c0fc0] No explicit maps, mapping streams automatically...
immich-server  | [vost#0:0/libwebp_anim @ 0x5770e1d0780] Created video stream from input stream 0:1
immich-server  | [Parsed_thumbnail_1 @ 0x5770e1c0540] batch size: 12 frames
immich-server  | [Parsed_scale_5 @ 0x5770e1c0780] w:-2 h:200 flags:'lanczos+accurate_rnd+full_chroma_int' interl:0
immich-server  | [Parsed_fps_0 @ 0x5770e1c09c0] 0 frames in, 0 frames out; 0 frames dropped, 0 frames duplicated.
immich-server  | Stream mapping:
immich-server  |   Stream #0:1 -> #0:0 (h264 (native) -> webp (libwebp_anim))
immich-server  | [vost#0:0/libwebp_anim @ 0x5770e1d0780] Starting thread...
immich-server  | [vf#0:0 @ 0x5770e127980] Starting thread...
immich-server  | [vist#0:1/h264 @ 0x5770e050a80] [dec:h264 @ 0x5770e1907c0] Starting thread...
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x5770e080380] Starting thread...
immich-server  | Press [q] to stop, [?] for help
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x5770e080380] EOF while reading input
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x5770e080380] Terminating thread with return code 0 (success)
immich-server  | [vist#0:1/h264 @ 0x5770e050a80] [dec:h264 @ 0x5770e1907c0] Decoder thread received EOF packet
immich-server  | [h264 @ 0x5770e1b2100] Reinit context to 2048x1536, pix_fmt: yuv420p
immich-server  | [vist#0:1/h264 @ 0x5770e050a80] [dec:h264 @ 0x5770e1907c0] Decoder returned EOF, finishing
immich-server  | [vist#0:1/h264 @ 0x5770e050a80] [dec:h264 @ 0x5770e1907c0] Terminating thread with return code 0 (success)
immich-server  | [Parsed_thumbnail_1 @ 0x577120b0600] batch size: 12 frames
immich-server  | [Parsed_scale_5 @ 0x577120b0900] w:-2 h:200 flags:'lanczos+accurate_rnd+full_chroma_int' interl:0
immich-server  | [graph 0 input from stream 0:1 @ 0x577120b09c0] w:2048 h:1536 pixfmt:yuv420p tb:1/90000 fr:0/1 sar:1/1 csp:smpte170m range:tv
immich-server  | [Parsed_fps_0 @ 0x577120b0480] fps=12/1
immich-server  | [Parsed_scale_5 @ 0x577120b0900] w:2048 h:1536 fmt:yuv420p csp:smpte170m range:tv sar:1/1 -> w:266 h:200 fmt:yuv420p csp:smpte170m range:pc sar:400/399 flags:0x00042200
immich-server  | [vf#0:0 @ 0x5770e127980] Filtergraph returned EOF, finishing
immich-server  | [vf#0:0 @ 0x5770e127980] All consumers returned EOF
immich-server  | [vost#0:0/libwebp_anim @ 0x5770e1d0780] No filtered frames for output stream, trying to initialize anyway.
immich-server  | Output #0, webp, to 'upload/thumbs/f76925c0-a163-47da-9bc5-cd82e47cca94/78/cd/78cdb0ab-fe5f-4288-a2c4-cbed374e6949-thumbnail.webp':
immich-server  |   Metadata:
immich-server  |     major_brand     : mp42
immich-server  |     minor_version   : 0
immich-server  |     compatible_brands: isommp42
immich-server  |     com.android.version: 11
immich-server  |     encoder         : Lavf61.1.100
immich-server  |   Stream #0:0(eng): Video: webp, 1 reference frame, yuv420p(progressive), 266x200 [SAR 400:399 DAR 4:3], q=2-31, 200 kb/s, 12 fps, 1k tbn (default)
immich-server  |       Metadata:
immich-server  |         creation_time   : 2021-12-29T12:01:27.000000Z
immich-server  |         handler_name    : VideoHandle
immich-server  |         vendor_id       : [0][0][0][0]
immich-server  |         encoder         : Lavc61.3.100 libwebp_anim
immich-server  | [out#0/webp @ 0x5770e1c0fc0] Starting thread...
immich-server  | [Parsed_fps_0 @ 0x577120b0480] 0 frames in, 0 frames out; 0 frames dropped, 0 frames duplicated.
immich-server  | [vost#0:0/libwebp_anim @ 0x5770e1d0780] Encoder thread received EOF
immich-server  | [libwebp encoder @ 0x5770e170420] WebPAnimEncoderAssemble() failed with error: 1
immich-server  | [vost#0:0/libwebp_anim @ 0x5770e1d0780] Error submitting video frame to the encoder
immich-server  | [vost#0:0/libwebp_anim @ 0x5770e1d0780] Error flushing encoder: Cannot allocate memory
immich-server  | [vost#0:0/libwebp_anim @ 0x5770e1d0780] Task finished with error code: -12 (Cannot allocate memory)
immich-server  | [vost#0:0/libwebp_anim @ 0x5770e1d0780] Terminating thread with return code -12 (Cannot allocate memory)
immich-server  | [vf#0:0 @ 0x5770e127980] Terminating thread with return code 0 (success)
immich-server  | [out#0/webp @ 0x5770e1c0fc0] All streams finished
immich-server  | [out#0/webp @ 0x5770e1c0fc0] Terminating thread with return code 0 (success)
immich-server  | [AVIOContext @ 0x5770e190540] Statistics: 0 bytes written, 0 seeks, 0 writeouts
immich-server  | [out#0/webp @ 0x5770e1c0fc0] Output file #0 (upload/thumbs/f76925c0-a163-47da-9bc5-cd82e47cca94/78/cd/78cdb0ab-fe5f-4288-a2c4-cbed374e6949-thumbnail.webp):
immich-server  | [out#0/webp @ 0x5770e1c0fc0]   Output stream #0:0 (video): 0 frames encoded; 0 packets muxed (0 bytes);
immich-server  | [out#0/webp @ 0x5770e1c0fc0]   Total: 0 packets (0 bytes) muxed
immich-server  | [out#0/webp @ 0x5770e1c0fc0] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
immich-server  | [out#0/webp @ 0x5770e1c0fc0] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
immich-server  | frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x5770e080380] Input file #0 (upload/library/admin/2021/12/29/MVIMG_20211229_130119.MP4):
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x5770e080380]   Input stream #0:1 (video): 1 packets read (207056 bytes); 0 frames decoded; 0 decode errors;
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x5770e080380]   Total: 1 packets (207056 bytes) demuxed
immich-server  | [AVIOContext @ 0x5770e190180] Statistics: 2431588 bytes read, 0 seeks
immich-server  | Conversion failed!
immich-server  |
immich-server  | [Nest] 7  - 03/03/2025, 7:38:22 PM   ERROR [Microservices:{"id":"78cdb0ab-fe5f-4288-a2c4-cbed374e6949"}] Unable to run job handler (thumbnailGeneration/generate-thumbnails): E
immich-server  |
immich-server  | Error: ffmpeg exited with code 244: Conversion failed!
immich-server  |
immich-server  |     at ChildProcess.<anonymous> (/usr/src/app/node_modules/fluent-ffmpeg/lib/processor.js:180:22)
immich-server  |     at ChildProcess.emit (node:events:524:28)
immich-server  |     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
immich-server exited with code 0

Additional information

No response

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

1 participant