VAAPI H.264 Encoding Fails (SIGABRT in i965 driver) on Intel Haswell GPU (HD 4400) with HEVC Input #5968

Open
opened 2026-02-05 11:53:45 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @andresichelero on GitHub (May 6, 2025).

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

  • Yes

The bug

When Immich attempts to transcode an input video file originally encoded with HEVC (H.265), targeting H.264 output using VAAPI acceleration, the FFmpeg process consistently crashes. The crash occurs after VAAPI has successfully initialized with the correct i965 driver but during the setup or initial processing phase of the h264_vaapi encoder. The crash manifests as a SIGABRT signal received by FFmpeg, originating from an assertion failure within the i965 driver code - Assertion \obj_surface->fourcc == VA_FOURCC_NV12' failed.

Current Behavior:

  1. FFmpeg successfully initializes VAAPI using the bundled i965 driver (Intel i965 driver for Intel(R) Haswell - 2.4.0.pre1 () found within /usr/lib/jellyfin-ffmpeg/lib/dri/).
  2. The h264_vaapi encoder starts initialization and logs parameters (Profile: High, Entrypoint: EncSlice, RC Mode: CQP, etc.).
  3. FFmpeg abruptly terminates due to a SIGABRT signal.
  4. The underlying cause is an assertion failure within the i965 driver code: ffmpeg: i965_gpe_utils.c:518: gen7_gpe_set_surface2_state: Assertion 'obj_surface->fourcc == VA_FOURCC_NV12' failed.
  5. Immich logs Error occurred during transcoding: ffmpeg was killed with signal SIGABRT and retries the transcode using software encoding (CPU fallback).

Troubleshooting Done:

  • Confirmed host VAAPI setup is correct and functional.
  • Confirmed container has /dev/dri mapped and process should have group permissions via group_add.
  • Determined that necessary VAAPI components (vainfo, i965_drv_video.so) are missing from the container's standard system paths (/usr/bin, /usr/lib/x86_64-linux-gnu/dri).
  • Attempting apt-get install vainfo i965-va-driver inside the container fails due to unmet dependencies (libva2 version conflict), likely caused by mixed Debian stable/testing/sid sources in the base image.
  • Discovered that the bundled Jellyfin FFmpeg build does include VAAPI libs/drivers under /usr/lib/jellyfin-ffmpeg/lib/dri/, allowing VAAPI initialization.
  • Changed Immich output codec from AV1 (unsupported by HD 4400) to H.264 (supported according to host vainfo).
  • Disabled Hardware Decoding, Tone-mapping, and B-Frames in Immich settings; the SIGABRT crash during H.264 encoding persists when the input is HEVC.
  • Tested with H.264 input files and confirmed transcoding works correctly.
  • This issue seems related to #14050, but manifests as a driver assertion failure rather than just inability to initialize device, specifically when encoding H.264 from HEVC input.

Could the bundled VAAPI drivers/libraries within the immich-server image, particularly the i965 driver used by the Jellyfin FFmpeg build, be investigated or updated to resolve this crash on older-but-VAAPI-capable Intel hardware like Haswell? Alternatively, could the base image dependencies be fixed to allow installation of standard Debian bookworm VAAPI packages without conflict?

The OS that Immich Server is running on

Ubuntu Server 24.04.2 LTS Codename: noble

Version of Immich Server

v1.132.3

Version of Immich Mobile App

Not used

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

name: immich

services:
  immich-server:
    privileged: true
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.transcoding.yml
      service: vaapi
    group_add:
      - "44"
      - "993"
    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
      - /mnt/ATLAS/nextcloud/data:/mnt/ATLAS/nextcloud/data: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, rocm, openvino, rknn] 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, rocm, openvino, openvino-wsl, rknn] 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/valkey/valkey:8-bookworm@sha256:42cba146593a5ea9a622002c1b7cba5da7be248650cbb64ecb9c6c33d29794b1
    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:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
    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="$${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: always

volumes:
  model-cache:

Your .env content

UPLOAD_LOCATION=/mnt/ATLAS/immich
DB_DATA_LOCATION=./postgres
TZ=Etc/UTC
IMMICH_VERSION=release
DB_PASSWORD=*******
# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

  1. Set up Immich v1.132.3 via Docker Compose on a host system with an Intel Haswell generation CPU/GPU (e.g., i3-4170 / HD 4400).
  2. Ensure host VAAPI drivers (i965-va-driver, libva, etc.) are correctly installed and vainfo runs successfully on the host. Ensure the user running Docker is in the render group.
  3. Configure docker-compose.yml for immich-server using extends: ... service: vaapi and add group_add: with host render/video GIDs.
  4. Configure Immich Transcoding Settings via UI as described above (VAAPI, H.264 output, HW Decode Off, Tone-mapping Disabled, B-frames 0).
  5. Upload a video file encoded using HEVC (H.265).
  6. Observe the immich_server container logs as the transcoding job is processed.

Relevant log output

[Nest] 7  - 05/05/2025, 8:41:18 PM   ERROR [Microservices:MediaRepository] ffmpeg version 7.0.2-Jellyfin ... (configuration shown) ...
[AVHWDeviceContext @ 0x42ed414c3c0] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x42ed414c3c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x42ed414c3c0] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x42ed414c3c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/i965_drv_video.so
[AVHWDeviceContext @ 0x42ed414c3c0] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x42ed414c3c0] Initialised VAAPI connection: version 1.22
[AVHWДeviceContext @ 0x42ed414c3c0] VAAPI driver: Intel i965 driver for Intel(R) Haswell - 2.4.0.pre1 ().
... (Input stream info: HEVC input, H.264 output target) ...
Stream mapping:
  Stream #0:1 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:0 -> #0:1 (aac (native) -> opus (libopus))
