[LAD] Mplayer decode to stdout

Robin Gareus robin at gareus.org
Sun Jan 29 00:37:23 UTC 2012

On 01/28/2012 11:35 PM, Alfs Kurmis wrote:
> Hi Experts.
> For my small multimedia audio project i wanna use mplayer as external decoder.
> As usually via pipe , for example so
> mplayer -af resample=44100:0:1,channels=2,format=s16le -ao 
> pcm:nowaveheader:file=/dev/stdout -quiet -really-quiet 'saund_file.ext' | 
> nextprog -options ...
> or so
> http://martini.pudele.com/radio/programming/audio/mplayerdecso01.c
> I prefer output to pipe, not FIFO.
> It seems that mplayer also all messages put to stdout :(

That's probably why mplayer devs recommend using mkfifo (named pipe)
instead of stdout.. 'mencoder' can do it.

If you need to support a variety of unknown formats and codecs: ffmpeg
is an alternative and gstreamer might be one.

ffmpeg -i /some/file -f u16le -acodec pcm_s16le -ar 44100 - \
| jack-stdin system:playback_1 system:playback_2

on that note, `jack-stdout` can capture and pipe raw PCM data from any
JACK-application including `mplayer -ao jack /some/file`. YMMV.


More information about the Linux-audio-dev mailing list