4

I have a task of generating video from a sequence of images in my app and while searching for that i found out that FFMPEG is able to do that.Can anyone provide me any tutorial or link which can guide me in right direction.I am a newbiew in this so please help appropriately guys. Will appreciate any sort of help

Vipin Nair
  • 489
  • 3
  • 9
  • 32
  • any final solution with full source code sample working about it ? – Kiquenet Nov 04 '13 at 08:39
  • Check if [this][1] helps. You cans create batch file to play image. [1]: http://stackoverflow.com/questions/2738228/how-to-stream-your-images-files-with-vlc/2865939#2865939 – Ram Oct 31 '14 at 13:34

4 Answers4

7

I could not manage to get the above example to work. However I did find another library that works amazingly well once. Try via NuGet "accord.extensions.imaging.io", then I wrote the following little function:

    private void makeAvi(string imageInputfolderName, string outVideoFileName, float fps = 12.0f, string imgSearchPattern = "*.png")
    {   // reads all images in folder 
        VideoWriter w = new VideoWriter(outVideoFileName, 
            new Accord.Extensions.Size(480, 640), fps, true);
        Accord.Extensions.Imaging.ImageDirectoryReader ir = 
            new ImageDirectoryReader(imageInputfolderName, imgSearchPattern);
        while (ir.Position < ir.Length)
        {
            IImage i = ir.Read();
            w.Write(i);
        }
        w.Close();
    }

It reads all images from a folder and makes a video out of them.

If you want to make it nicer you could probably read the image dimensions instead of hard coding, but you got the point.

SCBuergel
  • 1,394
  • 14
  • 23
3

http://electron.mit.edu/~gsteele/ffmpeg/
http://www.codeproject.com/Articles/7388/A-Simple-C-Wrapper-for-the-AviFile-Library
http://ffmpeg.org/ffmpeg.html -> search for For creating a video from many images:

All the links are from this question on SO

Link related to FFMPEG in .net (From this question);

FFMpeg.NET
FFMpeg-Sharp
FFLib.NET
http://ivolo.mit.edu/post/Convert-Audio-Video-to-Any-Format-using-C.aspx

Other resources
Expression Encoder
VLC

Community
  • 1
  • 1
Tilak
  • 27,830
  • 17
  • 73
  • 125
  • Thanks for replying,but the first link you specified is for linux right? – Vipin Nair May 10 '12 at 05:26
  • no -> FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. – Tilak May 10 '12 at 05:28
  • Can i get a link where it is been implemented using c# ,as i am not able to find one – Vipin Nair May 10 '12 at 05:28
  • i have used FFMpeg (not .NET wrapper) for water marking long back (2-3 yrs back) – Tilak May 10 '12 at 05:47
  • Have you heard about Xuggle,its used by Java Programmers ,is there any way to migrate that to c# – Vipin Nair May 10 '12 at 05:52
  • ok,do u know any other 3rd party tool which can accomplish the same task in c# – Vipin Nair May 10 '12 at 05:56
  • you can check with Expression encoder but it is not free. http://expression.microsoft.com/en-us/cc197144. I have once used it for video broadcasting (from WEBCAM ) to LAN. It was easy to learn but there was some lag. Other option, you can also check with VLC -> http://stackoverflow.com/questions/2738228/how-to-stream-your-images-files-with-vlc – Tilak May 10 '12 at 06:01
  • ok,thanks will check all that and will update the answer to you ,thanks – Vipin Nair May 10 '12 at 06:02
  • any final solution with full source code sample working about it ? – Kiquenet Nov 04 '13 at 08:39
  • as expected - after many years these links start to go stale i.e. don't work any more - if anyone can find the correct links it might be useful for folk. – Vidar Oct 18 '18 at 15:39
1

I bit late but I have made a tutorial on how I solved my similar problem if you did not succeed yet: Image sequence to video stream?

Community
  • 1
  • 1
Hauns TM
  • 1,688
  • 1
  • 20
  • 35
0

Same question asked here.

The answer there points to here, which is not exactly what you're doing, but is easily configurable to do the job.

Community
  • 1
  • 1
Ben
  • 781
  • 11
  • 19