bitmaps to avi file c# .Net
I have开发者_JAVA技巧 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.
i used avifile wrapper in the past, work nicely
I think you need to use third party libraries
There is AVI File Wrapper or you can use ffmpeg in .NET.
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.
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.
精彩评论