...
[h264_vaapi @ 0x42ed4201580] Using input frames context (format vaapi) with h264_vaapi encoder.
[h264_vaapi @ 0x42ed4201580] Input surface format is yuv420p.
[h264_vaapi @ 0x42ed4201580] Using VAAPI profile VAProfileH264High (7).
[h264_vaapi @ 0x42ed4201580] Using VAAPI entrypoint VAEntrypointEncSlice (6).
[h264_vaapi @ 0x42ed4201580] Using VAAPI render target format YUV420 (0x1).
[h264_vaapi @ 0x42ed4201580] RC mode: CQP.
... (other parameters) ...
ffmpeg: i965_gpe_utils.c:518: gen7_gpe_set_surface2_state: Assertion `obj_surface->fourcc == VA_FOURCC_NV12' failed.

[Nest] 7  - 05/05/2025, 8:41:18 PM   ERROR [Microservices:MediaService] Error occurred during transcoding: ffmpeg was killed with signal SIGABRT
[Nest] 7  - 05/05/2025, 8:41:18 PM   ERROR [Microservices:MediaService] Retrying with VAAPI acceleration disabled

Additional information

Hardware and Software info:

  • Host CPU: Intel Core i3-4170 (Haswell architecture)
  • Host GPU: Integrated Intel HD Graphics 4400 (HSW GT2)
  • Host Kernel: 6.8.0-59-generic
  • Host VAAPI Status:
  • vainfo on host runs successfully.
  • Loads Intel i965 driver for Intel(R) Haswell - 2.4.1.
  • Reports support for VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice, VAProfileH264Main: VAEntrypointEncSlice, VAProfileH264High: VAEntrypointEncSlice.  
  • Host User Permissions: User running docker compose is confirmed member of the render group (and video). Checked via groups and ls -l /dev/dri.
  • Container Image Tested: ghcr.io/immich-app/immich-server:v1.132.3
  • FFmpeg Version (Inside Container): 7.0.2-Jellyfin (from Immich logs)
  • hwaccel.transcoding.yml: Confirmed to contain the standard vaapi: service definition with devices: ['/dev/dri:/dev/dri'].

Immich Transcoding Settings (Admin UI):

  • Acceleration API: VAAPI
  • Hardware decoding: Off
  • Video codec (Output): h264
  • Audio codec: opus
  • Target resolution: original
  • Constant rate factor (-crf): 25
  • Preset (-preset): fast
  • Tone-mapping: Disabled
  • Maximum B-frames: 0
  • (Other settings at default)
Originally created by @andresichelero on GitHub (May 6, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug When Immich attempts to transcode an input video file originally encoded with HEVC (H.265), targeting H.264 output using VAAPI acceleration, the FFmpeg process consistently crashes. The crash occurs after VAAPI has successfully initialized with the correct i965 driver but during the setup or initial processing phase of the h264_vaapi encoder. The crash manifests as a SIGABRT signal received by FFmpeg, originating from an assertion failure within the i965 driver code - `Assertion \obj_surface->fourcc == VA_FOURCC_NV12' failed`. ### Current Behavior: 1. FFmpeg successfully initializes VAAPI using the bundled i965 driver (Intel i965 driver for Intel(R) Haswell - 2.4.0.pre1 () found within /usr/lib/jellyfin-ffmpeg/lib/dri/). 2. The h264_vaapi encoder starts initialization and logs parameters (Profile: High, Entrypoint: EncSlice, RC Mode: CQP, etc.). 3. FFmpeg abruptly terminates due to a SIGABRT signal. 4. The underlying cause is an assertion failure within the i965 driver code: ffmpeg: i965_gpe_utils.c:518: gen7_gpe_set_surface2_state: Assertion 'obj_surface->fourcc == VA_FOURCC_NV12' failed. 5. Immich logs Error occurred during transcoding: ffmpeg was killed with signal SIGABRT and retries the transcode using software encoding (CPU fallback). ### Troubleshooting Done: - Confirmed host VAAPI setup is correct and functional. - Confirmed container has /dev/dri mapped and process should have group permissions via group_add. - Determined that necessary VAAPI components (vainfo, i965_drv_video.so) are missing from the container's standard system paths (/usr/bin, /usr/lib/x86_64-linux-gnu/dri). - Attempting apt-get install vainfo i965-va-driver inside the container fails due to unmet dependencies (libva2 version conflict), likely caused by mixed Debian stable/testing/sid sources in the base image. - Discovered that the bundled Jellyfin FFmpeg build does include VAAPI libs/drivers under /usr/lib/jellyfin-ffmpeg/lib/dri/, allowing VAAPI initialization. - Changed Immich output codec from AV1 (unsupported by HD 4400) to H.264 (supported according to host vainfo). - Disabled Hardware Decoding, Tone-mapping, and B-Frames in Immich settings; the SIGABRT crash during H.264 encoding persists when the input is HEVC. - **Tested with H.264 input files and confirmed transcoding works correctly**. - This issue seems related to #14050, but manifests as a driver assertion failure rather than just inability to initialize device, specifically when encoding H.264 from HEVC input. Could the bundled VAAPI drivers/libraries within the immich-server image, particularly the i965 driver used by the Jellyfin FFmpeg build, be investigated or updated to resolve this crash on older-but-VAAPI-capable Intel hardware like Haswell? Alternatively, could the base image dependencies be fixed to allow installation of standard Debian bookworm VAAPI packages without conflict? ### The OS that Immich Server is running on Ubuntu Server 24.04.2 LTS Codename: noble ### Version of Immich Server v1.132.3 ### Version of Immich Mobile App Not used ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML name: immich services: immich-server: privileged: true container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} extends: file: hwaccel.transcoding.yml service: vaapi group_add: - "44" - "993" 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 - /mnt/ATLAS/nextcloud/data:/mnt/ATLAS/nextcloud/data: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, rocm, openvino, rknn] 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, rocm, openvino, openvino-wsl, rknn] 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/valkey/valkey:8-bookworm@sha256:42cba146593a5ea9a622002c1b7cba5da7be248650cbb64ecb9c6c33d29794b1 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:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52 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="$${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: always volumes: model-cache: ``` ### Your .env content ```Shell UPLOAD_LOCATION=/mnt/ATLAS/immich DB_DATA_LOCATION=./postgres TZ=Etc/UTC IMMICH_VERSION=release DB_PASSWORD=******* # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps 1. Set up Immich v1.132.3 via Docker Compose on a host system with an Intel Haswell generation CPU/GPU (e.g., i3-4170 / HD 4400). 2. Ensure host VAAPI drivers (i965-va-driver, libva, etc.) are correctly installed and vainfo runs successfully on the host. Ensure the user running Docker is in the render group. 3. Configure docker-compose.yml for immich-server using extends: ... service: vaapi and add group_add: with host render/video GIDs. 4. Configure Immich Transcoding Settings via UI as described above (VAAPI, H.264 output, HW Decode Off, Tone-mapping Disabled, B-frames 0). 5. Upload a video file encoded using HEVC (H.265). 6. Observe the immich_server container logs as the transcoding job is processed. ### Relevant log output ```shell [Nest] 7 - 05/05/2025, 8:41:18 PM ERROR [Microservices:MediaRepository] ffmpeg version 7.0.2-Jellyfin ... (configuration shown) ... [AVHWDeviceContext @ 0x42ed414c3c0] libva: VA-API version 1.22.0 [AVHWDeviceContext @ 0x42ed414c3c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so [AVHWDeviceContext @ 0x42ed414c3c0] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed [AVHWDeviceContext @ 0x42ed414c3c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/i965_drv_video.so [AVHWDeviceContext @ 0x42ed414c3c0] libva: va_openDriver() returns 0 [AVHWDeviceContext @ 0x42ed414c3c0] Initialised VAAPI connection: version 1.22 [AVHWДeviceContext @ 0x42ed414c3c0] VAAPI driver: Intel i965 driver for Intel(R) Haswell - 2.4.0.pre1 (). ... (Input stream info: HEVC input, H.264 output target) ... Stream mapping: Stream #0:1 -> #0:0 (hevc (native) -> h264 (h264_vaapi)) Stream #0:0 -> #0:1 (aac (native) -> opus (libopus)) ... [h264_vaapi @ 0x42ed4201580] Using input frames context (format vaapi) with h264_vaapi encoder. [h264_vaapi @ 0x42ed4201580] Input surface format is yuv420p. [h264_vaapi @ 0x42ed4201580] Using VAAPI profile VAProfileH264High (7). [h264_vaapi @ 0x42ed4201580] Using VAAPI entrypoint VAEntrypointEncSlice (6). [h264_vaapi @ 0x42ed4201580] Using VAAPI render target format YUV420 (0x1). [h264_vaapi @ 0x42ed4201580] RC mode: CQP. ... (other parameters) ... ffmpeg: i965_gpe_utils.c:518: gen7_gpe_set_surface2_state: Assertion `obj_surface->fourcc == VA_FOURCC_NV12' failed. [Nest] 7 - 05/05/2025, 8:41:18 PM ERROR [Microservices:MediaService] Error occurred during transcoding: ffmpeg was killed with signal SIGABRT [Nest] 7 - 05/05/2025, 8:41:18 PM ERROR [Microservices:MediaService] Retrying with VAAPI acceleration disabled ``` ### Additional information ### Hardware and Software info: - Host CPU: Intel Core i3-4170 (Haswell architecture) - Host GPU: Integrated Intel HD Graphics 4400 (HSW GT2) - Host Kernel: 6.8.0-59-generic - Host VAAPI Status: - **vainfo** on host runs successfully. - Loads Intel i965 driver for Intel(R) Haswell - 2.4.1. - Reports support for VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice, VAProfileH264Main: VAEntrypointEncSlice, VAProfileH264High: VAEntrypointEncSlice.   - Host User Permissions: User running docker compose is confirmed member of the render group (and video). Checked via groups and ls -l /dev/dri. - Container Image Tested: ghcr.io/immich-app/immich-server:v1.132.3 - FFmpeg Version (Inside Container): 7.0.2-Jellyfin (from Immich logs) - hwaccel.transcoding.yml: Confirmed to contain the standard vaapi: service definition with devices: ['/dev/dri:/dev/dri']. ### Immich Transcoding Settings (Admin UI): - Acceleration API: VAAPI - Hardware decoding: Off - Video codec (Output): h264 - Audio codec: opus - Target resolution: original - Constant rate factor (-crf): 25 - Preset (-preset): fast - Tone-mapping: Disabled - Maximum B-frames: 0 - (Other settings at default)
OVERLORD added the 🗄️server label 2026-02-05 11:53:45 +03:00
Author
Owner

