摘要:How To Convert Movie File To FLV Format using ffmpeg
protected void convert_Click(object sender, EventArgs e)
{
Process ffmpeg; // creating process
string video;
string mpg;
video = Page.MapPath("FreeHugs.wmv"); // setting video input name with path
mpg = Page.MapPath("") + "\\video.flv"; // thumb name with path !
ffmpeg = new Process();
ffmpeg.StartInfo.Arguments = " -i " + video + " -s 480*360 -deinterlace -ab 32 -r 15 -ar 22050 -ac 1 " + mpg; // arguments !
ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
ffmpeg.Start(); // start !
ffmpeg.WaitForExit();
ffmpeg.Close();
}
public void ExtractImage()
{
Process ffmpeg; // creating process
string video;
string thumb;
video = Page.MapPath("video.flv"); // setting video input name with path
thumb = Page.MapPath("") + "\\frame.jpg"; // thumb name with path !
ffmpeg = new Process();
ffmpeg.StartInfo.Arguments = " -i \"" + video + "\" -s 108*180 -vframes 1 -f image2 -vcodec mjpeg \"" + thumb + "\""; // arguments !
ffmpeg.StartInfo.FileName = Page.MapPath("ffmpeg.exe");
ffmpeg.Start(); // start !
}
文章出處:http://aspdotnetcodebook.blogspot.tw/2008/02/how-to-convert-movie-file-to-flv-format.html