Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7900281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:55:52+00:00 2026-06-03T08:55:52+00:00

Is it possible to merge the two videos by c# asp.net with the help

  • 0

Is it possible to merge the two videos by c# asp.net with the help of ffmpeg. In the ffmpeg documentation they gave us cat command. But it wont works in asp.net. I thought it only for linux.

cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg

asp.net execute this command but there is no output. Help me.

namespace demo
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Button2_Click(object sender, EventArgs e)
        {
            string strFile = "cars1.flv";
            MergeFiles(strFile);
        }

        public void MergeFiles(string strFile)
        {
            string strParam;
            string Path_FFMPEG = Server.MapPath("~/ffmpeg/bin/ffmpeg.exe");

            //Converting a video into mp4 format
            string strOrginal = Server.MapPath("~/Videos/");
            strOrginal = strOrginal + strFile;
            string strConvert = Server.MapPath("~/Videos/ConvertedFiles/");
            string strExtn = Path.GetExtension(strOrginal);
            if (strExtn != ".mp4")
            {
                strConvert = strConvert + strFile.Replace(strExtn, ".mp4");
                strParam  = "-i " + strOrginal + " " + strConvert;
                //strParam = "-i " + strOrginal + " -same_quant " + strConvert;
                process(Path_FFMPEG, strParam);
            }

            //Merging two videos               
            String video1 = Server.MapPath("~/Videos/Cars1.mp4");
            String video2 = Server.MapPath("~/Videos/ConvertedFiles/Cars2.mp4");
            String strResult = Server.MapPath("~/Videos/ConvertedFiles/Merge.mp4");
            //strParam = "-loop_input -shortest -y -i " + video1 + " -i " + video2 + " -acodec copy -vcodec mjpeg " + strResult;

            strParam = " -i " + video1 + " -i " + video2 + " -acodec copy -vcodec mjpeg " + strResult;

            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)
            {

            }
        }

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:55:53+00:00Added an answer on June 3, 2026 at 8:55 am

    Finally i found the answer for my own question.

    The following method resolves my problem.

    public void MergeFiles(string strFile)
            {
                Process p = new Process();
                p.StartInfo.UseShellExecute = false;
                p.StartInfo.RedirectStandardOutput = true;
                p.StartInfo.CreateNoWindow = true;
                p.StartInfo.FileName = Server.MapPath("~/app.bat");
                p.Start();
                p.WaitForExit();
                p.Dispose();
            }
    

    app.bat

    The app.bat contains the following code.

    copy e:\cars1.mpg /b + e:\cars2.mpg /b e:\output.mpg /b
    

    NOTE: This is for windows only. That’s why “cat” command doesn’t works. Instead of “cat” command we use copy command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to merge two JSON documents with the Jackson JSON library? I
Possible Duplicate: What is the best method to merge two PHP objects? I have
Possible Duplicate: Merge Two Video files in iPhone Application I have download 40mb video
Possible Duplicate: merge two files by key if exists in the first file /
hello is it possible to merge / combine / pack two .exe files example
I need to merge two query results as in union, but I want to
Possible Duplicate: Merge two lists in python? How can I prepend list elements into
Possible Duplicate: How can I merge two MySql tables? I want to merge multiple
Possible Duplicate: Merge two rows in SQL I have the following values in table:
Possible Duplicate: Best way to merge two maps and sum the values of same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.