@mertalev commented on GitHub (May 6, 2025):

I think the issue is that the input video is 10-bit while your processor only supports 8-bit processing. The assertion means the input is in p010 or similar rather than nv12. It should work if you enable tone-mapping as this is currently done in software when hardware decoding is disabled. However, this is not a processor generation we're optimizing for and the behavior here can change in the future. It's much faster to move the tone-mapping to the hardware instead and only do the decoding in software, at which point this issue will reoccur.

@mertalev commented on GitHub (May 6, 2025): I think the issue is that the input video is 10-bit while your processor only supports 8-bit processing. The assertion means the input is in p010 or similar rather than nv12. It should work if you enable tone-mapping as this is currently done in software when hardware decoding is disabled. However, this is not a processor generation we're optimizing for and the behavior here can change in the future. It's much faster to move the tone-mapping to the hardware instead and only do the decoding in software, at which point this issue will reoccur.
Author
Owner

@andresichelero commented on GitHub (May 6, 2025):

I think the issue is that the input video is 10-bit while your processor only supports 8-bit processing. The assertion means the input is in p010 or similar rather than nv12. It should work if you enable tone-mapping as this is currently done in software when hardware decoding is disabled. However, this is not a processor generation we're optimizing for and the behavior here can change in the future. It's much faster to move the tone-mapping to the hardware instead and only do the decoding in software, at which point this issue will reoccur.

Thanks for the suggestion regarding 10-bit input. However, I've investigated further and confirmed the issue also occurs with an 8-bit HEVC input file.

I triggered the transcoding again with Hardware Decoding OFF and Tone Mapping ON (set to Hable). The FFmpeg process still crashed with the exact same SIGABRT and assertion failure: ffmpeg: i965_gpe_utils.c:518: gen7_gpe_set_surface2_state: Assertion 'obj_surface->fourcc == VA_FOURCC_NV12' failed.

Here is the mediainfo output for the specific 8-bit HEVC video that caused the crash this time:

General
Complete name                            : /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250416_161723_904.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/mp41)
File size                                : 6.16 MiB
Duration                                 : 10 s 194 ms
Overall bit rate                         : 5 072 kb/s
Frame rate                               : 30.200 FPS
Writing application                      : Lavf56.40.101

Video
ID                                       : 2
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L4@Main
Codec ID                                 : hvc1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 10 s 0 ms
Bit rate                                 : 5 032 kb/s
Width                                    : 720 pixels
Height                                   : 1 280 pixels
Display aspect ratio                     : 0.562
Frame rate                               : 30.200 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.181
Stream size                              : 6.00 MiB (97%)
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : hvcC

Audio
ID                                       : 1
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 10 s 194 ms
Bit rate mode                            : Constant
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 159 KiB (3%)
Default                                  : Yes
Alternate group                          : 1

And here are the relevant FFmpeg logs showing the crash with this 8-bit input and Tone Mapping enabled:

[Nest] 7  - 05/05/2025, 10:11:00 PM     LOG [Microservices:MediaService] Transcoding video 80289503-881a-44da-8a4d-293c702b26c6 with VAAPI-accelerated encoding and software decoding
[Nest] 7  - 05/05/2025, 10:11:00 PM   ERROR [Microservices:MediaRepository] ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 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=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=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      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[AVHWDeviceContext @ 0x3209e14c3c0] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x3209e14c3c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x3209e14c3c0] libva: Found init function __vaDriverInit_1_22
[AVHWDeviceContext @ 0x3209e14c3c0] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x3209e14c3c0] libva: va_openDriver() returns 1
[AVHWDeviceContext @ 0x3209e14c3c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/i965_drv_video.so
[AVHWDeviceContext @ 0x3209e14c3c0] libva: Found init function __vaDriverInit_1_22
[AVHWDeviceContext @ 0x3209e14c3c0] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x3209e14c3c0] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x3209e14c3c0] VAAPI driver: Intel i965 driver for Intel(R) Haswell - 2.4.0.pre1 ().
[AVHWDeviceContext @ 0x3209e14c3c0] Driver not found in known nonstandard list, using standard behaviour.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/ATLAS/nextcloud/data/foxtrot/files/EnvioAutomático/Instagram/VID_20250416_161723_904.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.40.101
  Duration: 00:00:10.19, start: 0.000000, bitrate: 5072 kb/s
  Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Video: hevc (Main), 1 reference frame (hvc1 / 0x31637668), yuv420p(tv, bt709, left), 720x1280, 5031 kb/s, 30.20 fps, 30 tbr, 90k tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
