It depends what you mean by "convert". Both 3GP and AVI are wrapper formats, so are you merely trying to change the container format, or do you want to re-encode the streams as well?
Either way, you should probably take a look at ffmpeg (Windows info). For simple cases (i.e. you have the file, want a single output file), you should probably consider it invoking it on the command-line (i.e. System.Diagnostics.Process), which is much easier (and doesn't involve any licensing issues). If you want to access libavcodec/libavormat programatically, I highly recommend skipping any .NET wrapper libs (they all are in different states of sucking; Tao being the best but that's not saying much) and instead writing a C++/CLI wrapper. I started doing this, and once I got my head around data marshalling, etc., and figured out how to build it (Part 1, Part 2), it wasn't too hard.
There is no really easy way to do it; my advice is to use ffmpeg, either through the use of a C# wrapper of by calling it externally. There seem to be several C# wrappers for ffmpeg (like this one) but they all seem to be in various stages of development and not really usable. Your only option is likely going to be by calling it externally.
发布评论
评论(2)
这取决于你所说的“转换”是什么意思。 3GP 和 AVI 都是包装格式,因此您只是想更改容器格式,还是也想重新编码流?
不管怎样,你应该看看ffmpeg (ffmpeg) arrozcru.org/" rel="nofollow noreferrer">Windows 信息)。对于简单的情况(即您有文件,需要单个输出文件),您可能应该考虑在命令行上调用它(即 System.Diagnostics.Process),这要容易得多(并且不涉及任何许可问题)。如果您想以编程方式访问 libavcodec/libavormat,我强烈建议跳过任何 .NET 包装器库(它们都处于不同的吸吮状态;Tao 是最好的,但这并没有说明太多),而是写一个 C++/CLI 包装器。我开始这样做,一旦我了解了数据编组等,并弄清楚了如何构建它(第 1 部分,第 2 部分),这并不太难。
It depends what you mean by "convert". Both 3GP and AVI are wrapper formats, so are you merely trying to change the container format, or do you want to re-encode the streams as well?
Either way, you should probably take a look at ffmpeg (Windows info). For simple cases (i.e. you have the file, want a single output file), you should probably consider it invoking it on the command-line (i.e. System.Diagnostics.Process), which is much easier (and doesn't involve any licensing issues). If you want to access libavcodec/libavormat programatically, I highly recommend skipping any .NET wrapper libs (they all are in different states of sucking; Tao being the best but that's not saying much) and instead writing a C++/CLI wrapper. I started doing this, and once I got my head around data marshalling, etc., and figured out how to build it (Part 1, Part 2), it wasn't too hard.
没有真正简单的方法可以做到这一点;我的建议是使用 ffmpeg,可以通过使用 C# 包装器,也可以通过外部调用它。 ffmpeg 似乎有几个 C# 包装器(例如这个),但它们都似乎处于不同的开发阶段并且并不真正可用。您唯一的选择可能是从外部调用它。
There is no really easy way to do it; my advice is to use ffmpeg, either through the use of a C# wrapper of by calling it externally. There seem to be several C# wrappers for ffmpeg (like this one) but they all seem to be in various stages of development and not really usable. Your only option is likely going to be by calling it externally.