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

Play multiple audio tracks at the same time #6536

Closed
derekhearst opened this issue Mar 6, 2019 · 7 comments
Closed

Play multiple audio tracks at the same time #6536

derekhearst opened this issue Mar 6, 2019 · 7 comments

Comments

@derekhearst
Copy link

Is there any way to listen to multiple audio tracks of one video at the same time?

@zc62
Copy link
Contributor

zc62 commented Mar 6, 2019

#675

@cus
Copy link

cus commented Mar 6, 2019

I guess you can use --lavfi-complex.

@zc62
Copy link
Contributor

zc62 commented Mar 6, 2019

Indeed. If you do not require multiple ao's, just use --lavfi-complex='[aid1] [aid2] amix [ao]'. https://mpv.io/manual/master/#options-lavfi-complex

@Akemi Akemi closed this as completed Sep 21, 2019
@FLeXyo
Copy link

FLeXyo commented Feb 27, 2024

I know this is old as hell, but it showed up when I searched for this and I guess this could help someone in the future with the same problem. This ugly script I wrote will play audio track 1 and 2 at the same time if the video is located in a specific folder. I use this to check my Shadowplay recordings as they have an option for split audio tracks.

Put it in a file called *.lua in %appdata%\mpv\scripts or whatever the linux equivalent is (only tested on Windows though)

local folderPath = "F:\\Shadowplay"

local function starts_with(str, start)
    return str:sub(1, #start) == start
 end

mp.register_event("file-loaded", function(event)
    if (starts_with(mp.get_property("working-directory"), folderPath) and mp.get_property_number("track-list/count") > 2) then
        mp.set_property('options/lavfi-complex', "[aid1] [aid2] amix [ao]")
    end
end)

@niwazukihon
Copy link

The script above works, but I hope there are (1) an option to make this behavior default (possibly in mpv.conf); (2) a way to switch between Track 1, Track 2, Track 1+2, ..., in the player graphical interface.

I use multiple audio streams to separate out my mic input. Apparently this is also a much requested feature. For example, #10554, #4428, #675, #7684. Can this issue be reopened with those other issues merged to one issue?

@profpyrus
Copy link

I second this, I would love to be able to use mpv for viewing of my GPU-Screen-Recorder clips, but not if I need to switch tracks constantly. :D

@guidocella
Copy link
Contributor

#10554 (comment) can be upstreamed if maintainers deem it worth it.

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

8 participants