cureos / aforge

PCL version of AForge.NET Framework, https://code.google.com/p/aforge/
Other
125 stars 96 forks source link

i can't use aforge.Video.Vfw to create video from some sequences of single images #11

Closed Heshambass closed 10 years ago

Heshambass commented 10 years ago

Hey sir, i want to create stream (avi video) from some bitmaps images but i failed . this is my code

        // instantiate AVI writer, use WMV3 codec
        AVIWriter writer = new AVIWriter();
        writer.FrameRate = 1;
        // create new AVI file and open it
        writer.Open("HESHAM.avi",256, 256);
        // create frame image

       // var cubit = new AForge.Imaging.Filters.ResizeBilinear(320, 240);
        string[] files = Directory.GetFiles(Server.MapPath("~/pics/"));

        int index = 0;
        int failed = 0;
        foreach (var item in files)
        {
            index++;
            try
            {
               Bitmap image = System.Drawing.Image.FromFile(item) as Bitmap;
                //image = cubit.Apply(image);

                for (int i = 0; i < 10; i++)
                {
                    writer.AddFrame(image);
                }
            }
            catch
            {
                failed++;
            }
            Response.Write(index + " of " + files.Length + ". Failed: " + failed);
        }
        writer.Close();
    }

i don't know here is the wrong in this . please help me in this . thanks in advance

anders9ustafsson commented 10 years ago

Dear @Heshambass,

I have not (yet?) managed to port the AForge.Video.VFW library to PCL (or Windows 8/Windows Phone), so it is currently only available for the original .NET (Windows Forms) version of AForge that is maintained by Andrew Kirillow.

I recommend that you post this question on the AForge.NET Framework forum instead, you have a better chance of receiving a relevant answer to your question on the forum.

Best regards, Anders @ Cureos