[PR #3138] refactor(server): modularize getFfmpegOptions #9864

Closed
opened 2026-02-05 14:12:05 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/immich-app/immich/pull/3138

State: closed
Merged: Yes


Description

Modularizes getFfmpegOptions into separate handlers for each codec and adds enums for several transcoding settings.

getFfmpegOptions has become too complex and monolithic to make major changes to it without either increasing its complexity further or introducing bugs. This change makes the intended behavior for each codec much more explicit, and makes adding a new codec as simple as adding a new handler without affecting existing logic.

Notably, the only major change is to the code structure. Existing behavior should be the same.

Testing

Tests are unchanged (except for the addition of an inputOptions property in TranscodeOptions) and all pass. I tried different transcoding settings and all were applied and transcoded correctly.

**Original Pull Request:** https://github.com/immich-app/immich/pull/3138 **State:** closed **Merged:** Yes --- ## Description Modularizes `getFfmpegOptions` into separate handlers for each codec and adds enums for several transcoding settings. `getFfmpegOptions` has become too complex and monolithic to make major changes to it without either increasing its complexity further or introducing bugs. This change makes the intended behavior for each codec much more explicit, and makes adding a new codec as simple as adding a new handler without affecting existing logic. Notably, the only major change is to the code structure. Existing behavior should be the same. ## Testing Tests are unchanged (except for the addition of an `inputOptions` property in `TranscodeOptions`) and all pass. I tried different transcoding settings and all were applied and transcoded correctly.
OVERLORD added the pull-request label 2026-02-05 14:12:05 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#9864