Discussion:
[FFmpeg-user] piping images into ffmpeg
Akilan R
2011-04-10 11:13:40 UTC
Permalink
Hi,

I have a C program which generates a series of images and I wanted to make
them into a video which should be streamed in real time or stored in a file.
While reading up ffmpeg documentation I came across repeatedly that ffmpeg
can take input from named pipes.

My question is in what format should the files given into the pipe should be
and how to input the files into the pipe.

I tried this:

$ cat hello-*.ppm | ffmpeg -f image2pipe -vcodec ppm -r 25 -i pipe: -r 25
output.mp4

but video was bad. (Here the input comes from already stored files as i was
testing; once it works i'll pipe in output from my program like this or
using named pipes.)
There is no problem with image files as this one worked flawlessly:

$ ffmpeg -f image2 -r 25 -i hello-%03d.ppm -r 25 output.mp4
--
அகிலன் (Akilan R)
[ blog.akilan.in ]
*I should have no use for a paradise in which I should be deprived of the
right to prefer hell.*
--Jean Rostand
Tim Nicholson
2011-04-11 06:56:33 UTC
Permalink
Post by Akilan R
Hi,
I have a C program which generates a series of images and I wanted to make
them into a video which should be streamed in real time or stored in a file.
While reading up ffmpeg documentation I came across repeatedly that ffmpeg
can take input from named pipes.
My question is in what format should the files given into the pipe should be
and how to input the files into the pipe.
$ cat hello-*.ppm | ffmpeg -f image2pipe -vcodec ppm -r 25 -i pipe: -r 25
output.mp4
but video was bad. (Here the input comes from already stored files as i was
testing; once it works i'll pipe in output from my program like this or
using named pipes.)
$ ffmpeg -f image2 -r 25 -i hello-%03d.ppm -r 25 output.mp4
Err, if "-f image2" is correct then why change it to "-f image2pipe" ?

What does something like:-

$ cat hello-*.ppm | ffmpeg -f image2 -r 25 -i pipe: -r 25 output.mp4

do?

I think image2pipe is more for output formatting. yuv4mpegpipe certainly is.
--
Tim

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
Akilan R
2011-04-11 08:07:26 UTC
Permalink
Post by Tim Nicholson
Err, if "-f image2" is correct then why change it to "-f image2pipe" ?
image2 is correct for getting input from consecutively numbered files.
image2pipe is for getting from pipe.
Post by Tim Nicholson
I think image2pipe is more for output formatting. yuv4mpegpipe certainly is.
Don't read '2pipe' as 'to pipe'; notice that first option also has 2 in the
end. :-)
--
அகிலன் (Akilan R)
[ blog.akilan.in ]
*I should have no use for a paradise in which I should be deprived of the
right to prefer hell.*
--Jean Rostand
Loading...