[MPlayer-users] Re: Reading raw audio/video streams

Oliver Fromme olli at lurza.secnetix.de
Fri Aug 15 20:29:26 CEST 2003


Geoffrey Hausheer wrote:
 > Richard Felker wrote:
 > > > Does anyone have a suggestion as to how I can make this work without
 > > > generating intermediate files (either using fifos or a muxed stream to
 > > > stdout?).  I don't want to deal with the complexity of adding a
 > > > container...that is what I'm using mencoder for in the first place.
 > >
 > > Uhh, why not just use -audiofile audout.fifo instead of a file?!?!
 > 
 > Well, the problem is that mencoder reads from -audiofile at a different
 > rate than stdin.
 > So if I have a program writing to two fifos, and mencoder reading from
 > two fifos, and since fifos are always blocking, eventually mencoder ends
 > up blocking on a read from one stream, while the writer ends up blocking
 > on writing to the other stream, and everything deadlocks.

I had a very similar problem in my dvd-to-vcd script, which
uses mplayer + mjpegtools.  The audio and the video parts
are handled in two parallel pipes, using FIFOs.  During my
first attemps, I always got those dead-locks, exactly like
you did.  Then I inserted huge buffering processes into
both pipes (10 Mbytes per buffer process), which decoupled
the data sources and data sinks from each other, so to speak.
No deadlocks anymore.

Regards
   Oliver Fromme

PS:  I use "sob" for buffering, but there are other tools
for that purpose, too.

http://www.secnetix.de/~olli/tarballs/sob.tar.gz

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

On the statement print "42 monkeys" + "1 snake":  ``By the way,
both perl and Python get this wrong.  Perl gives 43 and Python
gives "42 monkeys1 snake", when the answer is clearly "41 monkeys
and 1 fat snake"''.        -- Jim Fulton



More information about the MPlayer-users mailing list