I've been doing some video compression from VHS using mjpegtools, and trying
different bitrate/quantisation/algorithm mixes to see what gives best results.
The whole thing is a three stage pipeline:
lav2yuv capture.avi | yuvdenoise | mpeg2enc --lots-of-args -o capture.m1v
(100 mins) (260 mins) (236 mins)
The times are cpu time for a particular segment of video. All compression runs
use the same first two stages - 360 mins. Obviously, I want to do that once and
send the results to lots of encoding processes.
I did the following:
$ mkfifo f1
$ lav2yuv capture.avi | yuvdenoise | tee f1 | mpeg2enc (blah blah) &
$ cat f1 | mpeg2enc (different blah blah)
And hey! It works! Until somebody dies! Yippe... oh.
I could wrap mpeg2enc in a script that detected a death-by-error and catted the
fifo to /dev/null, but has anyone got a better way of doing this?
Oh, and writing the result of the first to stages to disk is not a better way.
Unless you have a very, very, very big disk. :-)
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!