[BUG] Hardware encoding not working when using HEVC (NVIDIA card) #1232

Closed
opened 2026-02-05 00:57:39 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @Kidsnd274 on GitHub (Aug 15, 2023).

The bug

When selecting HEVC as the codec for transcoded videos, hardware encoding does not seem to work, and encoding seems to be done only by the CPU. However, when selecting h264 as the codec, hardware encoding works correctly with the "Video Encode" portion of the graphics card showing GPU usage.

The GPU I am using is the NVIDIA GTX 1070, and under the NVENC GPU Support Matrix, it says that this card should be able to encode with HEVC.

NVIDIA driver version is 528.02 and I am running Windows 10 22H2 with Docker Desktop 4.22.0 (117440).

The OS that Immich Server is running on

Windows 10 (Docker Desktop)

Version of Immich Server

v1.73.0

Version of Immich Mobile App

v1.73.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.yml
      service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - .env
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
    volumes:
      - tsdata:/data
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release}
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    depends_on:
      - immich-server
      - immich-web
    restart: always

volumes:
  pgdata:
  model-cache:
  tsdata:

Your .env content

###################################################################################
# Database
###################################################################################

# NOTE: The following four database variables support Docker secrets by adding a *_FILE suffix to the variable name
# See the docker-compose documentation on secrets for additional details: https://docs.docker.com/compose/compose-file/compose-file-v3/#secrets
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=*
DB_DATABASE_NAME=immich

# Optional Database settings:
# DB_PORT=5432

###################################################################################
# Redis
###################################################################################

REDIS_HOSTNAME=immich_redis

# REDIS_URL will be used to pass custom options to ioredis.
# Example for Sentinel
# {"sentinels":[{"host":"redis-sentinel-node-0","port":26379},{"host":"redis-sentinel-node-1","port":26379},{"host":"redis-sentinel-node-2","port":26379}],"name":"redis-sentinel"}
# REDIS_URL=ioredis://eyJzZW50aW5lbHMiOlt7Imhvc3QiOiJyZWRpcy1zZW50aW5lbDEiLCJwb3J0IjoyNjM3OX0seyJob3N0IjoicmVkaXMtc2VudGluZWwyIiwicG9ydCI6MjYzNzl9XSwibmFtZSI6Im15bWFzdGVyIn0=

# Optional Redis settings:

# Note: these parameters are not automatically passed to the Redis Container
# to do so, please edit the docker-compose.yml file as well. Redis is not configured
# via environment variables, only redis.conf or the command line

# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_USERNAME=
# REDIS_PASSWORD=
# REDIS_SOCKET=

###################################################################################
# Upload File Location
#
# This is the location where uploaded files are stored.
###################################################################################

UPLOAD_LOCATION=O:\docker_data\immich_data


###################################################################################
# Typesense
###################################################################################
TYPESENSE_API_KEY=*
# TYPESENSE_ENABLED=false
# TYPESENSE_URL uses base64 encoding for the nodes json.
# Example JSON that was used:
# [
#      { "host": "typesense-1.example.net", "port": "443", "protocol": "https" },
#      { "host": "typesense-2.example.net", "port": "443", "protocol": "https" },
#      { "host": "typesense-3.example.net", "port": "443", "protocol": "https" },
# ]
# TYPESENSE_URL=ha://WwogIHsgImhvc3QiOiAidHlwZXNlbnNlLTEuZXhhbXBsZS5uZXQiLCAicG9ydCI6ICI0NDMiLCAicHJvdG9jb2wiOiAiaHR0cHMiIH0sCiAgeyAiaG9zdCI6ICJ0eXBlc2Vuc2UtMi5leGFtcGxlLm5ldCIsICJwb3J0IjogIjQ0MyIsICJwcm90b2NvbCI6ICJodHRwcyIgfSwKICB7ICJob3N0IjogInR5cGVzZW5zZS0zLmV4YW1wbGUubmV0IiwgInBvcnQiOiAiNDQzIiwgInByb3RvY29sIjogImh0dHBzIiB9Cl0=

###################################################################################
# Reverse Geocoding
#
# Reverse geocoding is done locally which has a small impact on memory usage
# This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable
# This ranges from 0-3 with 3 being the most precise
# 3 - Cities > 500 population: ~200MB RAM
# 2 - Cities > 1000 population: ~150MB RAM
# 1 - Cities > 5000 population: ~80MB RAM
# 0 - Cities > 15000 population: ~40MB RAM
####################################################################################

# DISABLE_REVERSE_GEOCODING=false
# REVERSE_GEOCODING_PRECISION=3

####################################################################################
# WEB - Optional
#
# Custom message on the login page, should be written in HTML form.
# For example:
# PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>demo@demo.de</i><br>Password: <i>demo</i>"
####################################################################################

PUBLIC_LOGIN_PAGE_MESSAGE="Samuel's Secret Stash"

####################################################################################
# Alternative Service Addresses - Optional
#
# This is an advanced feature for users who may be running their immich services on different hosts.
# It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers.
# Note: immich-microservices is bound to 3002, but no references are made
####################################################################################

IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

####################################################################################
# Alternative API's External Address - Optional
#
# This is an advanced feature used to control the public server endpoint returned to clients during Well-known discovery.
# You should only use this if you want mobile apps to access the immich API over a custom URL. Do not include trailing slash.
# NOTE: At this time, the web app will not be affected by this setting and will continue to use the relative path: /api
# Examples: http://localhost:3001, http://immich-api.example.com, etc
####################################################################################

#IMMICH_API_URL_EXTERNAL=http://localhost:3001

###################################################################################
# Immich Version - Optional
#
# This allows all immich docker images to be pinned to a specific version. By default,
# the version is "release" but could be a specific version, like "v1.59.0".
###################################################################################

#IMMICH_VERSION=

Reproduction steps

1. In system settings -> FFmpeg Settings, turn on hardware acceleration (using NVENC)
2. Change Video Codec to HEVC
3. Under Jobs -> Transcode Video -> Start Transcoding for ALL
4. Check Task Manager for "Video Encode" GPU Usage

