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

[Feature Request] Plugin to Downmix from > 2 Channels to 2 Channels (Stereo) #376

Open
andreas-glaser opened this issue Nov 9, 2022 · 6 comments

Comments

@andreas-glaser
Copy link

Any chance that someone clever could create a plugin that can downmix from 5.1/7.1 to Stereo?

Get Channel Count:

ffprobe -show_entries stream=channels -select_streams a:0 -of compact=p=0:nk=1 -v 0 "my-file.mp4"

Downmix

ffmpeg -i "my-file.mp4" -map 0:0 -map 0:1 -c:v:0 copy -c:a:0 aac -ac 2 "my-file-stereo.mp4"
@cattface
Copy link

I'd like to second this feature request - perhaps there is already a way to do it with custom commands but I've got no idea where to start.

It would be really useful for me because I only have a stereo setup along with the other users of my Plex server. Re-encoding would save loads of server resources having to down mix on the fly, especially as Plex doesn't do a great job most of the time.

@jtormalm
Copy link

This can already be accomplished by using "Audio Encoder AAC", just enable custom ffmpeg params and add "ac -2" to custom audio options

@cattface
Copy link

cattface commented Dec 15, 2022

This can already be accomplished by using "Audio Encoder AAC", just enable custom ffmpeg params and add "ac -2" to custom audio options

Thanks @DualScorch - however, after some further research there's a useful thread on SuperUser which recommends downmixing with Robert Collier's Nightmode Dialogue rather than just the ac -2.

This has the following parameters:
ffmpeg -i "sourcetrack.dts" -c dca -af "pan=stereo|c0=c2+0.30*c0+0.30*c4|c1=c2+0.30*c1+0.30*c5" "stereotrack.dts"
How would I adapt for Unmanics custom FFmpeg paramaters?

Many thanks!

@jtormalm
Copy link

Using -af pan=stereo|c0=c2+0.30*c0+0.30*c4|c1=c2+0.30*c1+0.30*c5 in custom audio options seems to do the trick for me :). You can't use the "-c dca" part (dts encoder) since aac is hardcoded into the plugin.

@andreas-glaser
Copy link
Author

Yes those custom commands work but will it also trigger a check and run/skip on already converted files which are not yet downmixed? I would assume we still need a plugin to do that?

@cattface
Copy link

Using -af pan=stereo|c0=c2+0.30*c0+0.30*c4|c1=c2+0.30*c1+0.30*c5 in custom audio options seems to do the trick for me :). You can't use the "-c dca" part (dts encoder) since aac is hardcoded into the plugin.

Thanks! Tested and working for me.

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

3 participants