Click here to Skip to main content
15,031,941 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

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[^]
   
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.
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900