Coder Social home page Coder Social logo

Comments (5)

AndyInside avatar AndyInside commented on September 26, 2024 1

also when i capture in BMP format all is working fine! problem with MJPEG

from flashcap.

kekyo avatar kekyo commented on September 26, 2024

@AndyInside I think I have seen this problem before.
In Windows Forms, when Image.FromStream() is executed in a worker thread, it throws an exception.
I have not been able to reproduce this behavior in my environment, and again. The true reason is unknown...
However, since this is the second time this has happened, I decided to revise the sample code.

In 9fce01c with the modification, I used CopyImage() in the worker thread to copy the image once to an array, and Image.FromStream() is executed on the UI thread.

Does this fix work? If it works, I will merge it and reflect it.

from flashcap.

AndyInside avatar AndyInside commented on September 26, 2024

thanks!!! by the way your sample code works nice on WPF but not on Winforms

from flashcap.

AndyInside avatar AndyInside commented on September 26, 2024

checked, no the same thing... when i try to save frame to file, it can't be opened with paint or windows preview, but opened well with advanced viewers. something wrong with file content, something wrong with palette, because frame loads to Image with disabled validation (validateImageData) but when loaded property palette expose Exception. maybe it will helps you thanks!

from flashcap.

kekyo avatar kekyo commented on September 26, 2024

It may not be a fundamental solution, but if it's an MJPEG issue and the goal is to save it to a file, saving it using SkiaSharp may fix it.

There may be a problem with GDI+'s implementation of JPEG, I have previously seen such a problem, though not with FlashCap's sample code.

from flashcap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.