Error when trasconding using NVENC #4013

Closed
opened 2026-02-05 09:36:22 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @felipequintella on GitHub (Aug 2, 2024).

The bug

I have setup a remote microsservices container to have hardware transcoding capabilities. I have an NVidia RTX2080 with updated drivers.
Some videos show an error when starting transcode and revert back to non-hardware accelerated.
I'm new to Immich, any help would be appreciated!

The OS that Immich Server is running on

WSL2

Version of Immich Server

v1.111.0

Version of Immich Mobile App

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

This is the remote microsservice docker compose:
name: immich-micro

services:
  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: nvenc # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: ['start.sh', 'microservices']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - photo:/photo
    env_file:
      - .env
    restart: always

volumes:
  library:
    driver_opts:
      type: cifs
      o: rw,username=immich,password=*******,vers=2.0,file_mode=0777,dir_mode=0777
      device: //192.168.1.6/library
  photo:
    driver_opts:
      type: cifs
      o: username=immich,password=*******,vers=1.0
      device: //192.168.1.106/photo

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=library

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=*******

DB_HOSTNAME=192.168.1.6 # replace with theLAN ip of the machine hosting your Postgres/redis, same below
REDIS_HOSTNAME=192.168.1.6

TZ=Americas/Sao_Paulo

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

Reproduction steps

1. Install microservices with NVENC
2. Trigger video transcoding
3. Error happens on logs
...

Relevant log output

2024-08-02 14:32:18 [Nest] 7  - 08/02/2024, 5:32:18 PM   ERROR [Microservices:MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
2024-08-02 14:32:18   built with gcc 12 (Debian 12.2.0-14)
2024-08-02 14:32:18   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
2024-08-02 14:32:18   libavutil      58.  2.100 / 58.  2.100
2024-08-02 14:32:18   libavcodec     60.  3.100 / 60.  3.100
2024-08-02 14:32:18   libavformat    60.  3.100 / 60.  3.100
2024-08-02 14:32:18   libavdevice    60.  1.100 / 60.  1.100
2024-08-02 14:32:18   libavfilter     9.  3.100 /  9.  3.100
2024-08-02 14:32:18   libswscale      7.  1.100 /  7.  1.100
2024-08-02 14:32:18   libswresample   4. 10.100 /  4. 10.100
2024-08-02 14:32:18   libpostproc    57.  1.100 / 57.  1.100
2024-08-02 14:32:18 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2be68160180] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1001
2024-08-02 14:32:18 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2be68160180] st: 0 edit list 1 Cannot find an index entry before timestamp: 1001.
2024-08-02 14:32:18 [h264 @ 0x2be68050580] Reinit context to 1920x1088, pix_fmt: yuv420p
2024-08-02 14:32:18 Selecting decoder 'h264' because of requested hwaccel method cuda
2024-08-02 14:32:18 Guessed Channel Layout for Input Stream #0.1 : stereo
2024-08-02 14:32:18 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/photo/Jersey/20230402-200942_C0737.mp4':
2024-08-02 14:32:18   Metadata:
2024-08-02 14:32:18     major_brand     : XAVC
2024-08-02 14:32:18     minor_version   : 16785407
2024-08-02 14:32:18     compatible_brands: XAVCmp42iso2
2024-08-02 14:32:18     creation_time   : 2023-04-02T20:09:42.000000Z
2024-08-02 14:32:18   Duration: 00:00:12.02, start: 0.000000, bitrate: 100552 kb/s
2024-08-02 14:32:18   Stream #0:0[0x1](und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt2020nc/bt2020/arib-std-b67, progressive, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 93744 kb/s, 119.88 fps, 119.88 tbr, 120k tbn (default)
2024-08-02 14:32:18     Metadata:
2024-08-02 14:32:18       creation_time   : 2023-04-02T20:09:42.000000Z
2024-08-02 14:32:18       handler_name    : Video Media Handler
2024-08-02 14:32:18       vendor_id       : [0][0][0][0]
2024-08-02 14:32:18       encoder         : AVC Coding
2024-08-02 14:32:18     Side data:
2024-08-02 14:32:18       displaymatrix: rotation of 90.00 degrees
2024-08-02 14:32:18   Stream #0:1[0x2](und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
2024-08-02 14:32:18     Metadata:
2024-08-02 14:32:18       creation_time   : 2023-04-02T20:09:42.000000Z
2024-08-02 14:32:18       handler_name    : Sound Media Handler
2024-08-02 14:32:18       vendor_id       : [0][0][0][0]
2024-08-02 14:32:18   Stream #0:2[0x3](und): Data: none (rtmd / 0x646D7472), 4910 kb/s (default)
2024-08-02 14:32:18     Metadata:
2024-08-02 14:32:18       creation_time   : 2023-04-02T20:09:42.000000Z
2024-08-02 14:32:18       handler_name    : Timed Metadata Media Handler
2024-08-02 14:32:18       timecode        : 00:34:59:76
2024-08-02 14:32:18 Stream mapping:
2024-08-02 14:32:18   Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
2024-08-02 14:32:18   Stream #0:1 -> #0:1 (pcm_s16be (native) -> aac (native))
2024-08-02 14:32:18 Press [q] to stop, [?] for help
2024-08-02 14:32:18 [h264 @ 0x2be68051580] NVDEC capabilities:
2024-08-02 14:32:18 [h264 @ 0x2be68051580] format supported: yes, max_mb_count: 65536
2024-08-02 14:32:18 [h264 @ 0x2be68051580] min_width: 48, max_width: 4096
2024-08-02 14:32:18 [h264 @ 0x2be68051580] min_height: 16, max_height: 4096
2024-08-02 14:32:18 [h264 @ 0x2be68051580] Reinit context to 1920x1088, pix_fmt: cuda
2024-08-02 14:32:18 [graph 0 input from stream 0:0 @ 0x2be68176900] w:1920 h:1080 pixfmt:cuda tb:1/120000 fr:120000/1001 sar:1/1
2024-08-02 14:32:18 [Parsed_scale_cuda_0 @ 0x2be68176780] w:1920 h:1080 -> w:720 h:406
2024-08-02 14:32:18 [Parsed_tonemap_cuda_1 @ 0x2be68176840] Unsupported input format depth: 8
2024-08-02 14:32:18 [Parsed_tonemap_cuda_1 @ 0x2be68176840] Failed to configure output pad on Parsed_tonemap_cuda_1
2024-08-02 14:32:18 Error reinitializing filters!
2024-08-02 14:32:18 Failed to inject frame into filter network: Function not implemented
2024-08-02 14:32:18 Error while processing the decoded data for stream #0:0
2024-08-02 14:32:18 [AVIOContext @ 0x2be683602c0] Statistics: 0 bytes written, 0 seeks, 0 writeouts
2024-08-02 14:32:18 Terminating demuxer thread 0
2024-08-02 14:32:18 [AVIOContext @ 0x2be681a0180] Statistics: 5112744 bytes read, 4 seeks
2024-08-02 14:32:18 Conversion failed!
2024-08-02 14:32:18 
2024-08-02 14:32:18 [Nest] 7  - 08/02/2024, 5:32:18 PM   ERROR [Microservices:MediaService] Error: ffmpeg exited with code 1: Conversion failed!
2024-08-02 14:32:18 
2024-08-02 14:32:18 [Nest] 7  - 08/02/2024, 5:32:18 PM   ERROR [Microservices:MediaService] Error occurred during transcoding. Retrying with NVENC acceleration disabled.

