How can I pipe the output of ffmpeg to ffplay?

At the moment I use a workaround in bash :

mkfifo spam
(ffplay spam 2> /dev/null &) ; capture /dev/stdout | ffmpeg -i - spam
link|improve this question

feedback

2 Answers

up vote 2 down vote accepted

I do not know if it is ffmpeg that cannot output its data to stdout, or ffplay that cannot take its input from stdin.

If it is ffmpeg that cannot output its data to stdout:

capture /dev/stdout | ffmpeg -i - >(ffplay 2> /dev/null)

(You migth need to add a - argument to ffplay so it takes its input from stdin.)

If it is ffplay that cannot take its input from stdin:

ffplay <(capture /dev/stdout | ffmpeg -i -) 2> /dev/null

For more informations about the <(command) and >(command) construct, see the Process Substitution section of the bash manual.

link|improve this answer
feedback

ffmpeg supports piping operations. See that section of the documentation here.

I don't know how ffplay works, but to pipe the output of ffmpeg to standard output, you can add the pipe command to the end of the ffmpeg command. Example:

ffmpeg -i input.flv pipe:1 | ffplay -i -
link|improve this answer
thanks, i somehow missed that section of the man pages.. however i could not get this construct to work, the output filename needs to be removed from ffmpeg and input pipe added to ffplay args. i will edit your post accordingly.. – wim Aug 18 '11 at 3:09
Thanks. As I said, I've never used ffplay before, but I know ffmpeg. – matzahboy Aug 18 '11 at 13:17
feedback

Your Answer

 
or
required, but never shown

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