Reputation: 327
I'm trying to join two mp4 video files, but I'm getting following error:
Unable to find a suitable output format for 'ffmpeg'.
ffmpeg: Invalid argument
My code is below:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "path to ffmpeg";
startInfo.Arguments = "ffmpeg -f concat -i "+path_to_text_file+" -c copy "+path_to_output_video;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
try
{
Process process = Process.Start(startInfo);
while (!process.StandardOutput.EndOfStream)
{
Console.WriteLine("Process Standard Output : " + process.StandardOutput.ReadLine());
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
My input text file is like
file '/path/to/input0'
file '/path/to/input1'
Can anyone point out where I'm going wrong.
Upvotes: 1
Views: 1119
Reputation: 1249
The first thing i can see is that you're using "ffmpeg " as part of your argument. This would be for calling the executable. But you already do that when defining the target FileName. So the final command looks kinda like this:
"\ffmpeg ffmpeg -f concat -i ...."
So if you remove the "ffmpeg" part from your argument and try again :-)
Upvotes: 1