mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.53k stars 2.92k forks source link

Play multiple audio tracks at the same time #6536

Closed derekhearst closed 5 years ago

derekhearst commented 5 years ago

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

zc62 commented 5 years ago

675

cus commented 5 years ago

I guess you can use --lavfi-complex.

zc62 commented 5 years ago

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

FLeXyo commented 8 months ago

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 commented 2 months ago

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 commented 1 month ago

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 commented 1 month ago

https://github.com/mpv-player/mpv/issues/10554#issuecomment-2259973949 can be upstreamed if maintainers deem it worth it.