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?
2 Answers
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 can't infer the desired output format in this case, output format must be explicitly specified before -
using -f fmt
(replace fmt
with what format is desired).
ffmpeg -video_size 1920x1080 -framerate 25 -f x11grab -i :0.0 -f fmt - | process
-
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. Commented Jan 7, 2019 at 5:23 -
nut
is better thanmatroska
in the sense thatnut
is a low overhead container (or atleast claimed), butmatroska
has more support across programs thannut
. @Scott– tripulseCommented Oct 2, 2020 at 11:06