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

Fresh startup screen capture often shows incomplete frame in Video Capture Card Config window #8

Open
rrrusst opened this issue Mar 9, 2025 · 2 comments
Assignees
Labels
bug Something isn't working Med Priority

Comments

@rrrusst
Copy link
Collaborator

rrrusst commented Mar 9, 2025

The screenshot that's used in the Video Capture Card Config page after a fresh startup (i.e.launching ADAM without an existing config.ini) eems to be incomplete most of the time (i.e. a portion shows normal screen, the rest shows solid green because frame probably has not loaded completely).

To replicate:

  1. delete config.ini from ADAM's Actual folder
  2. ensure capcard is plugged in with video input
  3. run ADAM's main.py
@rrrusst rrrusst added the bug Something isn't working label Mar 9, 2025
@rrrusst
Copy link
Collaborator Author

rrrusst commented Mar 14, 2025

From testing, when the frame is incomplete, the subsequent frames will be duplicate frames of the incomplete frame. This continues till a "No signal detected" black frame is captured, which may be due to imageio finally being ready to capture frames proper.

Hence, the incomplete frame probably happens because imageio needs time to "start up", since
the frames are incomplete/frozen at the beginning and frames only get captured/updated normally after the "No signal detected" black frame.

Skipping a specific number of frames and adding a sleep timer were unreliable workarounds in testing.

Having said that, I am not 100% sure if this problem lies with imageio, ffmpeg, or in the capture card specs.

Solution:
The reliable workaround was to let imageio iterate through frames for a few seconds (2.5s delay was usable. Below that led to unreliability), then start capturing frames and handling the new frames properly after the delay.

I've uploaded a test_screencap.py in the Testing folder that includes the solution, which should be adapted into screen_capturer.py and other relevant scripts.

@rrrusst
Copy link
Collaborator Author

rrrusst commented Mar 20, 2025

@ivanaitzliddat in screen_capturer.py capture_screenshots(), you may need to modify generator = next(iio.imiter(f"<video{i}>")) for frame capture in order to make use of the imageio prep time solution in Testing\test_screencap.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Med Priority
Projects
None yet
Development

No branches or pull requests

3 participants