惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 秋发

利用VC++实现局域网实时视频传输 亿众国际点对点文件传输程序 文件传输协议(File Transfer Protocol, FTP) 点对点传输 图片的版权保护(添加水印) 使用C#在进度条中显示复制文件的进度 C#实现基于TCP协议的网络通讯 C#实现木马程序 c#中备份数据库 视频捕获软件开发完全教学 Visual C#.Net 网络程序开发-Socket篇 用Mencoder进行任意视频格式转换成flv 用mencoder转换flv时如何控制视频品质 使用mencoder剪辑视频 ffmpeg和Mencoder使用实例小全 [转]ffmpeg+mencoder环境搭建和视频处理总结 [转] 用程序来自动建立FTP帐号(serv-u的odbc设置) TreeView 四技 [转]ASP.NET大文件上传的问题<--拘绝潜水的鱼
[转]利用ffmpeg+mencoder视频转换的总结(C#)
秋发 · 2007-06-06 · via 博客园 - 秋发

Youtube的成功,使得国内的视频网站如雨后春笋般的冒出来,前不久朋友叫我帮他写一个将各种视频格式转换成flv的程序,这里就将编写程序遇到困难和获得的经验拿出来和大家分享一下。

1、使用引擎:ffmpeg + Mencoder
2、ffmpeg最新版本的下载地址:http://ffdshow.faireal.net/mirror/ffmpeg/
Mencoder新版本的下载地址:http://www5.mplayerhq.hu/MPlayer/releases/win32/
3、转换速度比较:总体上ffmpeg转换的速度快于Mencoder
4、转换格式要求:rm、rmvb、rt格式的文件只能用Mencoder转换,出于速度考虑我基本上都用ffmpeg转换,所以Mencoder能转换的格式我没有详细测试(哪个朋友知道,麻烦你告诉我下,我补充上去)。
5、纯音频格式只能用Mencoder进行转换。如何判断是否是纯音频格式可以通过使用命令 FFmpeg -i "文件的完整路径" 获得输出后就可以分析出来。
6、.mov格式的用ffmpeg转换出来的效果比较差,建议用Mencoder进行转换,wmv8用ffmpeg经常会有花屏产生建议用Mencoder。
7、视频按比率输出的问题:必须先获取源视频文件的宽度和高度(也是通过 FFmpeg -i "文件的完整路径" 获得输出后就可以分析出来)根据这个高度和宽度的比率来设定输出文件的尺寸。
8、可能的难点:因为这ffmpeg 和 Mencoder都是命令行工具(当然你也可以下载源代码自己修改成com之类的),在C#只能用Process调用,前面我提过要获得输出信息(获取视频相关信息、获取当前的转换进度、获取什么时候完成转换),必须设置process.StartInfo.UseShellExecute = false; process.StartInfo.CreateNoWindow = true;然后必须通过异步编程的方式获取Process.StandardOutput和Process.StandardError的值,相关说明可以见(ms-help://MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfSystemDiagnosticsProcessClassStandardOutputTopic.htm)(必须安装了msdn的才能看)。

本文旨在帮助大家少走一些弯路,并不提供实际的解决方案及相关的源码下载,如需要源码要付费才行(有意向者可以发送邮件cxbsky#hotmail.com)。
有其他任何问题欢迎大家在本文章发布留言。

参考文章:
http://wf.xplore.cn/read.php/90.htm

百度和google搜索ffmpeg mencoder也有很多相关网页