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

Failed to capture when working from inside a remote desktop app #4

Open
morya opened this issue Aug 3, 2024 · 5 comments
Open

Failed to capture when working from inside a remote desktop app #4

morya opened this issue Aug 3, 2024 · 5 comments

Comments

@morya
Copy link

morya commented Aug 3, 2024

Press ENTER to stop recording...Capture failed -2147467262
Exception in thread Thread-1 (<lambda>):
Traceback (most recent call last):
  File "D:\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "D:\Python312\Lib\threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "D:\pyws\demo1\wincam_example\t1.py", line 78, in <lambda>
    self._thread = Thread(target=lambda: self.video_thread(x, y, w, h, fps))
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\pyws\demo1\wincam_example\t1.py", line 51, in video_thread
    frame, timestamp = camera.get_bgr_frame()
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\.virtualenvs\pyws-enCgLOFr\Lib\site-packages\wincam\dxcam.py", line 58, in get_bgr_frame
    raise Exception(f"Failed to start capture, error code {f'{-hr:02x}'}")
Exception: Failed to start capture, error code 7fffbffe

sample code was copied from example folder of this repo.

examples/video.py

@lovettchris
Copy link
Owner

Hmmm, that will need some debugging, but the fact that it failed before even reaching the error message "CreateCaptureSession is not supported on this version of Windows" means you might have a GPU problem, do you know what GPU you are using?

wincam requires Windows 10 version 10.0.26100.0 or later, or Windows 11. And you must have a GPU that supports DirectX 11. Specifically we call D3D11CreateDevice asking for hardware support for D3D11_SDK_VERSION on D3D11_CREATE_DEVICE_BGRA_SUPPORT images.

@blaxkwidow
Copy link

check #6

@mrAntiUser
Copy link

mrAntiUser commented Aug 26, 2024

I confirm

Failed to start capture, error code 7fffbffe
  File "E:\Dev\Project\Python\ddd\main.py", line 213, in copy_backup_proc
    frame, _ = camera.get_bgr_frame()
               ^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Dev\Project\Python\ddd\main.py", line 166, in copy_backup
    self._modifyCallback(self._src_dir, loc_path)
  File "E:\Dev\Project\Python\ddd\main.py", line 190, in <lambda>
    threading.Timer(DELAY_BEFORE_BACKUP, lambda: self.copy_backup()).start()
                                                 ^^^^^^^^^^^^^^^^^^
Exception: Failed to start capture, error code 7fffbffe

win10, dx12, rtx4080

@WHalcyon
Copy link

Getting the same Error: Failed to start capture, error code 7fffbffe running one of the examples while meeting all requirements.

@lovettchris
Copy link
Owner

Try moving your VM to windows 11. I do have Azure VM's running Windows 11 where wincam is working perfectly.

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

5 participants