如何在C#.net中将.mp4文件转换为.avi文件 [英] How to Convert .mp4 files to .avi in C#.net

查看:364
本文介绍了如何在C#.net中将.mp4文件转换为.avi文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的VMS应用程序中将.mp4文件转换为.avi。



怎么做?





如何在.mp4文件中找到no.of帧?





请帮助...





问候



Dinesh

I need to to convert my .mp4 file to .avi in my VMS application.

How it can be done?


Also how to find no.of frames in .mp4 file?


Kindly help...


Regards

Dinesh

推荐答案

说真的,这是一个非常重要的过程。即使是商业套餐也存在实际问题。部分问题是AVI和MP4都不是视频格式,它们是包含音频和视频流的容器文件格式 - 这些格式可以是各种不同的视频类型 - AVI不支持MP4的所有流类型确实如此,因此您有时需要对流进行转码以及更改容器格式。这取决于你的PC上安装了正确的编解码器(有时是另一个真正的PITA)。



至少有一个开源视频转换器可以提供帮助你:手刹 [ ^ ](虽然我不喜欢它作为一个应用程序,并倾向于使用Freemake,这是免费的,但不是开源的)



看看Handbrake是如何做到的,它可以帮助你至少理解你所遇到的复杂性! :笑:
Seriously, this is a very non-trivial process. Even commercial packages have real problems doing this right every time. Part of the problem is that both AVI and MP4 are not Video formats, they are Container file formats which hold both audio and video streams - and these can be in a range of different video types - AVI does not support all the stream types that MP4 does, and so you sometimes have to transcode the streams as well as change the container format. And that depends on having the right codecs installed on your PC (another true PITA sometimes).

There is at least one open source video converter which may be able to help you: Handbrake[^] (allthough I don't like it that much as an application and tend to use Freemake instead, which is free, but not open source)

Looking at how Handbrake does it may help you at least understand the complexity of what you are getting into! :laugh:


尝试

将avi转换为mp4的代码 [ ^ ]

使用c#将.avi转换为.mp4 [ ^ ]

使用C#进行媒体文件转换 [ ^ ]
Try
code for converting avi to mp4[^]
Convert .avi to .mp4 using c#[^]
Media files conversion using C#[^]


没有mp4文件这样的东西。这种文件名模式可以涵盖每种频道的各种媒体容器压缩算法。你不是在问什么。答案取决于你想要达到的目标,你可能还不知道。



不用担心。学习它。首先,请查看我过去的答案和我提供的链接:

视频(mp4)到Mp3转换 [ ^ ],

HTML5和Mime,流视频? [ ^ ],
如何在C#中将图像转换为视频 [ ^ ],

如何使用Directshow修剪视频!? [ ^ ]。



如你所见,我总是推荐一种我认为最好的工具:FFMpeg和libav ;我还建议在.NET中使用这些库(或只是实用程序,通过生成转换的应用程序进程)的方法。除了许多其他内容之外,文档还描述了受支持的编解码器,媒体容器,协议等。你可以尝试所有的代码和一些容器,找出你想要的东西。



-SA
There is no such thing as "mp4" file. This kind of file name pattern can cover many sorts of media containers and compression algorithm for each channel. You are not asking about anything certain. The answer depends on what exactly you want to achieve, and you probably don't know it yet.

Not to worry. Learn it. For starters, please see my past answers and the links I provided:
video (mp4) to Mp3 convert[^],
HTML5 and Mime, Streaming a video?[^],
how to convert image to video in C#[^],
How to trim the video using Directshow!?[^].

As you can see, I always recommend one tool which I consider the best: FFMpeg and libav; and I also recommend the ways to use those libraries (or just utilities, through spawning the application process for conversion) in .NET. The documentation, among many other things, describe supported codecs, media containers, protocols, and so on. You can try all the codes and a number of containers, to figure out what you would prefer.

—SA


这篇关于如何在C#.net中将.mp4文件转换为.avi文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