mpv-player / mpv

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

Multiple (different language) audio outputs #675

Open ghost opened 10 years ago

ghost commented 10 years ago

Could you add a possibility to playback multiple audio tracks at the same time, using different audio devices? Here's an example scenario in which this would be very helpful: You want to watch a movie together with some other person. But while he/she wants to hear to her his/her native language's synchro, you want to hear the original English sound track. This would be no problem if you could output the different tracks to different devices.

ghost commented 10 years ago

IMO this is a pretty obscure (almost fringe) feature.

It's pretty hard to synchronize two audio outputs at once (they'll slowly but certainly desync, unless you do "something"), so I'd rather not do it.

Maybe you should look at tings like syncplay instead, which synchronize two separate players.

heinrich5991 commented 4 years ago

Can you explain why audio outputs will desync? mpv already keeps the audio synced to the video, why would adding another change that? If both audio outputs were synced to the video, it'd be fine.

ghost commented 4 years ago

At the time this was posted, mpv could only only synchronize video to audio. Synchronizing video to audio is pretty simple (you just adjust the video timing), while synchronizing audio to anything else requires resampling (which can get tricky because you need to pick the right resampling ratio, without making it "wobble"). At the present time, having multiple audio outputs would still be hard, because the synchronization code is hardcoded to deal with video only. I plan to change that, and then maybe having multiple audio outputs would be relatively simple to do.

heinrich5991 commented 4 years ago

I see, thanks for the explanation. :)

drcouzelis commented 2 years ago

IMO this is a pretty obscure (almost fringe) feature.

I found this thread when searching how to play two audio tracks at once. I record videos in OBS Studio and record the audio on separate tracks. Being able to play multiple audio tracks at once would allow me to preview the video before editing.

LifeJustDLC commented 1 month ago

Additional personal use case: There's a lot of "同時視聴" (watch same content with fans simultaneously) stream archives made by tons of streamers and vtubers. It is embarrassing that there's still no any method yet to sync "pause", "rewind" and other frequently used operations, while preserving that fragile time offset. Except mpv, though with a little but unbearable desync between original video and original audio.

(FYI, VLC doesn't merge audio; GridPlayer doesn't sync operation other than "pause" and is not maintained any more I guess.)