Skip to content
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

Generated file has wrong file extension .stem.m4a instead of .stem.mp4 #47

Closed
JoergAtGithub opened this issue Apr 18, 2024 · 5 comments
Closed

Comments

@JoergAtGithub
Copy link

A STEM file must have the suffix .stem.mp4, but stemgen generates the file with the extension .stem.m4a.

Traktor Pro seems not to care for the file extension and loads it anyway, but for other tools it makes a difference. The .mp4 extension is selected by Native Instruments, because any MP4 decoder will play the master track with all stems mixed when the file is loaded.

@axeldelafosse
Copy link
Owner

Hello Joerg,

.m4a is the same as .mp4 -- it simply means that it only contains audio (and no video).

You can easily change this is the code if you prefer .mp4 extensions instead.

Thank you for using Stemgen!

@JoergAtGithub
Copy link
Author

This violates not only the specification of the STEM format, it also breaks third party players like VLC, which do not play STEM files extension .m4a, but with extension .mp4.

@axeldelafosse
Copy link
Owner

Can you link to the specification please?

@JoergAtGithub
Copy link
Author

You have to register at Native Instruments to get it: https://www.stems-music.com/stems-is-for-developers/

@axeldelafosse
Copy link
Owner

So I guess you are referring to this part:

"There are two criteria every Stem File must fulfill—failure to fulfill these criteria means the file in question is not a Stem File:
▪ The file must be a valid MP4 file (ISO base media file format: ISO/IEC 14496-12) with the “.mp4” file extension. Preferably the file name should end with “.stem.mp4”, but just “.mp4” is also valid.
▪ The MP4 file must contain a box (i.e. data container) of type stem as a sub-box of moov.udta. moov is the root box of the MP4 file, as shown in the Stem File Structure diagram in section ↑7.1, File Structure."

But this repo is a fork of ni-stem (included in the SDK you linked) and if you look at the code, it is actually using .m4a for the file extension: stemOutExtension = ".m4a".

So now you might argue that Native Instruments isn't following its own specification, but I don't really have time for this. The important part is that the file is a valid MP4 file.

I'm sorry if you have some trouble playing the Stem files with VLC but it's working for me on macOS and Windows (it's even displaying the cover pretty nicely on Windows). The issue is probably coming from somewhere else.

And again, feel free to patch the code in ni-stem to use .mp4 if .m4a isn't working for you. This is why this repo is open-source!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants