4

I have a list of Bitmaps, how can I convert it to avi file using c#.net. Or how can we convert a set of images to video file ?

I do not need AVI to "Set of images", but I need "Set of Images" to AVI.

y_zyx
  • 582
  • 4
  • 10
  • 28

4 Answers4

6

i used avifile wrapper in the past, work nicely

Fredou
  • 19,848
  • 10
  • 58
  • 113
  • @Stecya: Nope. I do not need AVI to Set of images, but I need Set of Images to AVI. – y_zyx May 12 '11 at 14:02
  • @Muhammed: One of the things that library does is (to quote) "Create a new video stream from a list of bitmaps", is that not what you want? – Matt Ellen May 12 '11 at 15:02
  • @Matt Ellen: Could you please suggest C# code snippet to do the same. – y_zyx May 13 '11 at 03:52
4

I think you need to use third party libraries

There is AVI File Wrapper or you can use ffmpeg in .NET.

doppelgreener
  • 4,809
  • 10
  • 46
  • 63
Stecya
  • 22,896
  • 10
  • 72
  • 102
1

Old question, but I have two tips to achieve it. We're now 2013, but all answers are good from 2004 to 2013. These answers are useful as it seems programmers rarely take the time to work on new encoders solution, and we often rely on the same old DLL and wrappers.

  • Images to MPEG-1

Based on this code, http://www.codeproject.com/Articles/5834/A-C-MPEG1-Image-Compression-Class, you can write a C# Images to MPEG-1 class compatible on any platform using C#.

  • Images to AVI

Convert just an image with 24 bits color (try to use a gradient generator to have the maximum number of colors) to a full frame AVI using ffmpeg. Take an hexadecimal editor, check how the header of the AVI is, and how the single image has been placed in the AVI. Now do it with two images. Check the header. Refer to the specification to know which value use in the header. You'll see you can easily build a Images to AVI from scratch without any wrapper, and use it on any platform.

Both are codes from scratch.

Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
1

You can check out a simple library for writing AVI files that I've coded to use in my projects. https://sharpavi.codeplex.com/ The sources include a sample screencast app which can be easily adapted to get the bitmaps from files if you need it.

baSSiLL
  • 276
  • 2
  • 4