我正在使用下面的 C# 代码从 flv 文件创建缩略图。我正在使用 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) Input #0, flv, from 'D:\Shyju\mpgg\WebSite1\lss_section3.flv':持续时间:N/A , 比特率: N/A Stream #0.0: Audio: mp3, 44100 Hz, stereo Stream #0.1: Video: Unable for find a suitable output format for 'D:\Shyju\mpgg\WebSite1\test123.jpg'
该程序正在 Windows 机器中执行。谁能告诉我我的代码有什么问题?