AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Decrease frame per second / frame rate

Forum to discuss AForge.NET Framework, its features, API, how-tos, etc.

Decrease frame per second / frame rate

Postby tom314131 » Sat Sep 16, 2017 1:24 pm

hi,
I use aforge.net to create a video from several images, but i want each image will be shown for at least 2-4 seconds
how can i do it?

here is my code.

Code: Select all
using (var videoWriter = new VideoFileWriter())
            {
                videoWriter.Open(basePath + "timelaps.avi", 3840, 2160, 1, VideoCodec.MPEG4, 1000000);
                for (int imageFrame = 0; imageFrame < imageCount; imageFrame++)
                {
                    var imgPath = string.Format("{0}{1}.jpg", basePath, imageFrame);
                    using (Bitmap image = Bitmap.FromFile(imgPath) as Bitmap)
                    {
                        videoWriter.WriteVideoFrame(P.ResizeBitmap(image, 3840, 2160));
                       
                    }

                }
                videoWriter.Close();
            }
tom314131
 
Posts: 1
Joined: Sat Sep 16, 2017 1:15 pm

Re: Decrease frame per second / frame rate

Postby andrew.kirillov » Sun Sep 17, 2017 7:28 am

Hello,

You can not set less than a second frame rate using public API of AForge.NET Framework. You may try getting it by going into internals of the implementation.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3453
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to AForge.NET Framework

cron