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

black screen captured #159

Open
jcyuan opened this issue Aug 16, 2023 · 6 comments
Open

black screen captured #159

jcyuan opened this issue Aug 16, 2023 · 6 comments

Comments

@jcyuan
Copy link

jcyuan commented Aug 16, 2023

Hi @smasherprog , i found that most time this lib works very well, but still chance that it will capture a black screen image, i'm not sure why it happened.

what i did is in my onNewFrame callback to stop the capturing (mgr.PauseCapturing()), because 1 frame is enough for me.
is this the reason? why the first frame is black sometimes (very rare chance actually), how can i avoid this to happen?

thank you.

@smasherprog
Copy link
Owner

As afar as why it can be black, i am unsure.

Why is this a problem? The next frames should be correct, right? So if your doing any kind of a desktop streaming, this isnt noticeable at all and a non issue?

@smasherprog
Copy link
Owner

smasherprog commented Aug 16, 2023

You only ever want to capture a single frame and then stop? If thats the case id add code to check if the first frame is black, and skip it and STOP at N checks.
If you want to debug the program, maybe theres some error I am not capturing correctly when gathering the first frame?
Should be ez to debug as the code isnt very complex.

@jcyuan
Copy link
Author

jcyuan commented Aug 17, 2023

You only ever want to capture a single frame and then stop? If thats the case id add code to check if the first frame is black, and skip it and STOP at N checks.

exactly!
because i'm making a screen color picker, so 1 frame is enough for this.

please give me some hints where should I dig into the source code for how to check if the current frame is a black screen? i wanna try to fix it myself first as i know you might be busy so i'm unsure when you can fix it.

@smasherprog
Copy link
Owner

This is the function that does the capturing. If there is an error, it will be in here

DUPL_RETURN DXFrameProcessor::ProcessFrame(const Monitor &currentmonitorinfo)

@jcyuan
Copy link
Author

jcyuan commented Aug 18, 2023

This is the function that does the capturing. If there is an error, it will be in here

DUPL_RETURN DXFrameProcessor::ProcessFrame(const Monitor &currentmonitorinfo)

😵 well, I don't know DX11 well... is there a way to check if the current frame is fully black in C# side? so that i won't call mgr.PauseCapturing() in this case to stop the capturing?

@smasherprog
Copy link
Owner

The only thing i can do is point you in the code section. If you find a bug please post a PR

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

2 participants