axeldelafosse / stemgen

🎛 Stemgen is a Stem file generator. Convert any track into a Stem and have fun with Traktor.
https://stemgen.dev
MIT License
212 stars 39 forks source link

[Feature Request] MP3 support #18

Closed stathius closed 1 year ago

stathius commented 1 year ago

Why not add mp3 support? I manually added it in the supported types and seems to work fine.

benjaminlewandowski commented 1 year ago

My guess is that extracting the stems from a lossy file isn't as accurate.

stathius commented 1 year ago

It worked well for a couple of tracks that I tried. A lot of people have their music library in mp3s so it would probably be beneficial to add this option.

axeldelafosse commented 1 year ago

Hey! Sorry but I don't want to encourage people to separate stems from lossy formats. We need to encode to WAV when using Demucs, so it's pretty bad to use MP3 files as input. You shouldn't do this.

axeldelafosse commented 1 year ago

This script is opinionated on defaulting to the highest quality possible -- it means using lossless formats (both as inputs and outputs).

MacTheZazou commented 1 year ago

@axeldelafosse I can't find any information that back up the fact that using lossy formats as input is bad with DEMUCS... In fact DEMUCS is trained with lossy audio:

All files from the musdb18 dataset are encoded in the Native Instruments stems format (opens new window) (.mp4). It is a multitrack format composed of 5 stereo streams, each one encoded in AAC @256kbps.

axeldelafosse commented 1 year ago

Sorry but I don't have the time to argue about this. Lossy formats are bad.

The quote you shared is for the compressed dataset, surely the models are trained using the uncompressed dataset.

Splitting a song from MP3 and then encoding it in AAC is clearly impacting the audio quality. Don't do that.

MacTheZazou commented 1 year ago

You're right, I didn't follow the link correctly. Thank you for your work, it's incredible! I would love to do a Blind-test on some big PA though.

axeldelafosse commented 1 year ago

Thank you, really appreciate it.

Yeah to be honest I'm not sure I understand exactly how Demucs is impacting the audio quality. I'll try to dig into that at some point.

CarlosLeonCode commented 6 months ago

I read the thread... I use to do is the following:

Having this in mind, why not create a functionality to convert mp3 - 320kbps to wav and then can create the stems? I could help with this feature.