如何将Avi文件转换为mpg [英] How to Covert a Avi file to mpg

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

问题描述

如何使用C#代码将avi文件转换为mpg.以及Converter软件如何将视频从avi转换为mpg,这是转换的基本概念.

How the avi file is converted into mpg using C# code. And How the Converter software''s are converting the videos from avi to mpg what is the basic concept for converting.

推荐答案

在这里:您需要查看AVI包含的格式和包含的数据格式以及MPG格式.

我建议您看看VirtualDub,这是一个开放源代码解决方案,其中包括文件格式转换: ^ ]
Way, way too big a question to answer here: you need to look at AVI contained format and contained data formats, and MPG format.

I suggest you have a look at VirtualDub, which is an open source solution which includes file format conversion: Source Forge[^]


最简单的方法是使用ffmpeg包装器,例如 ^ ]或Mencoder包装器(Google会提供更多信息),当然您可以直接在c#中使用DirecShow工具,但这并不容易.
关于理论问题的最简单答案是:原始视频流由图像帧组成,就像电影条纹一样,每个帧都像一个独立的bmp文件,没有压缩,并且每个像素都存在.好吧,压缩编解码器尝试压缩像mjpeg这样的单个帧,或者它们也使用后续帧之间的差异.压缩本身是另一个主题.对于视频文件,也有容器.有些可以容纳这些压缩类型,有些可以容纳其他压缩类型.在进行格式转换的情况下,在某些情况下,您可以将数据从一个容器原始复制到另一个容器,但是在大多数情况下,您必须部分地重新创建解码输入文件的原始原始流,并使用输出格式对其进行压缩.的编解码器.如果是非线性变换,则可以并行处理这些部分.
The simplest way is to use an ffmpeg wrapper like this[^], or mencoder wrapper (google will reveal lot more), of course you can use DirecShow tools directly in c#, but that is not easy.
The simplest answer to your theoretical question: a raw video stream consist of image frames, like a movie stripe, every frame is like a standalone bmp file, without compression, and every pixel is present. Well, the compression codecs try to compress single frames like mjpeg, or they use also the difference between the consequent frames. The compression itself is an other topic. In case of video files, there are also containers. Some can hold these compression types, some can hold others. In case of format conversion, in some cases you can raw copy the data from one container to another, but in most cases you have to recreate part-to-part the original raw stream decoding the input file, and compress it with the output format''s codec. In case of non-linear transform, you can process this parts in parallel.


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

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