using pipes to channel file i/o to another process

前端 未结 2 1325
南笙
南笙 2021-01-25 04:13

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

2条回答
  •  长情又很酷
    2021-01-25 04:57

    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.

提交回复
热议问题