[out#0/mp4 @ 0x3209e123c80] Adding streams from explicit maps...
[vost#0:0/h264_vaapi @ 0x3209e1e4980] Created video stream from input stream 0:1
[aost#0:1/libopus @ 0x3209e1e4080] Created audio stream from input stream 0:0
Stream mapping:
  Stream #0:1 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:0 -> #0:1 (aac (native) -> opus (libopus))
[vost#0:0/h264_vaapi @ 0x3209e1e4980] Starting thread...
[aost#0:1/libopus @ 0x3209e1e4080] Starting thread...
[vf#0:0 @ 0x3209e1f1940] Starting thread...
[af#0:1 @ 0x3209e053c40] Starting thread...
[vist#0:1/hevc @ 0x3209e320180] [dec:hevc @ 0x3209e182580] Starting thread...
[aist#0:0/aac @ 0x3209e320880] [dec:aac @ 0x3209e0602c0] Starting thread...
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x3209e123a80] Starting thread...
Press [q] to stop, [?] for help
[graph_1_in_0:0 @ 0x320ae050300] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo
[format_out_0_1 @ 0x320ae050480] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
[auto_aresample_0 @ 0x320ae050540] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:flt r:48000Hz
[libopus @ 0x3209e203180] No bit rate set. Defaulting to 96000 bps.
[graph 0 input from stream 0:1 @ 0x320ac050300] w:720 h:1280 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:0/1 csp:bt709 range:tv
[graph 0 input from stream 0:1 @ 0x320ac050300] video frame properties congruent with link at pts_time: 0
[h264_vaapi @ 0x3209e201580] Using input frames context (format vaapi) with h264_vaapi encoder.
[h264_vaapi @ 0x3209e201580] Input surface format is yuv420p.
[h264_vaapi @ 0x3209e201580] Using VAAPI profile VAProfileH264High (7).
[h264_vaapi @ 0x3209e201580] Using VAAPI entrypoint VAEntrypointEncSlice (6).
[h264_vaapi @ 0x3209e201580] Using VAAPI render target format YUV420 (0x1).
[h264_vaapi @ 0x3209e201580] RC mode: CQP.
[h264_vaapi @ 0x3209e201580] Block Level bitrate control: OFF.
[h264_vaapi @ 0x3209e201580] RC quality: 25.
[h264_vaapi @ 0x3209e201580] RC framerate: 30/1 (30.00 fps).
[h264_vaapi @ 0x3209e201580] Driver does not report any additional prediction constraints.
[h264_vaapi @ 0x3209e201580] Using intra and P-frames (supported references: 1 / 1).
[h264_vaapi @ 0x3209e201580] All wanted packed headers available (wanted 0xd, found 0x1f).
[h264_vaapi @ 0x3209e201580] Invalid quality level: valid range is 0-2, using 2.
[h264_vaapi @ 0x3209e201580] Using level 3.1.
Output #0, mp4, to 'upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/80/28/80289503-881a-44da-8a4d-293c702b26c6.mp4':
  Metadata:
    encoder         : Lavf61.1.100
  Stream #0:0: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), vaapi(tv, bt709, progressive, left), 720x1280, q=2-31, 30 fps, 15360 tbn (default)
      Metadata:
        encoder         : Lavc61.3.100 h264_vaapi
  Stream #0:1: Audio: opus (Opus / 0x7375704F), 48000 Hz, stereo, flt, delay 312, 96 kb/s (default)
      Metadata:
        encoder         : Lavc61.3.100 libopus
[out#0/mp4 @ 0x3209e123c80] Starting thread...
ffmpeg: i965_gpe_utils.c:518: gen7_gpe_set_surface2_state: Assertion `obj_surface->fourcc == VA_FOURCC_NV12' failed.

[Nest] 7  - 05/05/2025, 10:11:00 PM   ERROR [Microservices:MediaService] Error occurred during transcoding: ffmpeg was killed with signal SIGABRT
[Nest] 7  - 05/05/2025, 10:11:00 PM   ERROR [Microservices:MediaService] Retrying with VAAPI acceleration disabled

This confirms the problem is not specific to 10-bit input and seems to be a more general issue with the HEVC -> H.264 pipeline using the bundled i965 driver on Haswell hardware, even when the input is standard 8-bit. Anyway, I understand that this hardware generation is not a priority in terms of optimization, so please assign the level of urgency you deem appropriate. Thanks again for taking the time to look into this.

@andresichelero commented on GitHub (May 6, 2025): > I think the issue is that the input video is 10-bit while your processor only supports 8-bit processing. The assertion means the input is in p010 or similar rather than nv12. It should work if you enable tone-mapping as this is currently done in software when hardware decoding is disabled. However, this is not a processor generation we're optimizing for and the behavior here can change in the future. It's much faster to move the tone-mapping to the hardware instead and only do the decoding in software, at which point this issue will reoccur. Thanks for the suggestion regarding 10-bit input. However, I've investigated further and confirmed the issue also occurs with an 8-bit HEVC input file. I triggered the transcoding again with **Hardware Decoding OFF** and **Tone Mapping ON** (set to Hable). The FFmpeg process still crashed with the exact same `SIGABRT` and assertion failure: `ffmpeg: i965_gpe_utils.c:518: gen7_gpe_set_surface2_state: Assertion 'obj_surface->fourcc == VA_FOURCC_NV12' failed.` Here is the `mediainfo` output for the specific 8-bit HEVC video that caused the crash this time: ``` General Complete name : /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250416_161723_904.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/mp41) File size : 6.16 MiB Duration : 10 s 194 ms Overall bit rate : 5 072 kb/s Frame rate : 30.200 FPS Writing application : Lavf56.40.101 Video ID : 2 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main@L4@Main Codec ID : hvc1 Codec ID/Info : High Efficiency Video Coding Duration : 10 s 0 ms Bit rate : 5 032 kb/s Width : 720 pixels Height : 1 280 pixels Display aspect ratio : 0.562 Frame rate : 30.200 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Bits/(Pixel*Frame) : 0.181 Stream size : 6.00 MiB (97%) Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709 Codec configuration box : hvcC Audio ID : 1 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : mp4a-40-2 Duration : 10 s 194 ms Bit rate mode : Constant Bit rate : 128 kb/s Channel(s) : 2 channels Channel layout : L R Sampling rate : 44.1 kHz Frame rate : 43.066 FPS (1024 SPF) Compression mode : Lossy Stream size : 159 KiB (3%) Default : Yes Alternate group : 1 ``` And here are the relevant FFmpeg logs showing the crash with this 8-bit input and Tone Mapping enabled: ``` [Nest] 7 - 05/05/2025, 10:11:00 PM LOG [Microservices:MediaService] Transcoding video 80289503-881a-44da-8a4d-293c702b26c6 with VAAPI-accelerated encoding and software decoding [Nest] 7 - 05/05/2025, 10:11:00 PM ERROR [Microservices:MediaRepository] ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 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=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=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 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100 [AVHWDeviceContext @ 0x3209e14c3c0] libva: VA-API version 1.22.0 [AVHWDeviceContext @ 0x3209e14c3c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so [AVHWDeviceContext @ 0x3209e14c3c0] libva: Found init function __vaDriverInit_1_22 [AVHWDeviceContext @ 0x3209e14c3c0] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed [AVHWDeviceContext @ 0x3209e14c3c0] libva: va_openDriver() returns 1 [AVHWDeviceContext @ 0x3209e14c3c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/i965_drv_video.so [AVHWDeviceContext @ 0x3209e14c3c0] libva: Found init function __vaDriverInit_1_22 [AVHWDeviceContext @ 0x3209e14c3c0] libva: va_openDriver() returns 0 [AVHWDeviceContext @ 0x3209e14c3c0] Initialised VAAPI connection: version 1.22 [AVHWDeviceContext @ 0x3209e14c3c0] VAAPI driver: Intel i965 driver for Intel(R) Haswell - 2.4.0.pre1 (). [AVHWDeviceContext @ 0x3209e14c3c0] Driver not found in known nonstandard list, using standard behaviour. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/ATLAS/nextcloud/data/foxtrot/files/EnvioAutomático/Instagram/VID_20250416_161723_904.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf56.40.101 Duration: 00:00:10.19, start: 0.000000, bitrate: 5072 kb/s Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Video: hevc (Main), 1 reference frame (hvc1 / 0x31637668), yuv420p(tv, bt709, left), 720x1280, 5031 kb/s, 30.20 fps, 30 tbr, 90k tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] [out#0/mp4 @ 0x3209e123c80] Adding streams from explicit maps... [vost#0:0/h264_vaapi @ 0x3209e1e4980] Created video stream from input stream 0:1 [aost#0:1/libopus @ 0x3209e1e4080] Created audio stream from input stream 0:0 Stream mapping: Stream #0:1 -> #0:0 (hevc (native) -> h264 (h264_vaapi)) Stream #0:0 -> #0:1 (aac (native) -> opus (libopus)) [vost#0:0/h264_vaapi @ 0x3209e1e4980] Starting thread... [aost#0:1/libopus @ 0x3209e1e4080] Starting thread... [vf#0:0 @ 0x3209e1f1940] Starting thread... [af#0:1 @ 0x3209e053c40] Starting thread... [vist#0:1/hevc @ 0x3209e320180] [dec:hevc @ 0x3209e182580] Starting thread... [aist#0:0/aac @ 0x3209e320880] [dec:aac @ 0x3209e0602c0] Starting thread... [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x3209e123a80] Starting thread... Press [q] to stop, [?] for help [graph_1_in_0:0 @ 0x320ae050300] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo [format_out_0_1 @ 0x320ae050480] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1' [auto_aresample_0 @ 0x320ae050540] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:flt r:48000Hz [libopus @ 0x3209e203180] No bit rate set. Defaulting to 96000 bps. [graph 0 input from stream 0:1 @ 0x320ac050300] w:720 h:1280 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:0/1 csp:bt709 range:tv [graph 0 input from stream 0:1 @ 0x320ac050300] video frame properties congruent with link at pts_time: 0 [h264_vaapi @ 0x3209e201580] Using input frames context (format vaapi) with h264_vaapi encoder. [h264_vaapi @ 0x3209e201580] Input surface format is yuv420p. [h264_vaapi @ 0x3209e201580] Using VAAPI profile VAProfileH264High (7). [h264_vaapi @ 0x3209e201580] Using VAAPI entrypoint VAEntrypointEncSlice (6). [h264_vaapi @ 0x3209e201580] Using VAAPI render target format YUV420 (0x1). [h264_vaapi @ 0x3209e201580] RC mode: CQP. [h264_vaapi @ 0x3209e201580] Block Level bitrate control: OFF. [h264_vaapi @ 0x3209e201580] RC quality: 25. [h264_vaapi @ 0x3209e201580] RC framerate: 30/1 (30.00 fps). [h264_vaapi @ 0x3209e201580] Driver does not report any additional prediction constraints. [h264_vaapi @ 0x3209e201580] Using intra and P-frames (supported references: 1 / 1). [h264_vaapi @ 0x3209e201580] All wanted packed headers available (wanted 0xd, found 0x1f). [h264_vaapi @ 0x3209e201580] Invalid quality level: valid range is 0-2, using 2. [h264_vaapi @ 0x3209e201580] Using level 3.1. Output #0, mp4, to 'upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/80/28/80289503-881a-44da-8a4d-293c702b26c6.mp4': Metadata: encoder : Lavf61.1.100 Stream #0:0: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), vaapi(tv, bt709, progressive, left), 720x1280, q=2-31, 30 fps, 15360 tbn (default) Metadata: encoder : Lavc61.3.100 h264_vaapi Stream #0:1: Audio: opus (Opus / 0x7375704F), 48000 Hz, stereo, flt, delay 312, 96 kb/s (default) Metadata: encoder : Lavc61.3.100 libopus [out#0/mp4 @ 0x3209e123c80] Starting thread... ffmpeg: i965_gpe_utils.c:518: gen7_gpe_set_surface2_state: Assertion `obj_surface->fourcc == VA_FOURCC_NV12' failed. [Nest] 7 - 05/05/2025, 10:11:00 PM ERROR [Microservices:MediaService] Error occurred during transcoding: ffmpeg was killed with signal SIGABRT [Nest] 7 - 05/05/2025, 10:11:00 PM ERROR [Microservices:MediaService] Retrying with VAAPI acceleration disabled ``` This confirms the problem is not specific to 10-bit input and seems to be a more general issue with the HEVC -> H.264 pipeline using the bundled i965 driver on Haswell hardware, even when the input is standard 8-bit. Anyway, I understand that this hardware generation is not a priority in terms of optimization, so please assign the level of urgency you deem appropriate. Thanks again for taking the time to look into this.
Author
Owner

@mertalev commented on GitHub (May 6, 2025):

Hmm, that's interesting. Can you set the log level to debug, try transcoding again and share the FFmpeg command outputted in the logs?

@mertalev commented on GitHub (May 6, 2025): Hmm, that's interesting. Can you set the log level to debug, try transcoding again and share the FFmpeg command outputted in the logs?
Author
Owner

@andresichelero commented on GitHub (May 6, 2025):

Hmm, that's interesting. Can you set the log level to debug, try transcoding again and share the FFmpeg command outputted in the logs?

Sure! I've set IMMICH_LOG_LEVEL=debug in the .env file and restarted the containers. I then triggered the transcoding for another 8-bit HEVC video file and here it is:

DEBUG [Microservices:MediaRepository] ffmpeg -n 10 /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf hwupload=extra_hw_frames=64 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4
@andresichelero commented on GitHub (May 6, 2025): > Hmm, that's interesting. Can you set the log level to debug, try transcoding again and share the FFmpeg command outputted in the logs? Sure! I've set `IMMICH_LOG_LEVEL=debug` in the `.env` file and restarted the containers. I then triggered the transcoding for another 8-bit HEVC video file and here it is: ``` DEBUG [Microservices:MediaRepository] ffmpeg -n 10 /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf hwupload=extra_hw_frames=64 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4 ```
Author
Owner

@mertalev commented on GitHub (May 6, 2025):

Can you run this and confirm if it succeeds?

docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf hwupload=extra_hw_frames=64,format=nv12 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4

@mertalev commented on GitHub (May 6, 2025): Can you run this and confirm if it succeeds? ``` docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf hwupload=extra_hw_frames=64,format=nv12 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4 ```
Author
Owner

@andresichelero commented on GitHub (May 6, 2025):

Can you run this and confirm if it succeeds?

docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf hwupload=extra_hw_frames=64,format=nv12 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4

Thanks for providing the specific command to test. I ran it inside the immich_server container as requested.

The command failed, but with a different error than the previous SIGABRT / assertion failure. This time, the error occurred during the FFmpeg filtergraph initialization phase.

Here is the full output:

foxtrot@vault:/home/immich-app$ sudo docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus
-movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf hwupload=extra_hw_frames=64,format=nv12 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-
d167-43e1-bda6-eaf4e1ee51d5.mp4
ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 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=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=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      59.  8.100 / 59.  8.100
  libavcodec     61.  3.100 / 61.  3.100
  libavformat    61.  1.100 / 61.  1.100
  libavdevice    61.  1.100 / 61.  1.100
  libavfilter    10.  1.100 / 10.  1.100
  libswscale      8.  1.100 /  8.  1.100
  libswresample   5.  1.100 /  5.  1.100
  libpostproc    58.  1.100 / 58.  1.100
[AVHWDeviceContext @ 0x647c7c142700] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x647c7c142700] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x647c7c142700] libva: Found init function __vaDriverInit_1_22
[AVHWDeviceContext @ 0x647c7c142700] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed
[AVHWDeviceContext @ 0x647c7c142700] libva: va_openDriver() returns 1
[AVHWDeviceContext @ 0x647c7c142700] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/i965_drv_video.so
[AVHWDeviceContext @ 0x647c7c142700] libva: Found init function __vaDriverInit_1_22
[AVHWDeviceContext @ 0x647c7c142700] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x647c7c142700] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x647c7c142700] VAAPI driver: Intel i965 driver for Intel(R) Haswell - 2.4.0.pre1 ().
[AVHWDeviceContext @ 0x647c7c142700] Driver not found in known nonstandard list, using standard behaviour.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/ATLAS/nextcloud/data/foxtrot/files/Instagram/VID_20250112_014405_412.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.40.101
  Duration: 00:00:43.93, start: 0.000000, bitrate: 5124 kb/s
  Stream #0:0[0x1](und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 69 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Video: hevc (Main), 1 reference frame (hvc1 / 0x31637668), yuv420p(tv, bt470bg/bt470bg/smpte170m, left), 720x1280, 5058 kb/s, 25.05 fps, 25 tbr, 16k tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
[out#0/mp4 @ 0x647c7c186540] Adding streams from explicit maps...
[vost#0:0/h264_vaapi @ 0x647c7c181980] Created video stream from input stream 0:1
[aost#0:1/libopus @ 0x647c7c76b200] Created audio stream from input stream 0:0
Stream mapping:
  Stream #0:1 -> #0:0 (hevc (native) -> h264 (h264_vaapi))
  Stream #0:0 -> #0:1 (aac (native) -> opus (libopus))
[vost#0:0/h264_vaapi @ 0x647c7c181980] Starting thread...
[aost#0:1/libopus @ 0x647c7c76b200] Starting thread...
[vf#0:0 @ 0x647c7c181f80] Starting thread...
[af#0:1 @ 0x647c7c1dd440] Starting thread...
[vist#0:1/hevc @ 0x647c7c1863c0] [dec:hevc @ 0x647c7c1811c0] Starting thread...
[aist#0:0/aac @ 0x647c7c1ccc40] [dec:aac @ 0x647c7c192340] Starting thread...
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Starting thread...
Press [q] to stop, [?] for help
[graph 0 input from stream 0:1 @ 0x71779c002880] w:720 h:1280 pixfmt:yuv420p tb:1/16000 fr:25/1 sar:0/1 csp:bt470bg range:tv
[auto_scale_0 @ 0x71779c004780] w:iw h:ih flags:'' interl:0
[Parsed_format_1 @ 0x71779c0020c0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_hwupload_0' and the filter 'Parsed_format_1'
Impossible to convert between the formats supported by the filter 'Parsed_hwupload_0' and the filter 'auto_scale_0'
[vf#0:0 @ 0x647c7c181f80] Error reinitializing filters!
[vf#0:0 @ 0x647c7c181f80] Task finished with error code: -38 (Function not implemented)
[vist#0:1/hevc @ 0x647c7c1863c0] [dec:hevc @ 0x647c7c1811c0] Decoder returned EOF, finishing
[vist#0:1/hevc @ 0x647c7c1863c0] All consumers of this stream are done
[vist#0:1/hevc @ 0x647c7c1863c0] [dec:hevc @ 0x647c7c1811c0] Terminating thread with return code 0 (success)
[vf#0:0 @ 0x647c7c181f80] Terminating thread with return code -38 (Function not implemented)
[graph_1_in_0:0 @ 0x7177a0001840] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo
[format_out_0_1 @ 0x7177a0002080] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
[auto_aresample_0 @ 0x7177a0002dc0] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:flt r:48000Hz
[libopus @ 0x647c7c76b580] No bit rate set. Defaulting to 96000 bps.
[libopus @ 0x647c7c76b580] Queue input is backward in time
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Terminating thread with return code 0 (success)
[aist#0:0/aac @ 0x647c7c1ccc40] [dec:aac @ 0x647c7c192340] Decoder thread received EOF packet
[aist#0:0/aac @ 0x647c7c1ccc40] [dec:aac @ 0x647c7c192340] Decoder returned EOF, finishing
[aist#0:0/aac @ 0x647c7c1ccc40] [dec:aac @ 0x647c7c192340] Terminating thread with return code 0 (success)
[af#0:1 @ 0x647c7c1dd440] Filtergraph returned EOF, finishing
[af#0:1 @ 0x647c7c1dd440] All consumers returned EOF
[vost#0:0/h264_vaapi @ 0x647c7c181980] Encoder thread received EOF
[vost#0:0/h264_vaapi @ 0x647c7c181980] Could not open encoder before EOF
[vost#0:0/h264_vaapi @ 0x647c7c181980] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_vaapi @ 0x647c7c181980] Terminating thread with return code -22 (Invalid argument)
[aost#0:1/libopus @ 0x647c7c76b200] Encoder thread received EOF
[aost#0:1/libopus @ 0x647c7c76b200] Terminating thread with return code 0 (success)
[af#0:1 @ 0x647c7c1dd440] Terminating thread with return code 0 (success)
[out#0/mp4 @ 0x647c7c186540] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A
[AVIOContext @ 0x647c7c83e740] Statistics: 0 bytes written, 0 seeks, 0 writeouts
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Input file #0 (/mnt/ATLAS/nextcloud/data/foxtrot/files/EnvioAutomático/Instagram/VID_20250112_014405_412.mp4):
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000]   Input stream #0:0 (audio): 572 packets read (232054 bytes); 571 frames decoded; 0 decode errors (1168928 samples);
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000]   Input stream #0:1 (video): 16 packets read (362028 bytes); 3 frames decoded; 0 decode errors;
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000]   Total: 588 packets (594082 bytes) demuxed
[AVIOContext @ 0x647c7c16c180] Statistics: 42171535 bytes read, 1145 seeks
Conversion failed!

Error messages:

  • Impossible to convert between the formats supported by the filter 'Parsed_hwupload_0' and the filter 'auto_scale_0'
  • [vf#0:0 @ 0x647c7c181f80] Error reinitializing filters!
  • [vf#0:0 @ 0x647c7c181f80] Task finished with error code: -38 (Function not implemented)

It appears the failure is happening within FFmpeg's filter setup, rather than the previous crash inside the i965 driver itself.

@andresichelero commented on GitHub (May 6, 2025): > Can you run this and confirm if it succeeds? > > ``` > docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf hwupload=extra_hw_frames=64,format=nv12 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4 > ``` Thanks for providing the specific command to test. I ran it inside the `immich_server` container as requested. The command **failed**, but with a **different error** than the previous `SIGABRT` / assertion failure. This time, the error occurred during the FFmpeg filtergraph initialization phase. Here is the full output: ``` foxtrot@vault:/home/immich-app$ sudo docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf hwupload=extra_hw_frames=64,format=nv12 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d- d167-43e1-bda6-eaf4e1ee51d5.mp4 ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 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=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=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 59. 8.100 / 59. 8.100 libavcodec 61. 3.100 / 61. 3.100 libavformat 61. 1.100 / 61. 1.100 libavdevice 61. 1.100 / 61. 1.100 libavfilter 10. 1.100 / 10. 1.100 libswscale 8. 1.100 / 8. 1.100 libswresample 5. 1.100 / 5. 1.100 libpostproc 58. 1.100 / 58. 1.100 [AVHWDeviceContext @ 0x647c7c142700] libva: VA-API version 1.22.0 [AVHWDeviceContext @ 0x647c7c142700] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so [AVHWDeviceContext @ 0x647c7c142700] libva: Found init function __vaDriverInit_1_22 [AVHWDeviceContext @ 0x647c7c142700] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so init failed [AVHWDeviceContext @ 0x647c7c142700] libva: va_openDriver() returns 1 [AVHWDeviceContext @ 0x647c7c142700] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/i965_drv_video.so [AVHWDeviceContext @ 0x647c7c142700] libva: Found init function __vaDriverInit_1_22 [AVHWDeviceContext @ 0x647c7c142700] libva: va_openDriver() returns 0 [AVHWDeviceContext @ 0x647c7c142700] Initialised VAAPI connection: version 1.22 [AVHWDeviceContext @ 0x647c7c142700] VAAPI driver: Intel i965 driver for Intel(R) Haswell - 2.4.0.pre1 (). [AVHWDeviceContext @ 0x647c7c142700] Driver not found in known nonstandard list, using standard behaviour. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/ATLAS/nextcloud/data/foxtrot/files/Instagram/VID_20250112_014405_412.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2mp41 encoder : Lavf56.40.101 Duration: 00:00:43.93, start: 0.000000, bitrate: 5124 kb/s Stream #0:0[0x1](und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 69 kb/s (default) Metadata: handler_name : SoundHandler vendor_id : [0][0][0][0] Stream #0:1[0x2](und): Video: hevc (Main), 1 reference frame (hvc1 / 0x31637668), yuv420p(tv, bt470bg/bt470bg/smpte170m, left), 720x1280, 5058 kb/s, 25.05 fps, 25 tbr, 16k tbn (default) Metadata: handler_name : VideoHandler vendor_id : [0][0][0][0] [out#0/mp4 @ 0x647c7c186540] Adding streams from explicit maps... [vost#0:0/h264_vaapi @ 0x647c7c181980] Created video stream from input stream 0:1 [aost#0:1/libopus @ 0x647c7c76b200] Created audio stream from input stream 0:0 Stream mapping: Stream #0:1 -> #0:0 (hevc (native) -> h264 (h264_vaapi)) Stream #0:0 -> #0:1 (aac (native) -> opus (libopus)) [vost#0:0/h264_vaapi @ 0x647c7c181980] Starting thread... [aost#0:1/libopus @ 0x647c7c76b200] Starting thread... [vf#0:0 @ 0x647c7c181f80] Starting thread... [af#0:1 @ 0x647c7c1dd440] Starting thread... [vist#0:1/hevc @ 0x647c7c1863c0] [dec:hevc @ 0x647c7c1811c0] Starting thread... [aist#0:0/aac @ 0x647c7c1ccc40] [dec:aac @ 0x647c7c192340] Starting thread... [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Starting thread... Press [q] to stop, [?] for help [graph 0 input from stream 0:1 @ 0x71779c002880] w:720 h:1280 pixfmt:yuv420p tb:1/16000 fr:25/1 sar:0/1 csp:bt470bg range:tv [auto_scale_0 @ 0x71779c004780] w:iw h:ih flags:'' interl:0 [Parsed_format_1 @ 0x71779c0020c0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_hwupload_0' and the filter 'Parsed_format_1' Impossible to convert between the formats supported by the filter 'Parsed_hwupload_0' and the filter 'auto_scale_0' [vf#0:0 @ 0x647c7c181f80] Error reinitializing filters! [vf#0:0 @ 0x647c7c181f80] Task finished with error code: -38 (Function not implemented) [vist#0:1/hevc @ 0x647c7c1863c0] [dec:hevc @ 0x647c7c1811c0] Decoder returned EOF, finishing [vist#0:1/hevc @ 0x647c7c1863c0] All consumers of this stream are done [vist#0:1/hevc @ 0x647c7c1863c0] [dec:hevc @ 0x647c7c1811c0] Terminating thread with return code 0 (success) [vf#0:0 @ 0x647c7c181f80] Terminating thread with return code -38 (Function not implemented) [graph_1_in_0:0 @ 0x7177a0001840] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo [format_out_0_1 @ 0x7177a0002080] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1' [auto_aresample_0 @ 0x7177a0002dc0] ch:2 chl:stereo fmt:fltp r:44100Hz -> ch:2 chl:stereo fmt:flt r:48000Hz [libopus @ 0x647c7c76b580] No bit rate set. Defaulting to 96000 bps. [libopus @ 0x647c7c76b580] Queue input is backward in time [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Terminating thread with return code 0 (success) [aist#0:0/aac @ 0x647c7c1ccc40] [dec:aac @ 0x647c7c192340] Decoder thread received EOF packet [aist#0:0/aac @ 0x647c7c1ccc40] [dec:aac @ 0x647c7c192340] Decoder returned EOF, finishing [aist#0:0/aac @ 0x647c7c1ccc40] [dec:aac @ 0x647c7c192340] Terminating thread with return code 0 (success) [af#0:1 @ 0x647c7c1dd440] Filtergraph returned EOF, finishing [af#0:1 @ 0x647c7c1dd440] All consumers returned EOF [vost#0:0/h264_vaapi @ 0x647c7c181980] Encoder thread received EOF [vost#0:0/h264_vaapi @ 0x647c7c181980] Could not open encoder before EOF [vost#0:0/h264_vaapi @ 0x647c7c181980] Task finished with error code: -22 (Invalid argument) [vost#0:0/h264_vaapi @ 0x647c7c181980] Terminating thread with return code -22 (Invalid argument) [aost#0:1/libopus @ 0x647c7c76b200] Encoder thread received EOF [aost#0:1/libopus @ 0x647c7c76b200] Terminating thread with return code 0 (success) [af#0:1 @ 0x647c7c1dd440] Terminating thread with return code 0 (success) [out#0/mp4 @ 0x647c7c186540] Nothing was written into output file, because at least one of its streams received no packets. frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A [AVIOContext @ 0x647c7c83e740] Statistics: 0 bytes written, 0 seeks, 0 writeouts [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Input file #0 (/mnt/ATLAS/nextcloud/data/foxtrot/files/EnvioAutomático/Instagram/VID_20250112_014405_412.mp4): [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Input stream #0:0 (audio): 572 packets read (232054 bytes); 571 frames decoded; 0 decode errors (1168928 samples); [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Input stream #0:1 (video): 16 packets read (362028 bytes); 3 frames decoded; 0 decode errors; [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x647c7c17e000] Total: 588 packets (594082 bytes) demuxed [AVIOContext @ 0x647c7c16c180] Statistics: 42171535 bytes read, 1145 seeks Conversion failed! ``` Error messages: * `Impossible to convert between the formats supported by the filter 'Parsed_hwupload_0' and the filter 'auto_scale_0'` * `[vf#0:0 @ 0x647c7c181f80] Error reinitializing filters!` * `[vf#0:0 @ 0x647c7c181f80] Task finished with error code: -38 (Function not implemented)` It appears the failure is happening within FFmpeg's filter setup, rather than the previous crash inside the i965 driver itself.
Author
Owner

@andresichelero commented on GitHub (May 6, 2025):

I also ran the same command with debug instead of verbose and got a bit more info:

[format @ 0x7372c80030c0] Setting 'pix_fmts' to value 'vaapi'
[hevc @ 0x5b3ec03797c0] Decoded frame with POC 2.
[hevc @ 0x5b3ec03c8640] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[auto_scale_0 @ 0x7372c8004780] w:iw h:ih flags:'' interl:0
[Parsed_format_1 @ 0x7372c80020c0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_hwupload_0' and the filter 'Parsed_format_1'
Impossible to convert between the formats supported by the filter 'Parsed_hwupload_0' and the filter 'auto_scale_0'
[hevc @ 0x5b3ec03b38c0] Decoded frame with POC 3.
[vf#0:0 @ 0x5b3ec035df80] Error reinitializing filters!
@andresichelero commented on GitHub (May 6, 2025): I also ran the same command with debug instead of verbose and got a bit more info: ``` [format @ 0x7372c80030c0] Setting 'pix_fmts' to value 'vaapi' [hevc @ 0x5b3ec03797c0] Decoded frame with POC 2. [hevc @ 0x5b3ec03c8640] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0 [auto_scale_0 @ 0x7372c8004780] w:iw h:ih flags:'' interl:0 [Parsed_format_1 @ 0x7372c80020c0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_hwupload_0' and the filter 'Parsed_format_1' Impossible to convert between the formats supported by the filter 'Parsed_hwupload_0' and the filter 'auto_scale_0' [hevc @ 0x5b3ec03b38c0] Decoded frame with POC 3. [vf#0:0 @ 0x5b3ec035df80] Error reinitializing filters! ```
Author
Owner

@mertalev commented on GitHub (May 6, 2025):

How about if you switch the order of format=nv12 and hwupload:

docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf format=nv12,hwupload=extra_hw_frames=64 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4
@mertalev commented on GitHub (May 6, 2025): How about if you switch the order of `format=nv12` and `hwupload`: ``` docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf format=nv12,hwupload=extra_hw_frames=64 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4 ```
Author
Owner

@andresichelero commented on GitHub (May 6, 2025):

How about if you switch the order of format=nv12 and hwupload:

docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf format=nv12,hwupload=extra_hw_frames=64 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4

Wow, that absolutely did the trick! 🎉

Solution: adding the format=nv12 filter to the ffmpeg command, with filter order set to -vf format=nv12,hwupload=extra_hw_frames=64.

Can confirm that the resultant file is working too. The only logs about the filters now is [format_out_0_1 @ 0x748c98002740] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'

mediainfo from the result file (for reference if needed):

foxtrot@vault:/home$ mediainfo 6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4
General
Complete name                            : 6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 16.6 MiB
Duration                                 : 43 s 933 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 3 172 kb/s
Frame rate                               : 25.000 FPS
Writing application                      : Lavf61.1.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Constrained High@L3.1
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 43 s 880 ms
Bit rate                                 : 3 087 kb/s
Width                                    : 720 pixels
Height                                   : 1 280 pixels
Display aspect ratio                     : 0.562
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.134
Stream size                              : 16.1 MiB (97%)
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.601
Matrix coefficients                      : BT.470 System B/G
Codec configuration box                  : avcC

Thank you for your help! I really appreciate you taking the time to guide me through the troubleshooting steps and providing the specific commands to test.

@andresichelero commented on GitHub (May 6, 2025): > How about if you switch the order of `format=nv12` and `hwupload`: > > ``` > docker exec immich_server /usr/bin/ffmpeg -init_hw_device vaapi=accel:/dev/dri/renderD128 -filter_hw_device accel -i /mnt/ATLAS/nextcloud/data/foxtrot/files/VID_20250112_014405_412.mp4 -y -c:v h264_vaapi -c:a libopus -movflags faststart -fps_mode passthrough -map 0:1 -map_metadata -1 -map 0:0 -bf 0 -g 256 -v verbose -vf format=nv12,hwupload=extra_hw_frames=64 -compression_level 7 -qp:v 23 -global_quality:v 23 -rc_mode 1 upload/encoded-video/2a4d9f48-c219-463a-8dd6-843f3a885dfb/60/39/6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4 > ``` **Wow, that absolutely did the trick!** 🎉 **Solution**: adding the `format=nv12` filter to the ffmpeg command, with filter order set to `-vf format=nv12,hwupload=extra_hw_frames=64`. Can confirm that the resultant file is working too. The only logs about the filters now is `[format_out_0_1 @ 0x748c98002740] auto-inserting filter 'auto_aresample_0' between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'` `mediainfo` from the result file (for reference if needed): ``` foxtrot@vault:/home$ mediainfo 6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4 General Complete name : 6039768d-d167-43e1-bda6-eaf4e1ee51d5.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 16.6 MiB Duration : 43 s 933 ms Overall bit rate mode : Variable Overall bit rate : 3 172 kb/s Frame rate : 25.000 FPS Writing application : Lavf61.1.100 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Constrained High@L3.1 Format settings : CABAC / 1 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 1 frame Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 43 s 880 ms Bit rate : 3 087 kb/s Width : 720 pixels Height : 1 280 pixels Display aspect ratio : 0.562 Frame rate mode : Constant Frame rate : 25.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.134 Stream size : 16.1 MiB (97%) Color range : Limited Color primaries : BT.601 PAL Transfer characteristics : BT.601 Matrix coefficients : BT.470 System B/G Codec configuration box : avcC ``` Thank you for your help! I really appreciate you taking the time to guide me through the troubleshooting steps and providing the specific commands to test.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5968