I want to pipe ffmpeg output to some other process like this: ffmpeg -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0 - | process. I get Unable to find a suitable output format for 'pipe:' pipe:: Invalid argument. How do I achieve piping?


You have to provide the format with -f, such as:

ffmpeg … -f matroska - | process
  • For a list for available formats see ffmpeg -formats.
  • Note that some formats (typically MOV), require the output protocol to be seekable, so they will fail with the pipe output protocol.
  • Also see FFmpeg Documentation: Pipe Protocol.

FFmpeg doesn't knows what format to output on that's why only specifying - as output would not work. Use the option -f <muxer/demuxer> to output to pipes.

This command should work:

This command uses nut as container. You could use any formats listed here.

ffmpeg -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0 -f nut - | process

How's it better than matroska?

matroska is a mkv file. nut can contain all types of audio/video/subtitles. Using mkv may restrict you using only some codecs which it supports.

  • The other answer provides -f fmt.  In fact, the question already has a -f fmt.  Can you provide a reference on the “nut” protocol and describe how it is better than Matroska? Please do not respond in comments; edit your answer to make it clearer and more complete. – Scott Jan 7 at 5:23
  • As, you said I clarified the answer! – nullptr Jan 7 at 5:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.