0

I'm currently using the answer to this question to pipe a string of bitmaps into ffmpeg. It requires redirecting StandardInput stream and writing to it.

Is something similar available with NRECO.VideoConverter? Is there a way to get either access to the running process, or access to just the StandardInput base stream?

DanTheMan
  • 3,277
  • 2
  • 21
  • 40

1 Answers1

2

If you want to provide input data to stdin or read output data from stdout (or both) you may use ConvertLiveMedia method; it has overloads for different usage scenarios:

var videoConv = new FFMpegConverter();          
var ffMpegTask = videoConv.ConvertLiveMedia(
    "rawvideo",
    h264stream, 
    "h264",
    new ConvertSettings() {
        CustomInputArgs = String.Format(" -pix_fmt bgr24 -video_size 640x480 -framerate 5 ", 
            frameBmp.Width, frameBmp.Height)
    });
ffMpegTask.Start();
ffMpegTask.Write( bmpBytes );  // call N times for each input frame. Image size should be exactly 640x480
ffMpegTask.Stop();

You can adopt this code snippet for "image2pipe" if needed.

Vitaliy Fedorchenko
  • 8,447
  • 3
  • 37
  • 34