0

The command

ffplay -f lavfi -graph testsrc2=d=1[out0];sine=d=1[out1] test.mp4

works fine. But the same arguments for ffmpeg (instead of ffplay)

ffmpeg -f lavfi -graph testsrc2=d=1[out0];sine=d=1[out1] test.mp4

produce only the error

[NULL @ 00000000006934c0] Requested output format 'lavfi' is not a suitable output format
test.mp4: Invalid argument

What's wrong with it?


Note:

From the FFmpeg documentation for the lavfi:

Currently only video data is supported.

It seems that's not true nowadays, at least ffplay works fine with audio (see my first command).
Or I incorrectly interpret this sentence?

But just in case I tried using the filtergraph testsrc2=d=1[out0];testsrc=d=1[out1] instead, with the same results — ffplay — OK, ffmpeg — the same error.

2

The ffmpeg tool can work with multiple inputs and outputs so the parser looks for -i to demarcate input options. The lavfi device will read the graph from the input argument

Use

ffmpeg -f lavfi -i "testsrc2=d=1[out0];sine=d=1[out1]" test.mp4
| improve this answer | |
  • Thanks for your answer, it works, I new this — IMHO — workaround. The base of my question was a little other (my flaw for not state it clearly) — is the documentation for lavfi inappropriate / incomplete / obsolete? Is the parser for the ffmpeg command different from the one for ffplay (for the lavfi device)? – MarianD Feb 8 at 5:25
  • Yes, ffmpeg, ffplay and ffprobe each has its own parser. The lavfi device is a component within the libavdevice library which may be used by other frontends, so the interface will depend on the frontend. – Gyan Feb 8 at 9:04
  • Thank you very much. – MarianD Feb 8 at 15:04

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.