string strParam;
string Path_FFMPEG = @"C:\Windows\system32\cmd.exe";
string WorkingDirectory = @"C:\Users\Braintech\documents\visual studio 2013\Projects\convertVideo\convertVideo";
string command1 = "ffmpeg -i video1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts";
string command2 = "ffmpeg -i video2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts";
string command3 = "ffmpeg -i" + "concat:intermediate1.ts|intermediate2.ts" + " -c copy -bsf:a aac_adtstoasc Output.mp4";
string Command = @"" + command1 + " & " + command2 + " & " + command3 + " ";
strParam = "ffmpeg -f concat -i " + file + " -c copy " + strResult;
process(Path_FFMPEG, Command, WorkingDirectory);
public static void process(string Path_FFMPEG, string Command, string WorkingDirectory)
{
try
{
Process ffmpeg = new Process();
ProcessStartInfo ffmpeg_StartInfo = new ProcessStartInfo(Path_FFMPEG, Command);
ffmpeg_StartInfo.WorkingDirectory = WorkingDirectory;
ffmpeg_StartInfo.UseShellExecute = false;
ffmpeg_StartInfo.RedirectStandardError = true;
ffmpeg_StartInfo.RedirectStandardOutput = true;
ffmpeg.StartInfo = ffmpeg_StartInfo;
ffmpeg_StartInfo.CreateNoWindow = true;
ffmpeg.EnableRaisingEvents = true;
ffmpeg.Start();
ffmpeg.WaitForExit(30000);
ffmpeg.Close();
ffmpeg.Dispose();
ffmpeg = null;
}
catch (Exception ex)
{
}
}
I m trying to merge two video using ffmpeg. But it is working manually but not able to execute using c# code.it works when i run the command on cmd manually. But when i am trying to run using c# it not works.Please help someone. Thanks in advance.