[PR #1370] [MERGED] feat: transcoding improvements #9019

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

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/1370
Author: @zackpollard
Created: 1/21/2023
Status: Merged
Merged: 1/22/2023
Merged by: @alextran1502

Base: mainHead: feat/transcoding-improvements


📝 Commits (10+)

  • 8889ac9 feat: support isEdited flag for SettingSwitch
  • b3cdea5 feat: add transcodeAll ffmpeg settings for extra transcoding control
  • f46d842 refactor: tidy up and rename current video transcoding code + transcode everything
  • b7de9c7 feat: better video transcoding with ffprobe
  • 401e01b fix: always serve encoded video if it exists
  • b893e75 feat: change video codec option to a select box, limit options
  • f4baa96 feat: add video conversion job for transcoding previously missed videos
  • 8bf0c1f chore: fix spelling of job messages to pluralise assets
  • 5e7d506 chore: fix prettier/eslint warnings
  • 3d79527 feat: force switch targetAudioCodec default to aac to avoid iOS incompatibility

📊 Changes

31 files changed (+274 additions, -63 deletions)

View changed files

📝 .gitignore (+2 -1)
📝 mobile/openapi/README.md (+1 -1)
📝 mobile/openapi/doc/SystemConfigFFmpegDto.md (+1 -0)
📝 mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart (+11 -3)
📝 mobile/openapi/test/system_config_f_fmpeg_dto_test.dart (+5 -0)
📝 server/apps/immich/src/api-v1/asset/asset-repository.ts (+10 -0)
📝 server/apps/immich/src/api-v1/asset/asset.service.spec.ts (+1 -0)
📝 server/apps/immich/src/api-v1/asset/asset.service.ts (+4 -4)
📝 server/apps/immich/src/api-v1/job/job.service.ts (+18 -3)
📝 server/apps/immich/src/modules/schedule-tasks/schedule-tasks.service.ts (+1 -1)
📝 server/apps/microservices/src/processors/asset-uploaded.processor.ts (+1 -1)
📝 server/apps/microservices/src/processors/video-transcode.processor.ts (+51 -17)
📝 server/immich-openapi-specs.json (+5 -1)
📝 server/libs/domain/src/job/interfaces/video-transcode.interface.ts (+2 -2)
📝 server/libs/domain/src/job/job.constants.ts (+1 -1)
📝 server/libs/domain/src/job/job.repository.ts (+2 -2)
📝 server/libs/domain/src/system-config/dto/system-config-ffmpeg.dto.ts (+4 -1)
📝 server/libs/domain/src/system-config/system-config.core.ts (+3 -2)
📝 server/libs/domain/src/system-config/system-config.service.spec.ts (+3 -2)
📝 server/libs/domain/test/fixtures.ts (+3 -2)

...and 11 more files

📄 Description

This will bring an array of transcoding improvements to immich, namely:

  • Allow transcoding of all videos, regardless of the format they are uploaded in
  • Intelligently analyse the uploads with ffprobe to decide if they need to be transcoded (aren't in target format already)
  • If a transcoded video exists, the immich web and mobile clients will use that instead of the original for playback

Notes:

  • This will reset the users video codec config back to the new default of h264 and audio codec to aac

TODO:

  • Check iOS videos play correctly after transcoding #1025 mentions there may be issue with mp4 containers with mp3 audio, possibly switch the defaults to AAC?
    • Updated to AAC as the default, confirmed working by @alextran1502

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/1370 **Author:** [@zackpollard](https://github.com/zackpollard) **Created:** 1/21/2023 **Status:** ✅ Merged **Merged:** 1/22/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `feat/transcoding-improvements` --- ### 📝 Commits (10+) - [`8889ac9`](https://github.com/immich-app/immich/commit/8889ac9ffe98b23197dfc159c54f1daf7e47ff5b) feat: support isEdited flag for SettingSwitch - [`b3cdea5`](https://github.com/immich-app/immich/commit/b3cdea595d718ce8e236bb75213d182cc54d1a42) feat: add transcodeAll ffmpeg settings for extra transcoding control - [`f46d842`](https://github.com/immich-app/immich/commit/f46d8425beeb458f5630794fb9e190220b1e8b0e) refactor: tidy up and rename current video transcoding code + transcode everything - [`b7de9c7`](https://github.com/immich-app/immich/commit/b7de9c7e04a5afa5bc231ab09cb0927fe94dd9dd) feat: better video transcoding with ffprobe - [`401e01b`](https://github.com/immich-app/immich/commit/401e01b95e653d21d8a180fd46900fdb1b7c74a3) fix: always serve encoded video if it exists - [`b893e75`](https://github.com/immich-app/immich/commit/b893e7537edc14ca4896ddf5a6379c92e352c93e) feat: change video codec option to a select box, limit options - [`f4baa96`](https://github.com/immich-app/immich/commit/f4baa969e8dd1270c1554aa01cbaec0ca292eb97) feat: add video conversion job for transcoding previously missed videos - [`8bf0c1f`](https://github.com/immich-app/immich/commit/8bf0c1f2b0e602f7a56ec1cc0c0a282bad13800c) chore: fix spelling of job messages to pluralise assets - [`5e7d506`](https://github.com/immich-app/immich/commit/5e7d506d8a572fb066863de0dc299a0190a84476) chore: fix prettier/eslint warnings - [`3d79527`](https://github.com/immich-app/immich/commit/3d79527e5a35ac83bce522cf4eff13ccd30808e1) feat: force switch targetAudioCodec default to aac to avoid iOS incompatibility ### 📊 Changes **31 files changed** (+274 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -1) 📝 `mobile/openapi/README.md` (+1 -1) 📝 `mobile/openapi/doc/SystemConfigFFmpegDto.md` (+1 -0) 📝 `mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart` (+11 -3) 📝 `mobile/openapi/test/system_config_f_fmpeg_dto_test.dart` (+5 -0) 📝 `server/apps/immich/src/api-v1/asset/asset-repository.ts` (+10 -0) 📝 `server/apps/immich/src/api-v1/asset/asset.service.spec.ts` (+1 -0) 📝 `server/apps/immich/src/api-v1/asset/asset.service.ts` (+4 -4) 📝 `server/apps/immich/src/api-v1/job/job.service.ts` (+18 -3) 📝 `server/apps/immich/src/modules/schedule-tasks/schedule-tasks.service.ts` (+1 -1) 📝 `server/apps/microservices/src/processors/asset-uploaded.processor.ts` (+1 -1) 📝 `server/apps/microservices/src/processors/video-transcode.processor.ts` (+51 -17) 📝 `server/immich-openapi-specs.json` (+5 -1) 📝 `server/libs/domain/src/job/interfaces/video-transcode.interface.ts` (+2 -2) 📝 `server/libs/domain/src/job/job.constants.ts` (+1 -1) 📝 `server/libs/domain/src/job/job.repository.ts` (+2 -2) 📝 `server/libs/domain/src/system-config/dto/system-config-ffmpeg.dto.ts` (+4 -1) 📝 `server/libs/domain/src/system-config/system-config.core.ts` (+3 -2) 📝 `server/libs/domain/src/system-config/system-config.service.spec.ts` (+3 -2) 📝 `server/libs/domain/test/fixtures.ts` (+3 -2) _...and 11 more files_ </details> ### 📄 Description This will bring an array of transcoding improvements to immich, namely: - [x] Allow transcoding of all videos, regardless of the format they are uploaded in - [x] Intelligently analyse the uploads with ffprobe to decide if they need to be transcoded (aren't in target format already) - [x] If a transcoded video exists, the immich web and mobile clients will use that instead of the original for playback Notes: - This will reset the users video codec config back to the new default of h264 and audio codec to aac TODO: - ~~Check iOS videos play correctly after transcoding #1025 mentions there may be issue with mp4 containers with mp3 audio, possibly switch the defaults to AAC?~~ - Updated to AAC as the default, confirmed working by @alextran1502 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 13:57:11 +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#9019