I am extracting individual video frames by starting the ffmpeg process from my C # code. The default behavior is to write these images to disk. However, to speed up processing, I want to redirect the standard output of ffmpeg to get the stream and process it further in my program.
I use arguments like this:
-i \"" + Filename + "\" -vf \"scale=640:-1\" -an -vframes 100 -r 1 -f image2 -
This redirects the stream of bytes to standard output, which I can redirect to my program using process.StartInfo.RedirectStandardOutput = true.
This may work fine for movie streams, since I have only one output, but the call above will create 10 separate images (when writing to the hard drive), how can I parse the byte stream from the standard output and split it into single files?
source
share