1.项目结构:
2.代码:
using System; using System.Collections.Generic; using System.Diagnostics; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebFFmpeg { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string pathString = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; Process p = new Process(); p.StartInfo.FileName = pathString + "\FFmpeg\ffmpeg.exe"; p.StartInfo.Arguments = @"-y -r 1 -i " + pathString + @"FFmpegpicimg%2d.jpg -i " + pathString + @"FFmpegmusic 2.mp3 -s 800x800 -vcodec mpeg4" + pathString + @"FFmpegvedioout.mp4"; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardError = true; p.StartInfo.Crea teNoWindow = true; p.ErrorDataReceived += new DataReceivedEventHandler((s, message) => { Response.Write(message.Data); });//外部程序(这里是FFMPEG)输出流时候产生的事件,这里是把流的处理过程转移到下面的方法中,详细请查阅MSDN p.Start();//启动线程 p.BeginErrorReadLine();//开始异步读取 p.WaitForExit();//阻塞等待进程结束 p.Close();//关闭进程 p.Dispose();//释放资源 Response.Write("<a href='FFmpeg/vedio/out.mp4'>下载</a>"); } } }
3.Demo 连接
http://share.weiyun.com/581ce7da333c175841c90931fdfd1756
Xaml在string(串)定义常量和处理空间
c 有意思的数组初始化
C 文件直接包含
[面试技巧]16个经典面试问题回答思路
centos6安装bt工具transmission
clearcase 中一些概念和操作
C/C++ Resources
Linux I/O 重定向详解及应用实例
c/c++ 直接使用动态库 dlopen
- 最新文章
-
javascript正则表达式小数类型
cocos2dx 3.0 它 使用std::bind更换CC_CALLBACK_N
Androidclient与服务端(jsp)之间json的传输与解析【附效果图附源代码】
GitHub具体教程
软件开发者的最佳实践
Ural1109_Conference(二分图最大匹配/匈牙利算法/网络最大流)
双网卡绑定-bond0
PHP 的解压缩ZipArchive中的extractTo()方法 LINUX+nginx环境中解压zip时文件丢失的问题
Google 开源项目风格指南阅读笔记(C++版)
C#中MessageBox使用方法大全(附效果图)