It is actually implemented using the process object in. net.
String STR = @ "D: \ test. Avi D: \ test_allen.flv ";
Runffmpeg (STR );
// Decode the video that runs FFMPEG,
Public void runffmpeg (string strcmd)
{
// Create and start a new process
PROCESS p = new process ();
// Set the process startup information attribute startinfo, which is the processstartinfo class, including some attributes and methods:
P. startinfo. filename = "ffmpeg.exe ";// Program Name
P. startinfo. Arguments = "-I" strcmd; // execution Parameters
P. Start ();
}
// Run cmd.exe to execute the DOS command and return the execution result Public String runcmd (string command)
{
// Create and start a peer process
PROCESS p = new process ();
// The process class has a startinfo attribute, which is the processstartinfo class, including some attributes and methods, such:
P. startinfo. filename = "cmd.exe"; // program name
P. startinfo. Arguments = "/C" command; // execution Parameters
P. startinfo. useshellexecute = false; // close shell usage
P. startinfo. redirectstandardinput = true; // redirect standard input
P. startinfo. redirectstandardoutput = true; // redirect standard output
P. startinfo. redirectstandarderror = true; // redirect error output
P. startinfo. createnowindow = true; // you can specify not to display a window.
P. Start ();
// P. standardinput. writeline (command); // you can also use this method to export the command to be executed.
// P. standardinput. writeline ("exit"); // you must remember to add exit. Otherwise, the next line of program will become available.
// You must create Code
Return P. standardoutput. readtoend (); // get the result of the command response line from the extract stream
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service