Additional information

Under Job Concurrency, Transcode Videos Concurrency is set to 2

These are my FFmpeg settings in immich
image

Task manager when HEVC is being used
image

Task manager when AVC is being used
image

Originally created by @Kidsnd274 on GitHub (Aug 15, 2023). ### The bug When selecting HEVC as the codec for transcoded videos, hardware encoding does not seem to work, and encoding seems to be done only by the CPU. However, when selecting h264 as the codec, hardware encoding works correctly with the "Video Encode" portion of the graphics card showing GPU usage. The GPU I am using is the NVIDIA GTX 1070, and under the [NVENC GPU Support Matrix](https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new), it says that this card should be able to encode with HEVC. NVIDIA driver version is 528.02 and I am running Windows 10 22H2 with Docker Desktop 4.22.0 (117440). ### The OS that Immich Server is running on Windows 10 (Docker Desktop) ### Version of Immich Server v1.73.0 ### Version of Immich Mobile App v1.73.0 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: [ "start.sh", "immich" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env depends_on: - redis - database - typesense restart: always immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} extends: file: hwaccel.yml service: hwaccel command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env depends_on: - redis - database - typesense restart: always immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: always immich-web: container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - .env restart: always typesense: container_name: immich_typesense image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd environment: - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} - TYPESENSE_DATA_DIR=/data volumes: - tsdata:/data restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: always database: container_name: immich_postgres image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - pgdata:/var/lib/postgresql/data restart: always immich-proxy: container_name: immich_proxy image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release} environment: # Make sure these values get passed through from the env file - IMMICH_SERVER_URL - IMMICH_WEB_URL ports: - 2283:8080 depends_on: - immich-server - immich-web restart: always volumes: pgdata: model-cache: tsdata: ``` ### Your .env content ```Shell ################################################################################### # Database ################################################################################### # NOTE: The following four database variables support Docker secrets by adding a *_FILE suffix to the variable name # See the docker-compose documentation on secrets for additional details: https://docs.docker.com/compose/compose-file/compose-file-v3/#secrets DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_PASSWORD=* DB_DATABASE_NAME=immich # Optional Database settings: # DB_PORT=5432 ################################################################################### # Redis ################################################################################### REDIS_HOSTNAME=immich_redis # REDIS_URL will be used to pass custom options to ioredis. # Example for Sentinel # {"sentinels":[{"host":"redis-sentinel-node-0","port":26379},{"host":"redis-sentinel-node-1","port":26379},{"host":"redis-sentinel-node-2","port":26379}],"name":"redis-sentinel"} # REDIS_URL=ioredis://eyJzZW50aW5lbHMiOlt7Imhvc3QiOiJyZWRpcy1zZW50aW5lbDEiLCJwb3J0IjoyNjM3OX0seyJob3N0IjoicmVkaXMtc2VudGluZWwyIiwicG9ydCI6MjYzNzl9XSwibmFtZSI6Im15bWFzdGVyIn0= # Optional Redis settings: # Note: these parameters are not automatically passed to the Redis Container # to do so, please edit the docker-compose.yml file as well. Redis is not configured # via environment variables, only redis.conf or the command line # REDIS_PORT=6379 # REDIS_DBINDEX=0 # REDIS_USERNAME= # REDIS_PASSWORD= # REDIS_SOCKET= ################################################################################### # Upload File Location # # This is the location where uploaded files are stored. ################################################################################### UPLOAD_LOCATION=O:\docker_data\immich_data ################################################################################### # Typesense ################################################################################### TYPESENSE_API_KEY=* # TYPESENSE_ENABLED=false # TYPESENSE_URL uses base64 encoding for the nodes json. # Example JSON that was used: # [ # { "host": "typesense-1.example.net", "port": "443", "protocol": "https" }, # { "host": "typesense-2.example.net", "port": "443", "protocol": "https" }, # { "host": "typesense-3.example.net", "port": "443", "protocol": "https" }, # ] # TYPESENSE_URL=ha://WwogIHsgImhvc3QiOiAidHlwZXNlbnNlLTEuZXhhbXBsZS5uZXQiLCAicG9ydCI6ICI0NDMiLCAicHJvdG9jb2wiOiAiaHR0cHMiIH0sCiAgeyAiaG9zdCI6ICJ0eXBlc2Vuc2UtMi5leGFtcGxlLm5ldCIsICJwb3J0IjogIjQ0MyIsICJwcm90b2NvbCI6ICJodHRwcyIgfSwKICB7ICJob3N0IjogInR5cGVzZW5zZS0zLmV4YW1wbGUubmV0IiwgInBvcnQiOiAiNDQzIiwgInByb3RvY29sIjogImh0dHBzIiB9Cl0= ################################################################################### # Reverse Geocoding # # Reverse geocoding is done locally which has a small impact on memory usage # This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable # This ranges from 0-3 with 3 being the most precise # 3 - Cities > 500 population: ~200MB RAM # 2 - Cities > 1000 population: ~150MB RAM # 1 - Cities > 5000 population: ~80MB RAM # 0 - Cities > 15000 population: ~40MB RAM #################################################################################### # DISABLE_REVERSE_GEOCODING=false # REVERSE_GEOCODING_PRECISION=3 #################################################################################### # WEB - Optional # # Custom message on the login page, should be written in HTML form. # For example: # PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>demo@demo.de</i><br>Password: <i>demo</i>" #################################################################################### PUBLIC_LOGIN_PAGE_MESSAGE="Samuel's Secret Stash" #################################################################################### # Alternative Service Addresses - Optional # # This is an advanced feature for users who may be running their immich services on different hosts. # It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers. # Note: immich-microservices is bound to 3002, but no references are made #################################################################################### IMMICH_WEB_URL=http://immich-web:3000 IMMICH_SERVER_URL=http://immich-server:3001 IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003 #################################################################################### # Alternative API's External Address - Optional # # This is an advanced feature used to control the public server endpoint returned to clients during Well-known discovery. # You should only use this if you want mobile apps to access the immich API over a custom URL. Do not include trailing slash. # NOTE: At this time, the web app will not be affected by this setting and will continue to use the relative path: /api # Examples: http://localhost:3001, http://immich-api.example.com, etc #################################################################################### #IMMICH_API_URL_EXTERNAL=http://localhost:3001 ################################################################################### # Immich Version - Optional # # This allows all immich docker images to be pinned to a specific version. By default, # the version is "release" but could be a specific version, like "v1.59.0". ################################################################################### #IMMICH_VERSION= ``` ### Reproduction steps ```bash 1. In system settings -> FFmpeg Settings, turn on hardware acceleration (using NVENC) 2. Change Video Codec to HEVC 3. Under Jobs -> Transcode Video -> Start Transcoding for ALL 4. Check Task Manager for "Video Encode" GPU Usage ``` ### Additional information Under Job Concurrency, **Transcode Videos Concurrency** is set to **2** These are my FFmpeg settings in immich ![image](https://github.com/immich-app/immich/assets/1343896/c18db5f4-3b97-4b8a-8801-33a9318fb77d) Task manager when HEVC is being used ![image](https://github.com/immich-app/immich/assets/1343896/79e40ef7-de67-4f1c-8b5a-98ccce66cf99) Task manager when AVC is being used ![image](https://github.com/immich-app/immich/assets/1343896/fb2017ec-5550-41de-8ca9-2c56741f458f)
Author
Owner

