Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In x64 mode, AForge.Video.VFW.AVIWriter.AddFrame() throws System.OverflowException #45

Open
tstk0525 opened this issue Oct 28, 2020 · 2 comments

Comments

@tstk0525
Copy link

I really apricate to the developer of the useful software package AForge.NET.
I am using AForge.NET 2.2.5 (Full Zip Archive) with Visual Studio 2019 Pro.
When I select Any CPU mode, the following sample code works fine.
However, when I select x64 mode, the aviWriter.AddFrame() throws System.OverflowException: 'Arithmetic operation resulted in an overflow.'
Is there any way to avoid the error?

        AVIWriter aviWriter = new AVIWriter();
        Bitmap bitmap = new Bitmap(640, 360);
        Graphics g = Graphics.FromImage(bitmap);

        aviWriter.FrameRate = 30;
        aviWriter.Open("test.avi", 640, 360);

        for (int i = 0; i < 300; i++)
        {
            g.Clear(Color.Black);
            g.DrawString("" + i.ToString("d2"), new Font("MS UI Gothic", 64), Brushes.BlanchedAlmond, 10f, 10f);
            aviWriter.AddFrame(bitmap);
        }
        aviWriter.Close();
@Wil7070
Copy link

Wil7070 commented Aug 19, 2021

Hello, I have the same issue, is there a way to create a video from a 64 bits c# application?
Thank you!

@ivancoredev
Copy link

Hi, I also have the same problem on the same platform . Any new support for x64 .NET apps?
Regrads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants