views:

265

answers:

3

Hi,

In fact, the question says it all. I have a lot of images (JPGs) and I want to create a movie from them programmatically. Is there any such library for .NET(preferrably free) through which I can do this? I have done some googling and couldn't find any such thing.

Thanks.

Related: http://stackoverflow.com/questions/539257/working-way-to-make-video-from-images-in-c/755137

+5  A: 

This thread has all the answers you're looking for.

John T
A: 

AFAIK, there is no .NET library to do this, but you could simply distribute MPlayer/MEncoder/FFMPEG and call it using System.Diagnostics.Process.Start(). Note: beware of distribution licenses and provide credit where credit is due.

Lucas Jones
+1  A: 

Though this is probably not the movie format you are looking for, here is a (quickly whipped up and untested) sample on how to create a PNG flick from a set of jpg files using WPF:

var enc = new System.Windows.Media.Imaging.PngBitmapEncoder();

foreach(var jpgFile in jpgFiles)
{
    var uriBitmap = BitmapDecoder.Create(
       new Uri(jpgFile, UriKind.Relative),
       BitmapCreateOptions.None,
       BitmapCacheOption.Default);

    foreach(var frame in uriBitmap.Frames)
    {
        enc.Frames.Add(frame);
    }
}

using (var stm = System.IO.File.Create(filename))
{
    enc.Save(stm);
}
Peter Lillevold
I believe you can create gifs this way too... Isn't there also a GifBitmapEncoder in WPF?
Arjan Einbu