【发布时间】:2014-04-29 00:11:54
【问题描述】:
考虑 user1 上传一个 swf 文件, user2上传了一个flv, 用户 3 上传一个 mp4 文件, 用户 4 上传 3gp 文件,
为了显示跨浏览器,我们需要上述格式的文件(swf、3gp、mp4、flv、ogv) 用户在 asp.net
中上传他/她的文件后如何做到这一点感谢@Florestan06 我只是测试这段代码
protected void Button1_Click(object sender, EventArgs e)
{
string AppPath = Request.PhysicalApplicationPath;
//This is the path of your application
string inputPath = AppPath + "ffmpeg\\" + "tizer.mp4";
//Source Video Path
string outputPath = AppPath + "outputFolder\\" + "myVideoOutput.flv";
//Destination Video Path
string fileargs = " -i \"" + inputPath + "\" \"" + outputPath + "\"";
//Command Line
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = AppPath + "ffmpeg\\ffmpeg.exe";
//Path of FFMPEG
proc.StartInfo.Arguments = fileargs;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
}
它将 tizer.mp4 转换为 flv,但现在它的大小为 0 字节。你有什么想法吗?
【问题讨论】: