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 8912035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:06:00+00:00 2026-06-15T04:06:00+00:00

I have a app that is doing some video processing. I need to analyze

  • 0

I have a app that is doing some video processing.

I need to analyze the media before processing it.

The ffmpeg utility ffprobe.exe provides all the information I need.

However the code I am using will not return the text that appears when the command is ran in a cmd window :

public static string RunConsoleCommand(string command, string args)
{
    var consoleOut = "";

    using (var process = new Process())
    {
        process.StartInfo = new ProcessStartInfo
        {
            FileName = command,
            Arguments = args,
            UseShellExecute = false,
            CreateNoWindow = true,
            RedirectStandardOutput = true
        };

        process.Start();
        consoleOut = process.StandardOutput.ReadToEnd();
        process.WaitForExit();

        return consoleOut;
    }
}

Any Ideas?

  • 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-15T04:06:02+00:00Added an answer on June 15, 2026 at 4:06 am

    The Process class has some events to handle that :

    public static string RunConsoleCommand(string command, string args)
    {
        var consoleOut = "";
    
        using (var process = new Process())
        {
            process.StartInfo = new ProcessStartInfo
            {
                FileName = command,
                Arguments = args,
                UseShellExecute = false,
                CreateNoWindow = true,
                RedirectStandardOutput = true
            };
    
            // Register for event and do whatever
            process.OutputDataReceived += new DataReceivedEventHandler((snd, e) => { consoleOut += e.Data; });
    
            process.Start();
            process.WaitForExit();
    
            return consoleOut;
        }
    }
    

    You also have ErrorDataReceived, which works the same way.

    I’m using these events in some projects, and it works like a charm. Hope that helps.

    EDIT : Fixed the code, you need to attach the handlers before you start the process.

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

Sidebar

Related Questions

I have one console app that is doing some lengthy syncing to an ftp
I have this Java app that I'm doing some web scraping with using the
I have created an app that sends intents among multiple activities. After doing some
I'm doing an iOS app that crawl my youtube subscription's videos. I have a
have an app that finds your GPS location successfully, but I need to be
We have an iPhone app that is doing a lot of rotation between portrait
i am doing some work for an iphone app that retrieves a bunch venues
We are doing some optimization of our app that heavily uses EWS and one
So I have an app that downloads and parses a JSON feed with some
I have an iPad app that is doing really well, zero crashed reported by

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.