using pipes to channel file i/o to another process

核能气质少年 提交于 2019-12-02 03:00:32

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!