Transcoding: Using x264-params/x265-params etc. multiple times will override any previously set values #2740

Closed
opened 2026-02-05 06:57:43 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @n00mkrad on GitHub (Apr 3, 2024).

The bug

The current codebase has several cases where x264-params/x265-params etc. are used multiple times in order to add additional params.

However, ffmpeg will not merge those, the last occurence will override any options set in any previous argument.

Example in the codebase: 7f854432ae/server/src/utils/media.ts (L364)
The argument in the linked line never gets applied, it always gets overriden by the one in the line below.

This is currently not a massive issue, but it's quite problematic for my AV1 PR (https://github.com/immich-app/immich/pull/8491) because both the max bitrate and the threads number are specified via -svtav1-params but in 2 different functions.

A workaround would be to add the threads count in getBitrateOptions() instead of getThreadOptions().

The OS that Immich Server is running on

Any

Version of Immich Server

git @ 7f854432ae

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

1. Go to Video Transcoding Settings, set Threads to a positive value e.g. 2
2. Transcode any video

Additional information

No response

Originally created by @n00mkrad on GitHub (Apr 3, 2024). ### The bug The current codebase has several cases where x264-params/x265-params etc. are used multiple times in order to add additional params. However, **ffmpeg will not merge those, the last occurence will override any options set in any previous argument.** Example in the codebase: https://github.com/immich-app/immich/blob/7f854432ae11eb07c28de301820d4fc6e21d32ed/server/src/utils/media.ts#L364 The argument in the linked line **never** gets applied, it always gets overriden by the one in the line below. This is currently not a massive issue, but it's quite problematic for my AV1 PR (https://github.com/immich-app/immich/pull/8491) because both the max bitrate and the threads number are specified via `-svtav1-params` but in 2 different functions. A workaround would be to add the threads count in getBitrateOptions() instead of getThreadOptions(). ### The OS that Immich Server is running on Any ### Version of Immich Server git @ 7f854432ae11eb07c28de301820d4fc6e21d32ed ### Version of Immich Mobile App N/A ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML N/A ``` ### Your .env content ```Shell N/A ``` ### Reproduction steps ```bash 1. Go to Video Transcoding Settings, set Threads to a positive value e.g. 2 2. Transcode any video ``` ### 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#2740