Using system;
Using system.
Data ;
Using system.
Configuration ;
Using system.
Web ;
Using system.
Web .
Security ;
Using system.
Web .
UI ;
Using system.
Web .
UI .
Webcontrols ;
Using system.
Web .
UI .
Webcontrols .
Webparts ;
Using system.
Web .
UI .
Htmlcontrols ;
Using system.
Diagnostics ;
Using sharpffmpeg;
Using system.
Io ;
Public partial class _ default: system.
Web .
UI .
Page
{
Protected
Void Page_load
( Object sender, eventargs E
)
{
Using
( System.
Diagnostics .
Process P = new system.
Diagnostics .
Process ( ) )
{
String Exepath;
String Apppath = request.
Physicalapplicationpath ;
String Inputpath = apppath +
"Source" ;
String Outputpath = apppath +
"Destination" ;
// Get the Application Path
Exepath = apppath +
"Ffmpeg.exe" ;
String Filename =
"Bear. wmv" ;
String Videosource = page.
Mappath ( "Bear. wmv" ) ;
String Videotarget = page.
Mappath ( "" ) +
"\\Video. FLV" ;
String Cmd =
"-I\"" + Inputpath +
"\\" + Filename +
"\" \"" + Outputpath +
"\\" + Filename.
Remove ( Filename.
Indexof ( "." ) ) +
". Avi" +
"\"" ;
String Strcommand = page.
Mappath ( "Ffmpeg.exe" ) ;
// To covert into JPEG file
// String imgargs = "-I \" "+ inputpath +" \ "+ filename. remove (filename. indexof (". ") + ". WMV "+" \ "-F image2-ss 1-vframes 1-s 280x200-An \" "+ outputpath +" \ "+ filename. remove (filename. indexof (". ") + ". jpg "+ "\"";
String Imgargs =
"-I\"" + Inputpath +
"\\" + Filename.
Remove ( Filename.
Indexof ( "." ) ) +
". Wmv" +
"\"-Ar 22050-AB 32-F FLV\"" + Outputpath +
"\\" + Filename.
Remove ( Filename.
Indexof ( "." ) ) +
". FLV" +
"\"" ;
String Strarguments =
"-I" + Videosource + videotarget;
P.
Startinfo .
Filename = Exepath;
P.
Startinfo .
Arguments = Imgargs;
P.
Startinfo .
Useshellexecute =
False ;
P.
Startinfo .
Redirectstandarderror =
True ;
P.
Startinfo .
Redirectstandardoutput =
False ;
P.
Startinfo .
Createnowindow =
True ;
P.
Startinfo .
Windowstyle = System.
Diagnostics .
Processwindowstyle .
Hidden ;
P.
Start ( ) ;
P.
Waitforexit ( 50 *
1000 ) ;
}
}
}