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

Unhandled attempt to divide by zero exception #50

Open
Somfic opened this issue Apr 19, 2024 · 5 comments
Open

Unhandled attempt to divide by zero exception #50

Somfic opened this issue Apr 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Somfic
Copy link

Somfic commented Apr 19, 2024

Hi,

Getting a System.DivideByZeroException at

at SeeShark.Device.VideoDevice.TryGetFrame(Frame& frame)
at SeeShark.Device.VideoDevice.DecodeLoop()

which most likely is when the device returns a framerate of 0 (?). See https://github.com/Speykious/SeeShark/blob/cc4aa3b69053f08c92b77528ab95d326c91d7f72/SeeShark/Device/VideoDevice.cs#L88C12-L88C86.

Thread.Sleep(1000 * decoder.Framerate.den / (decoder.Framerate.num * 4));
@Speykious Speykious added the bug Something isn't working label Apr 20, 2024
@Speykious
Copy link
Owner

I've been wanting to do this for a while: I started rewriting SeeShark from scratch. It won't depend on FFmpeg anymore, I'm just going to use the OS APIs directly.
For this issue in particular, this latest commit should come in handy. :p
41ea9c9

@Somfic
Copy link
Author

Somfic commented May 8, 2024

sick, thanks! can’t test right now as I am not near my machine but i’ll close this issue once i confirm it’s working :)

@Speykious
Copy link
Owner

If you're on Linux I'm sure it'll work, but I'm just in the process of rewriting the library, so it won't mean much if it works at this stage. xD
I removed almost everything, including VideoDevice, the asynchronous API, the decoders... Because I decided that it would be best to start rewriting the abstraction once I have multiple APIs in place and working correctly.

I'd say I'm already as good as done for V4l2 on Linux, after just a few days of coding this, which is nice.
But I still need to deal with all the other APIs: X11, potentially Wayland, then AVFoundation on MacOS, and DirectShow and Gdi on Windows.

@Somfic
Copy link
Author

Somfic commented May 8, 2024

this particular issue was on a Windows machine. but nevertheless looking forwards to the progress and i’ll keep my eye out for a prerelease/stable build of v5 then :D glhf

@Somfic Somfic closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
@Speykious
Copy link
Owner

Are you sure closing this is the right thing here? I was planning to keep it open until I finish writing SeeShark 5.

@Somfic Somfic reopened this May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants