> > hallo,
> > i want to run mplayer on two monitors, but only one app can read from
> > /dev/video at the same time. So i tried to read from /dev/video with a
> > named pipe:
> > mkfifo /stream
> > cat /dev/video > /stream
> > When i now start the first mplayer it reads it data fine, but when i
> > start the second mlpayer, every mplayer gets only half of the stream.
> > So my problem is how to copy/divide one stream into two streams under
> > bash (with named pipes for example, or are they two slow??)??
> > (I'm using Debian Woddy)
> > Much thanks for your attention and help
> > Andreas Krings
> You might take a look at tee. It is normally used to write output to the
> monitor and a file simultaneously, but might work for you here.
> `tee': Redirect output to multiple files
> ========================================
> The `tee' command copies standard input to standard output and also
> to any files given as arguments. This is useful when you want not only
> to send some data down a pipe, but also to save a copy. Synopsis:
> tee [OPTION]... [FILE]...
> If a file being written to does not already exist, it is created.
> If a file being written to already exists, the data it previously
> contained is overwritten unless the `-a' option is used.
> The program accepts the following options. Also see *Note Common
> options::.
> `-a'
> `--append'
> Append standard input to the given files rather than overwriting
> them.
> `-i'
> `--ignore-interrupts'
> Ignore interrupt signals.
> That's info tee above
> Farley
Hallo Farley,
first i want to say thanks for helping!!
But the tool "tee" does not work for me! When i try
"mkfifo /stream1 /stream2"
and then
"tee /stream1 < /dev/video > /stream2"
or
"tee /stream1 /stream2 < /dev/video > /dev/null"
a got the problem that in the first case i can only read from stream1
after i tried to read from stream2 (with getting no data). Without
reading
from stream2 first i can try to read from stream1 as much as i like
but did
not get any data. For getting the data i have to read from stream2
first (without getting data), and then from stream1 to get the data.
Furthermore when i get data from stream1 i cannot get data from
stream2 (it was not possible to get data from stream2 at any time for
me, even if i first tried stream1 and then stream2 or something like
that).
In the second try i only got data when i first red from stream1
(without sucess) and then red from stream2. In no other case i got
data from any stream!!!!
So i think, tee is not able to stream data into two named pipes at one
time, is this possible??!? Or is this a bug in tee??
- And if this the case, is there another way or another tool that can
copy or divide a stream into two streams or are there any other
videoprograms which can output their picture on two monitors (from a
mpeg2-ts stream)??
Thanks much and a happy new year!!!
Andreas Krings
PS: tee --version is 2.0.11 and I'm using bash --version 2.05b.0