[MPlayer-users] playing multiple audio tracks simultanously
Tomasz Mloduchowski
qdottbm at gmail.com
Thu Nov 30 20:03:12 CET 2006
I'd do the following (it's a HUGE, untested hack, similar to mplmult.sh)
mkfifo stream.yuv
mkfifo track1.wav
mkfifo track2.wav
mplayer -ao pcm:file=track1.wav -vc null -aid 0 dvd:// &
mplayer -ao pcm:file=track2.wav -vc null -aid 1 dvd:// &
mplayer -vo yuv4mpeg -nosound dvd://
#that should instantiate 3 decoding processes. (keep the window open)
#and now, for the main course:
mplayer stream.yuv -audiofile track1.wav
mplayer -ao alsa:device=whatever -vo null stream.yuv -audiofile track2.wav
and, for pausing the entire mess (no seeking), press space on the
window handling -vo yuv4mpeg. I think some shell script could be used
to do message passing between mplayer slave modes..
should work, but I didn't test it myself with two audio streams.
Tomasz
On 11/30/06, Alexander Roalter <alex at roalter.it> wrote:
> Ivan Kowalenko wrote:
> >> (I'd like to watch multi-language movies with a friend that can only
> >> understand english, while I can only understand italian. I'd like
> >> not to use
> >> subtitles. Instead, we'd use two headphones connected to two
> >> different sound
> >> cards on the same linux laptop)
> >
> > I have a possible solution. Try to start two simultaneous instances
> > of MPlayer, one playing the video an an English soundtrack, and
> > another with no video output -vo null or something, playing the audio
> > soundtrack. Now, I'm not totally sure how to configure output for two
> > separate cards, but it could be theoretically possible to use a
> > surround sound audio card, and output one sound track to one set of
> > channels, and the other sound track to the other set of channels.
> > Just hook up headphones.
>
> Since it seems there are two soundcards, no need for configuring the
> surround.
>
> Just start
>
> mplayer video -ao alsa:device=hw=0.1
>
> and
>
> mplayer video -ao alsa:device=hw=1.1 -vo null
>
>
> With enough speed it should work, but the problem here is a) sync, which
> is not guaranteed to be kept over the entire movie, and b) if one
> instance pauses, the other will go on, making it very difficult getting
> in sync again.
>
> OTOH it is also probably difficult accessing a DVD drive simultaneously
> from two programs, (ok, maybe caching should do the trick here, as
> almost the same sectors are read during one specific point in time).
>
> *IF* there was a method for creating 4-channel audio, inputting one
> soundtrack to the front channels and the other soundtrack to the rear
> channels, one could remux the video again, and therefore keeping sync
> over the entire movie, pausing every stream in parallel, and plugging
> one headphone to the frontspeaker exit, one to the rear speaker.
>
> And best it would be if there was a method doing this on the fly...
>
> _______________________________________________
> MPlayer-users mailing list
> MPlayer-users at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/mplayer-users
>
More information about the MPlayer-users
mailing list