I have the following code that passes data to the ffmpeg process through a thread.
public void VideoToImages3()
{
var inputFile = @"C:\testvideo.avi";
var outputFile = @"C:\outputFile.mp4";
var process = new Process
{
StartInfo = new ProcessStartInfo
{
RedirectStandardInput = true,
UseShellExecute = false,
CreateNoWindow = true,
Arguments = $"-y -i - {outputFile}",
FileName = _ffmpeg
},
EnableRaisingEvents = true
};
process.Start();
//Write input data to input stream
var inputTask = Task.Run(() =>
{
using (var input = new FileStream(inputFile, FileMode.Open))
{
input.CopyTo(process.StandardInput.BaseStream);
}
});
Task.WaitAll(inputTask);
process.WaitForExit();
}
In this case, I only upload 1 file through the stream (-i -). What if I need to stream multiple input files (-i - -i -). For example, when adding an Audio File to a Video File?
"ffmpeg -y -i {audioFilePath} -i {videoFilePath} {outputFilePath}"
How to transfer files via StandardInput if 2 input arguments are specified???
I can't find a solution