Quoting Brian Foster <blf at utvinternet.ie>:
> | I did the following:
> |
> 1| $ mkfifo f1
> 2| $ lav2yuv capture.avi | yuvdenoise | tee f1 | mpeg2enc blah blah &
> 3| $ cat f1 | mpeg2enc different blah blah
> |
> | And hey! It works! Until somebody dies! Yippe... oh. [ ... ]
>> ( a winner of the Useless Use of cat(1) Award: you don't need
> the `cat f1 |' in the 3rd line, a simple `<f1' will suffice. )
Grrr... I've had that bad habit since MS-DOS 3.2
> upshot is a POSIX.2 `tee' would probably spit out an error
> message if one of the `mpeg2enc's dies, but the remaining
> one would continue to be fed data and hence run until it
> either completes or dies for reasons of its own. which is
> exactly what you want! so what is happening??
<contrition>
Oops.
</contrition>
Um, my test was to tee to a fifo I didn't read from... resulting in the other
reader hanging around forever.... not realising that never-opened-for-reading
and opened-and-later-closed might be different. Sensible behaviour has now been
observed.
> incidently, if your shell and system both support process
> redirection, you could do the above as a one-liner. syntax
> varies depending on the shell, but in bash(1) and ksh(1):
>> lav2yuv capture.avi | yuvdenoise | \
> tee >(mpeg2enc different blah blah) | mpeg2enc blah blah
mpeg2enc generates stats during the run, so I give each one an xterm.
Thanks,
Ronan
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!