//参数都为上传的视频路径及文件名,要保存的文件路径及文件名
public string MChangeFilePhy(string vFileName, string playFile)
{
string tool = Server.MapPath("~/Js/mencoder.exe");
System.Diagnostics.ProcessStartInfo FilestartInfo = new System.Diagnostics.ProcessStartInfo(tool);
FilestartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
FilestartInfo.Arguments = " " + vFileName + " -o " + playFile + " -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=5000:mbd=2:mv0:trell:v4mv:cbp:last_pred=1:dia=4:cmp=6:vb_strategy=1 -vf scale=" + "400" + ":" + "350" + " -ofps 12 -srate 22050";
try
{
System.Diagnostics.Process.Start(FilestartInfo);
}
catch
{
return "";
}
//
return "";
}
public string CatchImg(string fileName, string imgFile)
{
//
string ffmpeg = Server.MapPath("~/Js/ffmpeg.exe");
//
string flv_img = imgFile;
//
string FlvImgSize = "240x180";
//
System.Diagnostics.ProcessStartInfo ImgstartInfo = new System.Diagnostics.ProcessStartInfo(ffmpeg);
ImgstartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
//
ImgstartInfo.Arguments = " -i " + fileName + " -y -f image2 -ss 2 -vframes 1 -s " + FlvImgSize + " " + flv_img;
try
{
System.Diagnostics.Process.Start(ImgstartInfo);
}
catch
{
return "";
}
//
if (System.IO.File.Exists(flv_img))
{
return flv_img;
}
return "";
}