@mertalev commented on GitHub (Aug 16, 2023):

Can you share the logs for immich_microservices? It's probably failing to transcode with NVENC and falling back to software.

@mertalev commented on GitHub (Aug 16, 2023): Can you share the logs for `immich_microservices`? It's probably failing to transcode with NVENC and falling back to software.
Author
Owner

@Kidsnd274 commented on GitHub (Aug 16, 2023):

Can you share the logs for immich_microservices? It's probably failing to transcode with NVENC and falling back to software.

Here are the logs when transcoding with HEVC

2023-08-17 00:17:03 [Nest] 7  - 08/16/2023, 4:17:03 PM   ERROR [MediaRepository] ffmpeg version 6.0-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
2023-08-17 00:17:03   built with gcc 12 (Debian 12.2.0-14)
2023-08-17 00:17:03   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-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
2023-08-17 00:17:03   libavutil      58.  2.100 / 58.  2.100
2023-08-17 00:17:03   libavcodec     60.  3.100 / 60.  3.100
2023-08-17 00:17:03   libavformat    60.  3.100 / 60.  3.100
2023-08-17 00:17:03   libavdevice    60.  1.100 / 60.  1.100
2023-08-17 00:17:03   libavfilter     9.  3.100 /  9.  3.100
2023-08-17 00:17:03   libswscale      7.  1.100 /  7.  1.100
2023-08-17 00:17:03   libswresample   4. 10.100 /  4. 10.100
2023-08-17 00:17:03   libpostproc    57.  1.100 / 57.  1.100
2023-08-17 00:17:03 [h264 @ 0x55d98293d80] Reinit context to 3840x2160, pix_fmt: yuv420p
2023-08-17 00:17:03 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/library/admin/2023/2023-08-06/VID_20230806214723.mp4':
2023-08-17 00:17:03   Metadata:
2023-08-17 00:17:03     major_brand     : isom
2023-08-17 00:17:03     minor_version   : 512
2023-08-17 00:17:03     compatible_brands: isomiso2avc1mp41
2023-08-17 00:17:03     creation_time   : 2023-08-06T10:59:45.000000Z
2023-08-17 00:17:03     date            : UTC 2023-08-06 12:47:24
2023-08-17 00:17:03     encoder         : Lavf58.76.100
2023-08-17 00:17:03   Duration: 00:00:27.33, start: 0.000000, bitrate: 64848 kb/s
2023-08-17 00:17:03   Stream #0:0[0x1](und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 3840x2160, 64713 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn (default)
2023-08-17 00:17:03     Metadata:
2023-08-17 00:17:03       creation_time   : 2023-08-06T10:59:45.000000Z
2023-08-17 00:17:03       handler_name    : VideoHandler
2023-08-17 00:17:03       vendor_id       : [0][0][0][0]
2023-08-17 00:17:03   Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
2023-08-17 00:17:03     Metadata:
2023-08-17 00:17:03       creation_time   : 2023-08-06T10:59:45.000000Z
2023-08-17 00:17:03       handler_name    : SoundHandler
2023-08-17 00:17:03       vendor_id       : [0][0][0][0]
2023-08-17 00:17:03 Stream mapping:
2023-08-17 00:17:03   Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc))
2023-08-17 00:17:03   Stream #0:1 -> #0:1 (aac (native) -> aac (native))
2023-08-17 00:17:03 Press [q] to stop, [?] for help
2023-08-17 00:17:03 [graph_1_in_0_1 @ 0x55d98194bc0] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo
2023-08-17 00:17:03 [h264 @ 0x55d98296180] Reinit context to 3840x2160, pix_fmt: yuv420p
2023-08-17 00:17:03 [graph 0 input from stream 0:0 @ 0x55d98196d80] w:3840 h:2160 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:1/1
2023-08-17 00:17:03 [auto_scale_0 @ 0x55d980c1880] w:iw h:ih flags:'' interl:0
2023-08-17 00:17:03 [Parsed_format_0 @ 0x55d98195880] auto-inserting filter 'auto_scale_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0'
2023-08-17 00:17:03 [auto_scale_0 @ 0x55d980c1880] w:3840 h:2160 fmt:yuv420p sar:1/1 -> w:3840 h:2160 fmt:nv12 sar:1/1 flags:0x00000004
2023-08-17 00:17:03 [Parsed_scale_cuda_2 @ 0x55d98195a00] w:3840 h:2160 -> w:1280 h:720
2023-08-17 00:17:03 [auto_scale_0 @ 0x55d980c1880] w:3840 h:2160 fmt:yuv420p sar:1/1 -> w:3840 h:2160 fmt:nv12 sar:1/1 flags:0x00000004
2023-08-17 00:17:03     Last message repeated 2 times
2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Using input frames context (format cuda) with hevc_nvenc encoder.
2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Loaded Nvenc version 12.0
2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Nvenc initialized successfully
2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Max B-frames 3 exceed 0
2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Provided device doesn't support required NVENC features
2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Nvenc unloaded
2023-08-17 00:17:03 [vost#0:0/hevc_nvenc @ 0x55d99161680] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2023-08-17 00:17:03 [aac @ 0x55d98295d80] Qavg: 5042.794
2023-08-17 00:17:03 [aac @ 0x55d98295d80] 2 frames left in the queue on closing
2023-08-17 00:17:03 [AVIOContext @ 0x55d981c4780] Statistics: 0 bytes written, 0 seeks, 0 writeouts
2023-08-17 00:17:03 Terminating demuxer thread 0
2023-08-17 00:17:03 [AVIOContext @ 0x55d981c4500] Statistics: 2571529 bytes read, 2 seeks
2023-08-17 00:17:03 Conversion failed!
2023-08-17 00:17:03 
2023-08-17 00:17:03 [Nest] 7  - 08/16/2023, 4:17:03 PM   ERROR [MediaService] Error: ffmpeg exited with code 1: Conversion failed!
2023-08-17 00:17:03 
2023-08-17 00:17:03 [Nest] 7  - 08/16/2023, 4:17:03 PM   ERROR [MediaService] Error occurred during transcoding. Retrying with NVENC acceleration disabled.
2023-08-17 00:17:04 [Nest] 7  - 08/16/2023, 4:17:04 PM     LOG [MediaService] Start encoding video 7d401958-d1df-423d-a787-c1fe14b91f33 {"inputOptions":["-init_hw_device cuda=cuda:0","-filter_hw_device cuda"],"outputOptions":["-vcodec hevc_nvenc","-tune hq","-qmin 0","-g 250","-bf 3","-b_ref_mode middle","-temporal-aq 1","-rc-lookahead 20","-i_qfactor 0.75","-b_qfactor 1.1","-acodec aac","-movflags faststart","-fps_mode passthrough","-v verbose","-vf format=nv12,hwupload_cuda,scale_cuda=-2:720","-preset p6","-b:v 2069","-maxrate 3000","-bufsize 2069","-multipass 2"],"twoPass":false}
2023-08-17 00:17:05 [Nest] 7  - 08/16/2023, 4:17:05 PM   ERROR [MediaRepository] ffmpeg version 6.0-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
2023-08-17 00:17:05   built with gcc 12 (Debian 12.2.0-14)
2023-08-17 00:17:05   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-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
2023-08-17 00:17:05   libavutil      58.  2.100 / 58.  2.100
2023-08-17 00:17:05   libavcodec     60.  3.100 / 60.  3.100
2023-08-17 00:17:05   libavformat    60.  3.100 / 60.  3.100
2023-08-17 00:17:05   libavdevice    60.  1.100 / 60.  1.100
2023-08-17 00:17:05   libavfilter     9.  3.100 /  9.  3.100
2023-08-17 00:17:05   libswscale      7.  1.100 /  7.  1.100
2023-08-17 00:17:05   libswresample   4. 10.100 /  4. 10.100
2023-08-17 00:17:05   libpostproc    57.  1.100 / 57.  1.100
2023-08-17 00:17:05 [h264 @ 0x43092293d80] Reinit context to 3840x2160, pix_fmt: yuv420p
2023-08-17 00:17:05 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/library/admin/2023/2023-08-05/VID_20230805233402.mp4':
2023-08-17 00:17:05   Metadata:
2023-08-17 00:17:05     major_brand     : isom
2023-08-17 00:17:05     minor_version   : 512
2023-08-17 00:17:05     compatible_brands: isomiso2avc1mp41
2023-08-17 00:17:05     creation_time   : 2023-08-05T11:32:11.000000Z
2023-08-17 00:17:05     date            : UTC 2023-08-05 14:34:03
2023-08-17 00:17:05     encoder         : Lavf58.76.100
2023-08-17 00:17:05   Duration: 00:00:24.67, start: 0.000000, bitrate: 50662 kb/s
2023-08-17 00:17:05   Stream #0:0[0x1](und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 3840x2160, 50526 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn (default)
2023-08-17 00:17:05     Metadata:
2023-08-17 00:17:05       creation_time   : 2023-08-05T11:32:11.000000Z
2023-08-17 00:17:05       handler_name    : VideoHandler
2023-08-17 00:17:05       vendor_id       : [0][0][0][0]
2023-08-17 00:17:05   Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
2023-08-17 00:17:05     Metadata:
2023-08-17 00:17:05       creation_time   : 2023-08-05T11:32:11.000000Z
2023-08-17 00:17:05       handler_name    : SoundHandler
2023-08-17 00:17:05       vendor_id       : [0][0][0][0]
2023-08-17 00:17:05 Stream mapping:
2023-08-17 00:17:05   Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc))
2023-08-17 00:17:05   Stream #0:1 -> #0:1 (aac (native) -> aac (native))
2023-08-17 00:17:05 Press [q] to stop, [?] for help
2023-08-17 00:17:05 [h264 @ 0x43092296180] Reinit context to 3840x2160, pix_fmt: yuv420p
2023-08-17 00:17:05 [graph_1_in_0_1 @ 0x43092193fc0] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo
2023-08-17 00:17:05 [graph 0 input from stream 0:0 @ 0x43092195c40] w:3840 h:2160 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:1/1
2023-08-17 00:17:05 [auto_scale_0 @ 0x43092195e80] w:iw h:ih flags:'' interl:0
2023-08-17 00:17:05 [Parsed_format_0 @ 0x43092194500] auto-inserting filter 'auto_scale_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0'
2023-08-17 00:17:05 [auto_scale_0 @ 0x43092195e80] w:3840 h:2160 fmt:yuv420p sar:1/1 -> w:3840 h:2160 fmt:nv12 sar:1/1 flags:0x00000004
2023-08-17 00:17:05 [Parsed_scale_cuda_2 @ 0x43092194680] w:3840 h:2160 -> w:1280 h:720
2023-08-17 00:17:05 [auto_scale_0 @ 0x43092195e80] w:3840 h:2160 fmt:yuv420p sar:1/1 -> w:3840 h:2160 fmt:nv12 sar:1/1 flags:0x00000004
2023-08-17 00:17:05     Last message repeated 2 times
2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Using input frames context (format cuda) with hevc_nvenc encoder.
2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Loaded Nvenc version 12.0
2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Nvenc initialized successfully
2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Max B-frames 3 exceed 0
2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Provided device doesn't support required NVENC features
2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Nvenc unloaded
2023-08-17 00:17:05 [vost#0:0/hevc_nvenc @ 0x430921bfa80] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2023-08-17 00:17:05 [aac @ 0x43092295d80] Qavg: 13713.425
2023-08-17 00:17:05 [aac @ 0x43092295d80] 2 frames left in the queue on closing
2023-08-17 00:17:05 [AVIOContext @ 0x430921c4780] Statistics: 0 bytes written, 0 seeks, 0 writeouts
2023-08-17 00:17:05 Terminating demuxer thread 0
2023-08-17 00:17:05 [AVIOContext @ 0x430921c4500] Statistics: 1489915 bytes read, 2 seeks
2023-08-17 00:17:05 Conversion failed!
2023-08-17 00:17:05 
2023-08-17 00:17:05 [Nest] 7  - 08/16/2023, 4:17:05 PM   ERROR [MediaService] Error: ffmpeg exited with code 1: Conversion failed!
2023-08-17 00:17:05 
2023-08-17 00:17:05 [Nest] 7  - 08/16/2023, 4:17:05 PM   ERROR [MediaService] Error occurred during transcoding. Retrying with NVENC acceleration disabled.

Here are the logs when encoding in h264

LOG [MediaService] Start encoding video 7d401958-d1df-423d-a787-c1fe14b91f33 {"inputOptions":["-init_hw_device cuda=cuda:0","-filter_hw_device cuda"],"outputOptions":["-vcodec h264_nvenc","-tune hq","-qmin 0","-g 250","-bf 3","-b_ref_mode middle","-temporal-aq 1","-rc-lookahead 20","-i_qfactor 0.75","-b_qfactor 1.1","-acodec aac","-movflags faststart","-fps_mode passthrough","-v verbose","-vf format=nv12,hwupload_cuda,scale_cuda=-2:720","-preset p6","-b:v 2069","-maxrate 3000","-bufsize 2069","-multipass 2"],"twoPass":false}
2023-08-17 00:25:25 [Nest] 7  - 08/16/2023, 4:25:25 PM     LOG [MediaService] Start encoding video 15f61275-554d-4834-a8ef-7123d998f16d {"inputOptions":["-init_hw_device cuda=cuda:0","-filter_hw_device cuda"],"outputOptions":["-vcodec h264_nvenc","-tune hq","-qmin 0","-g 250","-bf 3","-b_ref_mode middle","-temporal-aq 1","-rc-lookahead 20","-i_qfactor 0.75","-b_qfactor 1.1","-acodec aac","-movflags faststart","-fps_mode passthrough","-v verbose","-vf format=nv12,hwupload_cuda,scale_cuda=-2:720","-preset p6","-b:v 2069","-maxrate 3000","-bufsize 2069","-multipass 2"],"twoPass":false}
2023-08-17 00:25:45 [Nest] 7  - 08/16/2023, 4:25:45 PM     LOG [MediaService] Encoding success 7d401958-d1df-423d-a787-c1fe14b91f33
2023-08-17 00:25:46 [Nest] 7  - 08/16/2023, 4:25:46 PM     LOG [MediaService] Encoding success 15f61275-554d-4834-a8ef-7123d998f16d

I think it's something to do with bframes. NVENC HEVC may not support bframes on the GTX 1070

2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Nvenc initialized successfully
2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Max B-frames 3 exceed 0
2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Provided device doesn't support required NVENC features
@Kidsnd274 commented on GitHub (Aug 16, 2023): > Can you share the logs for `immich_microservices`? It's probably failing to transcode with NVENC and falling back to software. Here are the logs when transcoding with HEVC ```2023-08-17 00:17:03 [Nest] 7 - 08/16/2023, 4:17:03 PM LOG [MediaService] Start encoding video 15f61275-554d-4834-a8ef-7123d998f16d {"inputOptions":["-init_hw_device cuda=cuda:0","-filter_hw_device cuda"],"outputOptions":["-vcodec hevc_nvenc","-tune hq","-qmin 0","-g 250","-bf 3","-b_ref_mode middle","-temporal-aq 1","-rc-lookahead 20","-i_qfactor 0.75","-b_qfactor 1.1","-acodec aac","-movflags faststart","-fps_mode passthrough","-v verbose","-vf format=nv12,hwupload_cuda,scale_cuda=-2:720","-preset p6","-b:v 2069","-maxrate 3000","-bufsize 2069","-multipass 2"],"twoPass":false} 2023-08-17 00:17:03 [Nest] 7 - 08/16/2023, 4:17:03 PM ERROR [MediaRepository] ffmpeg version 6.0-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers 2023-08-17 00:17:03 built with gcc 12 (Debian 12.2.0-14) 2023-08-17 00:17:03 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-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc 2023-08-17 00:17:03 libavutil 58. 2.100 / 58. 2.100 2023-08-17 00:17:03 libavcodec 60. 3.100 / 60. 3.100 2023-08-17 00:17:03 libavformat 60. 3.100 / 60. 3.100 2023-08-17 00:17:03 libavdevice 60. 1.100 / 60. 1.100 2023-08-17 00:17:03 libavfilter 9. 3.100 / 9. 3.100 2023-08-17 00:17:03 libswscale 7. 1.100 / 7. 1.100 2023-08-17 00:17:03 libswresample 4. 10.100 / 4. 10.100 2023-08-17 00:17:03 libpostproc 57. 1.100 / 57. 1.100 2023-08-17 00:17:03 [h264 @ 0x55d98293d80] Reinit context to 3840x2160, pix_fmt: yuv420p 2023-08-17 00:17:03 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/library/admin/2023/2023-08-06/VID_20230806214723.mp4': 2023-08-17 00:17:03 Metadata: 2023-08-17 00:17:03 major_brand : isom 2023-08-17 00:17:03 minor_version : 512 2023-08-17 00:17:03 compatible_brands: isomiso2avc1mp41 2023-08-17 00:17:03 creation_time : 2023-08-06T10:59:45.000000Z 2023-08-17 00:17:03 date : UTC 2023-08-06 12:47:24 2023-08-17 00:17:03 encoder : Lavf58.76.100 2023-08-17 00:17:03 Duration: 00:00:27.33, start: 0.000000, bitrate: 64848 kb/s 2023-08-17 00:17:03 Stream #0:0[0x1](und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 3840x2160, 64713 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn (default) 2023-08-17 00:17:03 Metadata: 2023-08-17 00:17:03 creation_time : 2023-08-06T10:59:45.000000Z 2023-08-17 00:17:03 handler_name : VideoHandler 2023-08-17 00:17:03 vendor_id : [0][0][0][0] 2023-08-17 00:17:03 Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) 2023-08-17 00:17:03 Metadata: 2023-08-17 00:17:03 creation_time : 2023-08-06T10:59:45.000000Z 2023-08-17 00:17:03 handler_name : SoundHandler 2023-08-17 00:17:03 vendor_id : [0][0][0][0] 2023-08-17 00:17:03 Stream mapping: 2023-08-17 00:17:03 Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc)) 2023-08-17 00:17:03 Stream #0:1 -> #0:1 (aac (native) -> aac (native)) 2023-08-17 00:17:03 Press [q] to stop, [?] for help 2023-08-17 00:17:03 [graph_1_in_0_1 @ 0x55d98194bc0] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo 2023-08-17 00:17:03 [h264 @ 0x55d98296180] Reinit context to 3840x2160, pix_fmt: yuv420p 2023-08-17 00:17:03 [graph 0 input from stream 0:0 @ 0x55d98196d80] w:3840 h:2160 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:1/1 2023-08-17 00:17:03 [auto_scale_0 @ 0x55d980c1880] w:iw h:ih flags:'' interl:0 2023-08-17 00:17:03 [Parsed_format_0 @ 0x55d98195880] auto-inserting filter 'auto_scale_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0' 2023-08-17 00:17:03 [auto_scale_0 @ 0x55d980c1880] w:3840 h:2160 fmt:yuv420p sar:1/1 -> w:3840 h:2160 fmt:nv12 sar:1/1 flags:0x00000004 2023-08-17 00:17:03 [Parsed_scale_cuda_2 @ 0x55d98195a00] w:3840 h:2160 -> w:1280 h:720 2023-08-17 00:17:03 [auto_scale_0 @ 0x55d980c1880] w:3840 h:2160 fmt:yuv420p sar:1/1 -> w:3840 h:2160 fmt:nv12 sar:1/1 flags:0x00000004 2023-08-17 00:17:03 Last message repeated 2 times 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Using input frames context (format cuda) with hevc_nvenc encoder. 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Loaded Nvenc version 12.0 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Nvenc initialized successfully 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Max B-frames 3 exceed 0 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Provided device doesn't support required NVENC features 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Nvenc unloaded 2023-08-17 00:17:03 [vost#0:0/hevc_nvenc @ 0x55d99161680] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height 2023-08-17 00:17:03 [aac @ 0x55d98295d80] Qavg: 5042.794 2023-08-17 00:17:03 [aac @ 0x55d98295d80] 2 frames left in the queue on closing 2023-08-17 00:17:03 [AVIOContext @ 0x55d981c4780] Statistics: 0 bytes written, 0 seeks, 0 writeouts 2023-08-17 00:17:03 Terminating demuxer thread 0 2023-08-17 00:17:03 [AVIOContext @ 0x55d981c4500] Statistics: 2571529 bytes read, 2 seeks 2023-08-17 00:17:03 Conversion failed! 2023-08-17 00:17:03 2023-08-17 00:17:03 [Nest] 7 - 08/16/2023, 4:17:03 PM ERROR [MediaService] Error: ffmpeg exited with code 1: Conversion failed! 2023-08-17 00:17:03 2023-08-17 00:17:03 [Nest] 7 - 08/16/2023, 4:17:03 PM ERROR [MediaService] Error occurred during transcoding. Retrying with NVENC acceleration disabled. 2023-08-17 00:17:04 [Nest] 7 - 08/16/2023, 4:17:04 PM LOG [MediaService] Start encoding video 7d401958-d1df-423d-a787-c1fe14b91f33 {"inputOptions":["-init_hw_device cuda=cuda:0","-filter_hw_device cuda"],"outputOptions":["-vcodec hevc_nvenc","-tune hq","-qmin 0","-g 250","-bf 3","-b_ref_mode middle","-temporal-aq 1","-rc-lookahead 20","-i_qfactor 0.75","-b_qfactor 1.1","-acodec aac","-movflags faststart","-fps_mode passthrough","-v verbose","-vf format=nv12,hwupload_cuda,scale_cuda=-2:720","-preset p6","-b:v 2069","-maxrate 3000","-bufsize 2069","-multipass 2"],"twoPass":false} 2023-08-17 00:17:05 [Nest] 7 - 08/16/2023, 4:17:05 PM ERROR [MediaRepository] ffmpeg version 6.0-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers 2023-08-17 00:17:05 built with gcc 12 (Debian 12.2.0-14) 2023-08-17 00:17:05 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-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc 2023-08-17 00:17:05 libavutil 58. 2.100 / 58. 2.100 2023-08-17 00:17:05 libavcodec 60. 3.100 / 60. 3.100 2023-08-17 00:17:05 libavformat 60. 3.100 / 60. 3.100 2023-08-17 00:17:05 libavdevice 60. 1.100 / 60. 1.100 2023-08-17 00:17:05 libavfilter 9. 3.100 / 9. 3.100 2023-08-17 00:17:05 libswscale 7. 1.100 / 7. 1.100 2023-08-17 00:17:05 libswresample 4. 10.100 / 4. 10.100 2023-08-17 00:17:05 libpostproc 57. 1.100 / 57. 1.100 2023-08-17 00:17:05 [h264 @ 0x43092293d80] Reinit context to 3840x2160, pix_fmt: yuv420p 2023-08-17 00:17:05 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'upload/library/admin/2023/2023-08-05/VID_20230805233402.mp4': 2023-08-17 00:17:05 Metadata: 2023-08-17 00:17:05 major_brand : isom 2023-08-17 00:17:05 minor_version : 512 2023-08-17 00:17:05 compatible_brands: isomiso2avc1mp41 2023-08-17 00:17:05 creation_time : 2023-08-05T11:32:11.000000Z 2023-08-17 00:17:05 date : UTC 2023-08-05 14:34:03 2023-08-17 00:17:05 encoder : Lavf58.76.100 2023-08-17 00:17:05 Duration: 00:00:24.67, start: 0.000000, bitrate: 50662 kb/s 2023-08-17 00:17:05 Stream #0:0[0x1](und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, bt709, progressive, left), 3840x2160, 50526 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 90k tbn (default) 2023-08-17 00:17:05 Metadata: 2023-08-17 00:17:05 creation_time : 2023-08-05T11:32:11.000000Z 2023-08-17 00:17:05 handler_name : VideoHandler 2023-08-17 00:17:05 vendor_id : [0][0][0][0] 2023-08-17 00:17:05 Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default) 2023-08-17 00:17:05 Metadata: 2023-08-17 00:17:05 creation_time : 2023-08-05T11:32:11.000000Z 2023-08-17 00:17:05 handler_name : SoundHandler 2023-08-17 00:17:05 vendor_id : [0][0][0][0] 2023-08-17 00:17:05 Stream mapping: 2023-08-17 00:17:05 Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc)) 2023-08-17 00:17:05 Stream #0:1 -> #0:1 (aac (native) -> aac (native)) 2023-08-17 00:17:05 Press [q] to stop, [?] for help 2023-08-17 00:17:05 [h264 @ 0x43092296180] Reinit context to 3840x2160, pix_fmt: yuv420p 2023-08-17 00:17:05 [graph_1_in_0_1 @ 0x43092193fc0] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo 2023-08-17 00:17:05 [graph 0 input from stream 0:0 @ 0x43092195c40] w:3840 h:2160 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:1/1 2023-08-17 00:17:05 [auto_scale_0 @ 0x43092195e80] w:iw h:ih flags:'' interl:0 2023-08-17 00:17:05 [Parsed_format_0 @ 0x43092194500] auto-inserting filter 'auto_scale_0' between the filter 'graph 0 input from stream 0:0' and the filter 'Parsed_format_0' 2023-08-17 00:17:05 [auto_scale_0 @ 0x43092195e80] w:3840 h:2160 fmt:yuv420p sar:1/1 -> w:3840 h:2160 fmt:nv12 sar:1/1 flags:0x00000004 2023-08-17 00:17:05 [Parsed_scale_cuda_2 @ 0x43092194680] w:3840 h:2160 -> w:1280 h:720 2023-08-17 00:17:05 [auto_scale_0 @ 0x43092195e80] w:3840 h:2160 fmt:yuv420p sar:1/1 -> w:3840 h:2160 fmt:nv12 sar:1/1 flags:0x00000004 2023-08-17 00:17:05 Last message repeated 2 times 2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Using input frames context (format cuda) with hevc_nvenc encoder. 2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Loaded Nvenc version 12.0 2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Nvenc initialized successfully 2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Max B-frames 3 exceed 0 2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Provided device doesn't support required NVENC features 2023-08-17 00:17:05 [hevc_nvenc @ 0x43092295180] Nvenc unloaded 2023-08-17 00:17:05 [vost#0:0/hevc_nvenc @ 0x430921bfa80] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height 2023-08-17 00:17:05 [aac @ 0x43092295d80] Qavg: 13713.425 2023-08-17 00:17:05 [aac @ 0x43092295d80] 2 frames left in the queue on closing 2023-08-17 00:17:05 [AVIOContext @ 0x430921c4780] Statistics: 0 bytes written, 0 seeks, 0 writeouts 2023-08-17 00:17:05 Terminating demuxer thread 0 2023-08-17 00:17:05 [AVIOContext @ 0x430921c4500] Statistics: 1489915 bytes read, 2 seeks 2023-08-17 00:17:05 Conversion failed! 2023-08-17 00:17:05 2023-08-17 00:17:05 [Nest] 7 - 08/16/2023, 4:17:05 PM ERROR [MediaService] Error: ffmpeg exited with code 1: Conversion failed! 2023-08-17 00:17:05 2023-08-17 00:17:05 [Nest] 7 - 08/16/2023, 4:17:05 PM ERROR [MediaService] Error occurred during transcoding. Retrying with NVENC acceleration disabled. ``` Here are the logs when encoding in h264 ``` LOG [MediaService] Start encoding video 7d401958-d1df-423d-a787-c1fe14b91f33 {"inputOptions":["-init_hw_device cuda=cuda:0","-filter_hw_device cuda"],"outputOptions":["-vcodec h264_nvenc","-tune hq","-qmin 0","-g 250","-bf 3","-b_ref_mode middle","-temporal-aq 1","-rc-lookahead 20","-i_qfactor 0.75","-b_qfactor 1.1","-acodec aac","-movflags faststart","-fps_mode passthrough","-v verbose","-vf format=nv12,hwupload_cuda,scale_cuda=-2:720","-preset p6","-b:v 2069","-maxrate 3000","-bufsize 2069","-multipass 2"],"twoPass":false} 2023-08-17 00:25:25 [Nest] 7 - 08/16/2023, 4:25:25 PM LOG [MediaService] Start encoding video 15f61275-554d-4834-a8ef-7123d998f16d {"inputOptions":["-init_hw_device cuda=cuda:0","-filter_hw_device cuda"],"outputOptions":["-vcodec h264_nvenc","-tune hq","-qmin 0","-g 250","-bf 3","-b_ref_mode middle","-temporal-aq 1","-rc-lookahead 20","-i_qfactor 0.75","-b_qfactor 1.1","-acodec aac","-movflags faststart","-fps_mode passthrough","-v verbose","-vf format=nv12,hwupload_cuda,scale_cuda=-2:720","-preset p6","-b:v 2069","-maxrate 3000","-bufsize 2069","-multipass 2"],"twoPass":false} 2023-08-17 00:25:45 [Nest] 7 - 08/16/2023, 4:25:45 PM LOG [MediaService] Encoding success 7d401958-d1df-423d-a787-c1fe14b91f33 2023-08-17 00:25:46 [Nest] 7 - 08/16/2023, 4:25:46 PM LOG [MediaService] Encoding success 15f61275-554d-4834-a8ef-7123d998f16d ``` I think it's something to do with bframes. NVENC HEVC may not support bframes on the GTX 1070 ``` 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Nvenc initialized successfully 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Max B-frames 3 exceed 0 2023-08-17 00:17:03 [hevc_nvenc @ 0x55d98295180] Provided device doesn't support required NVENC features ```
Author
Owner

@mertalev commented on GitHub (Aug 17, 2023):

I've seen someone else with this issue as well. I can expose B-frames in the settings so you can set this to 0.

@mertalev commented on GitHub (Aug 17, 2023): I've seen someone else with this issue as well. I can expose B-frames in the settings so you can set this to 0.
Author
Owner

@Kidsnd274 commented on GitHub (Aug 17, 2023):

That would be great. Thanks!

@Kidsnd274 commented on GitHub (Aug 17, 2023): That would be great. Thanks!
Author
Owner

@kkoshelev commented on GitHub (Aug 18, 2023):

I've seen someone else with this issue as well. I can expose B-frames in the settings so you can set this to 0.

Yes, please, I have Tesla P4 card based on Pascal arch (4th gen, GT104), uses the same chip as GTX 1070, and it doesn't support B-frames, see NVENC Summary matrix.

It would be nice if more settings can be exposed to fine tune what's supported. Maybe an env variable in docker compose file, etc.

@kkoshelev commented on GitHub (Aug 18, 2023): > I've seen someone else with this issue as well. I can expose B-frames in the settings so you can set this to 0. Yes, please, I have Tesla P4 card based on Pascal arch (4th gen, GT104), uses the same chip as GTX 1070, and it doesn't support B-frames, see [NVENC Summary](https://en.wikipedia.org/wiki/Nvidia_NVENC) matrix. It would be nice if more settings can be exposed to fine tune what's supported. Maybe an env variable in docker compose file, etc.
Author
Owner

@mertalev commented on GitHub (Aug 19, 2023):

It would be nice if more settings can be exposed to fine tune what's supported. Maybe an env variable in docker compose file, etc.

It's something I'm thinking think about. I try to avoid adding too many obscure technical settings to the admin panel since it can very easily get overwhelming to understand all the options. Maybe I could put settings like these in an "Advanced" accordion.

@mertalev commented on GitHub (Aug 19, 2023): > It would be nice if more settings can be exposed to fine tune what's supported. Maybe an env variable in docker compose file, etc. It's something I'm thinking think about. I try to avoid adding too many obscure technical settings to the admin panel since it can very easily get overwhelming to understand all the options. Maybe I could put settings like these in an "Advanced" accordion.
Author
Owner

@kkoshelev commented on GitHub (Aug 19, 2023):

It depends how much time you want to invest in this. I would just simply add few commented lines in .yml file with some description. Like uncomment this if you have 1070/P4, because it doesn’t support B-frames, etc

@kkoshelev commented on GitHub (Aug 19, 2023): It depends how much time you want to invest in this. I would just simply add few commented lines in .yml file with some description. Like uncomment this if you have 1070/P4, because it doesn’t support B-frames, etc
Author
Owner

@maltokyo commented on GitHub (Jan 21, 2024):

I have this same error "Error occurred during transcoding. Retrying with NVENC acceleration disabled"
But, not sure how to apply this fix, would someone please share how it is done?

@maltokyo commented on GitHub (Jan 21, 2024): I have this same error "Error occurred during transcoding. Retrying with NVENC acceleration disabled" But, not sure how to apply this fix, would someone please share how it is done?
Author
Owner

@Kidsnd274 commented on GitHub (Jan 21, 2024):

I have this same error "Error occurred during transcoding. Retrying with NVENC acceleration disabled"
But, not sure how to apply this fix, would someone please share how it is done?

Assuming you have a GTX 1070 like me, make sure these settings are turned off:

Hardware Acceleration -> Temporal AQ = Off
Advanced -> Max B-Frames = 0

There's a way to check the exact ffmpeg error in the logs but it might be a bit troublesome. The settings above should work.

@Kidsnd274 commented on GitHub (Jan 21, 2024): > I have this same error "Error occurred during transcoding. Retrying with NVENC acceleration disabled" > But, not sure how to apply this fix, would someone please share how it is done? Assuming you have a GTX 1070 like me, make sure these settings are turned off: Hardware Acceleration -> Temporal AQ = Off Advanced -> Max B-Frames = 0 There's a way to check the exact ffmpeg error in the logs but it might be a bit troublesome. The settings above should work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1232