-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat: add .mxf file support #24644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add .mxf file support #24644
Conversation
* Updated supported formats documentation to include MXF. * Added MXF to valid video extensions in tests. * Registered MXF MIME type in mime-types utility.
* Updated video mime type validation to include 'application/mxf'. * Adjusted asset type determination to recognize MXF as a video container.
|
|
|
📖 Documentation deployed to docs.pr-24644.preview.immich.app |
|
the only thing behaving unexpectedly was that on upload finish the UI showed "Upload failed", however the file was visible and uploaded correctly. Maybe unrelated to the .mxf support addition. |
| if (isType(filename, image)) { | ||
| return AssetType.Image; | ||
| } | ||
| // Fallback to mime type check for any edge cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests are passing and this should be safe since all formats above are explicitly set, however to be safest we could use a single if branch for the mxf extension and revert these additions
Description
Adds support for MXF (Material Exchange Format) video files in Immich.
What was added:
.mxfextension to the supported video formats listapplication/mxfas the mime type for MXF files (official SMPTE mime type)Technical details:
MXF is a container format with the mime type
application/mxf(notvideo/mxf). TheassetType()function was updated to check file extensions first (against thevideoandimageobjects) 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
videoobject is correctly classified asAssetType.Video, enabling proper playback, thumbnail generation, and metadata extraction.Fixes #24640
How Has This Been Tested?
application/mxfin video mime types validationAssetType.Videoduring upload/api/assets/{id}/video/playback)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)
demo.3.mov
EDIT (after test with "real" images/videos):
Selecting .mxf files allowed now
Upload (20x, slow machine 🤣 )
output.mp4
Replay (2x)
output.1.mov
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/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.