Thursday, June 18, 2009

circular bash pipes

Today I had the terrible idea of a circular bash pipe. Turns out, you can do this easily with fifos. Here's a simple yes-like program done with a circular pipe, to demonstrate:

echo "y" | cat - fifo | tee fifo

You may now return to your regularly scheduled sanity.

Monday, June 8, 2009

save a stream with mplayer

Neat little trick I learned today. If you have a stream that mplayer can play and you want to save it to a file for later use, this will do the trick:

mplayer "some_stream" -ao pcm:file=file.wav

that produces a raw WAV file, which you can then convert to the format of your preference with other tools like ffmpeg.
Creative Commons License All content on this blog is licensed under a Creative Commons Attribution-Share Alike 3.0 license unless otherwise noted.