我使用下面的C#代碼來創建從FLV file.I縮略圖正在使用FFMPEG從flash影片中提取縮略圖錯誤而調用FFMPEG,以創建Flash影片縮略圖
string inputfile = "D:\\Shyju\\mpgg\\WebSite1\\lss_section3.flv";
string thumbname = "D:\\Shyju\\mpgg\\WebSite1\\test123.jpg";
Process process = new Process();
string thumbargs = "-i \"" + inputfile + "\" -vframes 1 -ss 00:00:07 -s 100x66 \"" + thumbname + "\"";
process.StartInfo.FileName = "D:\\Shyju\\newFFMPEG\\ffmpeg.exe";
// string thumbargs = "-i \"" + inputfile + "\" -vframes 1 -ss 00:00:07 -s 100x66 \"" + thumbname + "\"";
process.StartInfo.Arguments = thumbargs;
//"-i \"D:\\Shyju\\mpgg\\WebSite1\\viva_home.swf\" -an -ss 00:00:03 -s 120×90 -vframes 1 -f mjpeg \"D:\\Shyju\\mpgg\\WebSite1\\testThumbNail.jpg\"";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
string output2 = process.StandardError.ReadToEnd();
process.WaitForExit();
process.Close();
當我運行代碼,我沒有得到預期的縮略圖圖像。但在變量output2中,我得到以下信息。
ffmpeg version 0.4.9-pre1, build 4751, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-memalign-hack --enable-mp3lame --enable-mingw32 --extra-cflags=-I/local/include --extra-ldflags=-L/local/lib --enable-amr_nb
built on Mar 29 2005 07:26:02, gcc: 3.2.3 (mingw special 20030504-1)
[flv @ 0040F954]skipping flv packet: type 18, size 224, flags 0
[flv @ 0040F954]Unsupported video codec (4)
[flv @ 0040F954]Unsupported video codec (4)
[flv @ 0040F954]Unsupported video codec (4)
//此線有20次以上
[FLV @ 0040F954]不支持的視頻編解碼器(4)
似乎流1來自膠片源:1000.00(1000/1) - > 0.25(1/4) 來自'D:\ Shyju \ mpgg \ WebSite1 \ lss_section3.flv'的輸入#0,flv: 持續時間:N/A,比特率:N/A 流#0.0:音頻: mp3,44100 Hz,立體聲 Stream#0.1:Video: 無法找到'D:\ Shyju \ mpgg \ WebSite1 \ test123.jpg'
程序正在windows機器上執行。 任何人都可以告訴我什麼是我的代碼錯了嗎?
新增%d的縮略圖文件的名稱。但沒有迴應。 – Shyju 2009-08-25 10:59:19