[PR #24644] feat: add .mxf file support #17945

Open
opened 2026-02-05 16:30:06 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/24644
Author: @timonrieger
Created: 12/17/2025
Status: 🔄 Open

Base: mainHead: feat/mxf-file-support


📝 Commits (2)

  • 9765538 feat: add support for MXF format in media handling
  • 5316bcf fix: enhance MXF handling in mime-types utility

📊 Changes

4 files changed (+13 additions, -1 deletions)

View changed files

📝 docs/docs/features/supported-formats.md (+1 -0)
📝 server/src/services/asset-media.service.spec.ts (+1 -0)
📝 server/src/utils/mime-types.spec.ts (+2 -1)
📝 server/src/utils/mime-types.ts (+9 -0)

📄 Description

Description

Adds support for MXF (Material Exchange Format) video files in Immich.

What was added:

  • Added .mxf extension to the supported video formats list
  • Registered application/mxf as the mime type for MXF files (official SMPTE mime type)
  • Updated asset type classification to correctly identify MXF files as video assets
  • Updated tests to validate MXF file handling

Technical details:
MXF is a container format with the mime type application/mxf (not video/mxf). The assetType() function was updated to check file extensions first (against the video and image objects) before falling back to mime type prefixes. This ensures container formats like MXF are correctly classified based on their extension listing, regardless of mime type prefix.

Rationale for 5316bcf:
Container formats (MXF, MOV, MP4, MKV, WebM) can have non-standard mime types. File extensions are more reliable for classification since Immich maintains explicit extension lists for video/image types. By checking extensions first, we ensure that any file extension listed in the video object is correctly classified as AssetType.Video, enabling proper playback, thumbnail generation, and metadata extraction.

Fixes #24640

How Has This Been Tested?

  • Added test case for MXF file extension to mime type mapping
  • Updated test to allow application/mxf in video mime types validation
  • Verified MXF files are correctly classified as AssetType.Video during upload
  • Confirmed video playback endpoint works for MXF files (/api/assets/{id}/video/playback)
  • Verified thumbnail generation works for MXF files
  • Tested that existing video formats (MP4, MOV, etc.) continue to work correctly

Sample files downloaded from https://toolsfairy.com/video-test/sample-mxf-files were used to test the implementation.

EDIT: tested this now with two big video .mxf files i got sent from a fellow Discord user. See screenshots and recordings below

Screenshots

Note: the last file upload fails due to size constraints of github codespaces (also happens on standard .mov files)

https://github.com/user-attachments/assets/3e3c895c-cb4b-4f3d-a9eb-299e3130d6b7

EDIT (after test with "real" images/videos):

Selecting .mxf files allowed now

image

Upload (20x, slow machine 🤣 )

https://github.com/user-attachments/assets/b6c2cc52-7229-4fec-9c3d-4c63045965a9

Replay (2x)

https://github.com/user-attachments/assets/9ef40472-081a-4241-8e2c-f0410c6a4509

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

Used LLM assistance to research MXF mime type specifications and identify the classification logic issue.


🔄 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/24644 **Author:** [@timonrieger](https://github.com/timonrieger) **Created:** 12/17/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/mxf-file-support` --- ### 📝 Commits (2) - [`9765538`](https://github.com/immich-app/immich/commit/97655382552bd8d9322674292968b7b9df7556ef) feat: add support for MXF format in media handling - [`5316bcf`](https://github.com/immich-app/immich/commit/5316bcf588017219e67b39fc95e78ef0b0602232) fix: enhance MXF handling in mime-types utility ### 📊 Changes **4 files changed** (+13 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/docs/features/supported-formats.md` (+1 -0) 📝 `server/src/services/asset-media.service.spec.ts` (+1 -0) 📝 `server/src/utils/mime-types.spec.ts` (+2 -1) 📝 `server/src/utils/mime-types.ts` (+9 -0) </details> ### 📄 Description ## Description Adds support for MXF (Material Exchange Format) video files in Immich. **What was added:** - Added `.mxf` extension to the supported video formats list - Registered `application/mxf` as the mime type for MXF files (official SMPTE mime type) - Updated asset type classification to correctly identify MXF files as video assets - Updated tests to validate MXF file handling **Technical details:** MXF is a container format with the mime type `application/mxf` (not `video/mxf`). The `assetType()` function was updated to check file extensions first (against the `video` and `image` objects) before falling back to mime type prefixes. This ensures container formats like MXF are correctly classified based on their extension listing, regardless of mime type prefix. **Rationale for 5316bcf:** Container formats (MXF, MOV, MP4, MKV, WebM) can have non-standard mime types. File extensions are more reliable for classification since Immich maintains explicit extension lists for video/image types. By checking extensions first, we ensure that any file extension listed in the `video` object is correctly classified as `AssetType.Video`, enabling proper playback, thumbnail generation, and metadata extraction. Fixes #24640 ## How Has This Been Tested? - [x] Added test case for MXF file extension to mime type mapping - [x] Updated test to allow `application/mxf` in video mime types validation - [x] Verified MXF files are correctly classified as `AssetType.Video` during upload - [x] Confirmed video playback endpoint works for MXF files (`/api/assets/{id}/video/playback`) - [x] Verified thumbnail generation works for MXF files - [x] Tested that existing video formats (MP4, MOV, etc.) continue to work correctly Sample files downloaded from https://toolsfairy.com/video-test/sample-mxf-files were used to test the implementation. EDIT: tested this now with two big video .mxf files i got sent from a fellow Discord user. See screenshots and recordings below <details><summary><h2>Screenshots</h2></summary> <!-- Images go below this line. --> *Note: the last file upload fails due to size constraints of github codespaces (also happens on standard .mov files)* https://github.com/user-attachments/assets/3e3c895c-cb4b-4f3d-a9eb-299e3130d6b7 EDIT (after test with "real" images/videos): _Selecting .mxf files allowed now_ <img width="1702" height="884" alt="image" src="https://github.com/user-attachments/assets/60dfefa4-ec8f-426b-a25b-7d9fa82fb06d" /> _Upload (20x, slow machine 🤣 )_ https://github.com/user-attachments/assets/b6c2cc52-7229-4fec-9c3d-4c63045965a9 _Replay (2x)_ https://github.com/user-attachments/assets/9ef40472-081a-4241-8e2c-f0410c6a4509 </details> ## Checklist: - [x] I have performed a self-review of my own code - [x] I have made corresponding changes to the documentation if applicable - [x] I have no unrelated changes in the PR. - [x] I have confirmed that any new dependencies are strictly necessary. - [x] I have written tests for new code (if applicable) - [x] I have followed naming conventions/patterns in the surrounding code - [x] All code in `src/services/` uses repositories implementations for database calls, filesystem operations, etc. - [x] All code in `src/repositories/` is pretty basic/simple and does not have any immich specific logic (that belongs in `src/services/`) ## Please describe to which degree, if any, an LLM was used in creating this pull request. Used LLM assistance to research MXF mime type specifications and identify the classification logic issue. --- <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 16:30:06 +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#17945