Additional information

No response

Originally created by @felipequintella on GitHub (Aug 2, 2024). ### The bug I have setup a remote microsservices container to have hardware transcoding capabilities. I have an NVidia RTX2080 with updated drivers. Some videos show an error when starting transcode and revert back to non-hardware accelerated. I'm new to Immich, any help would be appreciated! ### The OS that Immich Server is running on WSL2 ### Version of Immich Server v1.111.0 ### Version of Immich Mobile App - ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML This is the remote microsservice docker compose: name: immich-micro services: 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: nvenc # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding command: ['start.sh', 'microservices'] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro - photo:/photo env_file: - .env restart: always volumes: library: driver_opts: type: cifs o: rw,username=immich,password=*******,vers=2.0,file_mode=0777,dir_mode=0777 device: //192.168.1.6/library photo: driver_opts: type: cifs o: username=immich,password=*******,vers=1.0 device: //192.168.1.106/photo ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=library # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password DB_PASSWORD=******* DB_HOSTNAME=192.168.1.6 # replace with theLAN ip of the machine hosting your Postgres/redis, same below REDIS_HOSTNAME=192.168.1.6 TZ=Americas/Sao_Paulo # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps ```bash 1. Install microservices with NVENC 2. Trigger video transcoding 3. Error happens on logs ... ``` ### Relevant log output ```shell 2024-08-02 14:32:18 [Nest] 7 - 08/02/2024, 5:32:18 PM ERROR [Microservices:MediaRepository] ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers 2024-08-02 14:32:18 built with gcc 12 (Debian 12.2.0-14) 2024-08-02 14:32:18 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 2024-08-02 14:32:18 libavutil 58. 2.100 / 58. 2.100 2024-08-02 14:32:18 libavcodec 60. 3.100 / 60. 3.100 2024-08-02 14:32:18 libavformat 60. 3.100 / 60. 3.100 2024-08-02 14:32:18 libavdevice 60. 1.100 / 60. 1.100 2024-08-02 14:32:18 libavfilter 9. 3.100 / 9. 3.100 2024-08-02 14:32:18 libswscale 7. 1.100 / 7. 1.100 2024-08-02 14:32:18 libswresample 4. 10.100 / 4. 10.100 2024-08-02 14:32:18 libpostproc 57. 1.100 / 57. 1.100 2024-08-02 14:32:18 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2be68160180] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1001 2024-08-02 14:32:18 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2be68160180] st: 0 edit list 1 Cannot find an index entry before timestamp: 1001. 2024-08-02 14:32:18 [h264 @ 0x2be68050580] Reinit context to 1920x1088, pix_fmt: yuv420p 2024-08-02 14:32:18 Selecting decoder 'h264' because of requested hwaccel method cuda 2024-08-02 14:32:18 Guessed Channel Layout for Input Stream #0.1 : stereo 2024-08-02 14:32:18 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/photo/Jersey/20230402-200942_C0737.mp4': 2024-08-02 14:32:18 Metadata: 2024-08-02 14:32:18 major_brand : XAVC 2024-08-02 14:32:18 minor_version : 16785407 2024-08-02 14:32:18 compatible_brands: XAVCmp42iso2 2024-08-02 14:32:18 creation_time : 2023-04-02T20:09:42.000000Z 2024-08-02 14:32:18 Duration: 00:00:12.02, start: 0.000000, bitrate: 100552 kb/s 2024-08-02 14:32:18 Stream #0:0[0x1](und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt2020nc/bt2020/arib-std-b67, progressive, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 93744 kb/s, 119.88 fps, 119.88 tbr, 120k tbn (default) 2024-08-02 14:32:18 Metadata: 2024-08-02 14:32:18 creation_time : 2023-04-02T20:09:42.000000Z 2024-08-02 14:32:18 handler_name : Video Media Handler 2024-08-02 14:32:18 vendor_id : [0][0][0][0] 2024-08-02 14:32:18 encoder : AVC Coding 2024-08-02 14:32:18 Side data: 2024-08-02 14:32:18 displaymatrix: rotation of 90.00 degrees 2024-08-02 14:32:18 Stream #0:1[0x2](und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s (default) 2024-08-02 14:32:18 Metadata: 2024-08-02 14:32:18 creation_time : 2023-04-02T20:09:42.000000Z 2024-08-02 14:32:18 handler_name : Sound Media Handler 2024-08-02 14:32:18 vendor_id : [0][0][0][0] 2024-08-02 14:32:18 Stream #0:2[0x3](und): Data: none (rtmd / 0x646D7472), 4910 kb/s (default) 2024-08-02 14:32:18 Metadata: 2024-08-02 14:32:18 creation_time : 2023-04-02T20:09:42.000000Z 2024-08-02 14:32:18 handler_name : Timed Metadata Media Handler 2024-08-02 14:32:18 timecode : 00:34:59:76 2024-08-02 14:32:18 Stream mapping: 2024-08-02 14:32:18 Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc)) 2024-08-02 14:32:18 Stream #0:1 -> #0:1 (pcm_s16be (native) -> aac (native)) 2024-08-02 14:32:18 Press [q] to stop, [?] for help 2024-08-02 14:32:18 [h264 @ 0x2be68051580] NVDEC capabilities: 2024-08-02 14:32:18 [h264 @ 0x2be68051580] format supported: yes, max_mb_count: 65536 2024-08-02 14:32:18 [h264 @ 0x2be68051580] min_width: 48, max_width: 4096 2024-08-02 14:32:18 [h264 @ 0x2be68051580] min_height: 16, max_height: 4096 2024-08-02 14:32:18 [h264 @ 0x2be68051580] Reinit context to 1920x1088, pix_fmt: cuda 2024-08-02 14:32:18 [graph 0 input from stream 0:0 @ 0x2be68176900] w:1920 h:1080 pixfmt:cuda tb:1/120000 fr:120000/1001 sar:1/1 2024-08-02 14:32:18 [Parsed_scale_cuda_0 @ 0x2be68176780] w:1920 h:1080 -> w:720 h:406 2024-08-02 14:32:18 [Parsed_tonemap_cuda_1 @ 0x2be68176840] Unsupported input format depth: 8 2024-08-02 14:32:18 [Parsed_tonemap_cuda_1 @ 0x2be68176840] Failed to configure output pad on Parsed_tonemap_cuda_1 2024-08-02 14:32:18 Error reinitializing filters! 2024-08-02 14:32:18 Failed to inject frame into filter network: Function not implemented 2024-08-02 14:32:18 Error while processing the decoded data for stream #0:0 2024-08-02 14:32:18 [AVIOContext @ 0x2be683602c0] Statistics: 0 bytes written, 0 seeks, 0 writeouts 2024-08-02 14:32:18 Terminating demuxer thread 0 2024-08-02 14:32:18 [AVIOContext @ 0x2be681a0180] Statistics: 5112744 bytes read, 4 seeks 2024-08-02 14:32:18 Conversion failed! 2024-08-02 14:32:18 2024-08-02 14:32:18 [Nest] 7 - 08/02/2024, 5:32:18 PM ERROR [Microservices:MediaService] Error: ffmpeg exited with code 1: Conversion failed! 2024-08-02 14:32:18 2024-08-02 14:32:18 [Nest] 7 - 08/02/2024, 5:32:18 PM ERROR [Microservices:MediaService] Error occurred during transcoding. Retrying with NVENC acceleration disabled. ``` ### Additional information _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#4013