Just started learning/using pipes and was wondering how to route file output of an application into a pipe so that another application can use it.
To be exact, I want t
ffmpeg can be persuaded to output to a pipe:
ffmpeg -i whatever.avi -f mp4 -
The "-" tells it to output to stdout instead of to a file, and the "-f" tells it what output the output file should be.
You could redirect that to a named pipe, of course, but calling it with popen
to get the output as a file descriptor directly seems the way to go to me.
ffmpeg can also read from stdin and write to stdout like this:
ffmpeg -i pipe:0 -f wav pipe:1
where 0 and 1 are the standard POSIX file descriptors.