Comments (6)
from stemgen.
If you get a ffmpeg command line binary (either for windows directly or WSL linux-for-windows), you can use a command line like the following :
for name in 0 1 2 3 4; do ffmpeg -i example.stem.m4a -map 0:${name} -acodec copy channel${name}.m4a ; done
This runs ffmpeg 5 times, extracting one channel at a time, doing a stream copy with no decode step.
To do this in one command, one can use filter_complex :
ffmpeg -i example.stem.m4a -filter_complex 'channelsplit=channel_layout=5.0[C0][C1][C2][C3][C4]' -map '[C0]' -ac 2 -codec alac channel0.m4a -map '[C1]' -ac 2 -codec alac channel1.m4a -map '[C2]' -ac 2 -codec alac channel2.m4a -map '[C3]' -ac 2 -codec alac channel3.m4a -map '[C4]' -ac 2 -codec alac channel4.m4a # for ALAC input to ALAC lossless output
or
ffmpeg -i example.stem.m4a -filter_complex 'channelsplit=channel_layout=5.0[C0][C1][C2][C3][C4]' -map '[C0]' -ac 2 channel0.flac -map '[C1]' -ac 2 channel1.flac -map '[C2]' -ac 2 channel2.flac -map '[C3]' -ac 2 channel3.flac -map '[C4]' -ac 2 channel4.flac # for ALAC input to FLAC lossless output
(I've used .flac in the second example instead of .m4a because it's lossless to lossless with ALAC input, and FLACs are more supported in external programs than ALAC files. Replace .flac with .m4a and add "-codec AAC" AAC output. The above commands are totally lossless if done with ALAC lossless stems. Unfortunately if done with lossy stem input, this will result in a decode (and re-encode) step, as one cannot combine filter_complex with stream copying.)
For example :
ffmpeg -i example.stem.m4a -filter_complex 'channelsplit=channel_layout=5.0[C0][C1][C2][C3][C4]' -map '[C0]' -ac 2 -codec aac channel0.m4a -map '[C1]' -ac 2 -codec aac channel1.m4a -map '[C2]' -ac 2 -codec aac channel2.m4a -map '[C3]' -ac 2 -codec aac channel3.m4a -map '[C4]' -ac 2 -codec aac channel4.m4a # WARNING! If using AAC input, this does a lossy to lossy recode
These commands appear to produce 5 different stereo files, as expected, though in fairness I have not verified that they are identical to each of the stereo input channels from the Stems. Based on my understanding of filter_complex and -ac 2, they should be.
from stemgen.
https://djtechtools.com/amp/2015/09/15/hacking-stems-how-to-extract-instrumentals-from-stem-files/
Here is a guide that may be helpful
from stemgen.
If you are in macos you could also use this: https://github.com/faroit/SplitStems
Maybe we could integrate that functionality also here?
from stemgen.
Thanks for the suggestions!
Sadly the Audacity method doesn't work for me, I installed FFmpeg for Audacity but it doesn't find that specific library
and I'm on Windows
The only "workaround" for me is to import each song in Audition, then extract channels to mono, then combine the L and R channels for each stem... which takes just a very long time per song
from stemgen.
I wrote Stemsep for this specific use case: https://github.com/axeldelafosse/stemgen/blob/master/stemsep.py
It's using a fork of Stempeg (included in the repo too: https://github.com/axeldelafosse/stemgen/tree/master/stempeg). But as @awesomer pointed out, you can use FFmpeg directly to do this.
If that's a common use case I'll probably add some docs!
from stemgen.
Related Issues (20)
- Sweep(slow): Review the codebase and make suggestions to make the code more readable and Pythonic HOT 1
- Sweep: Refactor ableton.py to be cleaner, extracting any methods you can into separate files if that makes sense HOT 1
- Sweep: Add comments and docstrings to ableton.py. Clarify each method and global HOT 1
- Mutagen missing in installation instructions HOT 1
- Converting multiple songs at once? HOT 3
- [Feature request] Extract only vocals and instrumental HOT 2
- Error opening input: No such file or directory HOT 8
- How to know if qaac encoder is used on Windows? HOT 2
- [Feature request] Custom name & color for stem HOT 2
- [Bug] Windows cleaning step failing HOT 5
- [Feature Request] Following the Stem File Specification HOT 1
- [Bug] ALAC stems can't be read on Windows within Traktor HOT 4
- Google Colab version? HOT 1
- [No such file or directory] \output/NoGoodbye/htdemucs/NoGoodbye/drums.wav HOT 1
- Getting an error, when running the docker script version. HOT 2
- Error opening input: no such file or directory
- Generated file has wrong file extension .stem.m4a instead of .stem.mp4 HOT 5
- mp3 processing HOT 1
- Processing without a metadata file as an input HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stemgen.