Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a program that generates a script for gnuplot, which in turn generates a lot of png images and send it to stdout. I want to pipe these images to ffmpeg without writing them to the disk. This is my command line so far:

./myprogram | gnuplot | ffmpeg -c:v png -i - -c:v libx264 -preset medium -crf 24 output.mkv

Unfortunately, this does not seem to be the way, ffmpeg complains "pipe:: Invalid data found when processing input".

Is there a way or am I forced to dump the numbered pngs to disk and then pass ffmpeg something like -i %10.png?

share|improve this question
Hm, this is beyond my FFmpeg knowledge, but I'm not too sure this is supposed to work that way – maybe you need a FIFO? See here. – slhck May 18 '12 at 21:17
@slhck well, that pages shows how to create a pipe in C and stream raw image data. That would be welcome too, if I know a command line program that can do the conversion png->raw image array. – Lorenzo Pistone May 18 '12 at 21:22
try to use -f image2pipe – leepfrog May 18 '12 at 23:28
@leepfrog with some fiddling, it works! feel free to post the answer. Anyway, there are some quirks, it does not seem to work with piped png images. The program that generates the image is gnuplot, and I had to switch its output to pbm. – Lorenzo Pistone May 19 '12 at 8:25
up vote 1 down vote accepted

Try to use -f image2pipe, it is not documented on the official documentation but worked for my for a similar issue

share|improve this answer
jpeg works, png support has been added 9/5/2012, pbm is broken (, gif is broken. – Lorenzo Pistone May 20 '12 at 9:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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