Click here to Skip to main content
14,303,949 members
Rate this:
Please Sign up or sign in to vote.
See more:
i have two video files video1 and video2 tring to merge it using ffmpeg but the code i have executed output nothing and no errors are thrown possibly iam doing it in a wrong way correct me if iam wrong

What I have tried:

protected void combinetwovideo()
      {

          string strParam;
          string Path_FFMPEG = Path.Combine(HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["FFMpegPath"]));
          string apppath=HttpRuntime.AppDomainAppPath;
          //Merging two videos
          String video1=apppath+"\\recordings\\client2019-08-03 02_23_59";
          String video2 =apppath+"\\userrecord\\User2019-08-03 02_24_00";
          String strResult =apppath+"\\RESULT\\";


          strParam = string.Format("-i ('" + video1 + "') -i ('" + video2 + "') -filter_complex \'[0:v]pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]' /-map [vid] -c:v libx264 -crf 23 -preset veryfast output.mp4");
          process(Path_FFMPEG, strParam);

      }
      public void process(string Path_FFMPEG, string strParam)
      {
          try
          {
              Process ffmpeg = new Process();
              ProcessStartInfo ffmpeg_StartInfo = new ProcessStartInfo(Path_FFMPEG, strParam);
              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();
              ffmpeg.Close();
              ffmpeg.Dispose();
              ffmpeg = null;
          }
          catch (Exception ex)
          {

          }
      }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100