[MPlayer-users] How to play and record (audio/video) at the same time? NOVIRUS : Recording from MPlayer stream

zimon@iki.fi zimon at niksula.hut.fi
Sun Aug 31 18:56:50 CEST 2003

On Sun, Aug 31, 2003 at 11:47:44AM -0400, Alexandre Dery wrote:
> MPlayers plays directly to the sound card (ie not using KDE sound daemon), 

Yes it would be nice if MPLayer would support esound.

> so I can't use that to record.
> So I'm kinda lost here. Any ideas ?

How about playing the sound through SDL (-ao sdl)? 
< http://www.libsdl.org/index.php >
Does SDL support recording at the same time as it is playing? 

I think this patch would do it, somehow:

< http://www.libsdl.org/pipermail/sdl/2003-July/055249.html >
With full duplex sound card, or with two sound cards, it would be obvious

Also, haven't tried, but if I understood correctly you can output sound
from SDL-driver to the file:
< http://www.libsdl.org/pipermail/sdl/2001-June/036544.html >

By default SDL-driver is probably not build with this "disk support" as
the above URI says, but after it is, one should be able to do write audio
to the file by provinding:
$ mkfifo /tmp/fifo
$ export SDL_AUDIODEVICE=disk
$ export SDL_DISKAUDIOFILE=/tmp/fifo
$ mplayer -ao sdl rtsp://foo.bar/audio-stream
Now SDL-driver should write to /tmp/fifo (if it would know how to append)
and at the same time one could read and play the fifo file with XMMS, which
in turn would use for example esound, and then one could record it at the 
same time. 
It might just work.

If not the same time, you can always first copy the stream and
then watch. Ofcourse if it is a (forever) continuing stream, it won't work.
$ mencoder -oac copy -ovc frameno -o audio.avi rtsp://foo.bar/audio-stream

The above fifo-trick would work with MPlayer, if there would be an option
to open the outputfile in APPEND-mode, wouldn't it? Wouldn't it work
also with video-files?

More information about the MPlayer-users mailing list