[MPlayer-users] Problem with multiple mplayer in the same pipe

Rich Felker dalias at aerifal.cx
Wed Feb 13 03:17:08 CET 2008


On Tue, Feb 12, 2008 at 02:02:10AM -0500, Gilberto Abram wrote:
> On Feb 12, 2008 1:48 AM, Rich Felker <dalias at aerifal.cx> wrote:
> > On Tue, Feb 12, 2008 at 01:02:52AM -0500, Gilberto Abram wrote:
> > > Hey,
> > >
> > > I'm writing a little program that does some simple audio processing,
> > > and I wanted to use mplayer to convert audio files in a standard
> > > format that I use, and then save or listen to the output.
> > > The way I had in mind was by doing something like this:
> > >
> > > mplayer -af resample=48000:0:2,channels=1,format=s16ne -ao
> > > pcm:nowaveheader:file=/dev/stdout:fast $INPUT_FILE | ./a.out | mplayer
> > > -demuxer rawaudio -rawaudio channels=1:rate=48000:samplesize=2 -
> >
> > Umm, try this and look at the contents of "crap" and I think you'll
> > see the problem right away:
> >
> > mplayer -af resample=48000:0:2,channels=1,format=s16ne -ao
> > pcm:nowaveheader:file=/dev/stdout:fast $INPUT_FILE > crap
> 
> I am not sure what I am supposed to see other than the wave data in
> binary. crap works. in fact, as i said in the first post (and as I
> tried just now) by doing

I tried it and all of MPlayer's output text is at the beginning of the
file. If the number of bytes of text is not a multiple of 4, this will
seriously mess up your audio! MPlayer seriously needs to be fixed to
send this crap to stderr instead of stdout...

In the mean time you could make a named pipe (man mkfifo) to use in
place of stdout.

Rich



More information about the MPlayer-users mailing list