26

I am trying to record my desktop and save it as videos but ffmpeg fails.

Here is the terminal output:

$ ffmpeg -f alsa -i pulse -r 30 -s 1366x768 -f x11grab -i :0.0 -vcodec libx264 - preset ultrafast -crf 0 -y screencast.mp4
...
Unable to find a suitable output format for 'pipe:'
2
  • 2
    add -f mp4 just before filename and move -r 30 -s 1366x768 before -vcodec Commented May 15, 2014 at 20:08
  • @Ulterior That will result in x11grab using default settings (-r 25 -s 648x480), so your suggestion of changing these options from input options to output options will cause frame duplication (25 to 30) and upscaling (640x480 to 1366x768). -f mp4 is superfluous in this case. Commented May 16, 2014 at 6:34

1 Answer 1

64

typo

Use -preset, not - preset (notice the space). ffmpeg uses - to indicate a pipe, so your typo is being interpreted as a piped output.

pipe requires the -f option

For users who get the same error, but actually want to output via a pipe, you have to tell ffmpeg which muxer the pipe should use.

Do this with the -f output option. Examples: -f mpegts, -f nut, -f wav, -f matroska. Which one to use depends on your video/audio formats and your particular use case.

You can see a list of muxers with ffmpeg -muxers (not all muxers can be used with pipe).

Sign up to request clarification or add additional context in comments.

1 Comment

Just to point out, the order of options is important too. E.g. your -f mp3 should come after the -i parameter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.