CommunityToolkit / CommunityToolkit/Windows

CameraPreview freezes after few frames.

Open
#287 2 comments 1 reaction 0 assignees View on GitHub
bug components::controls::camerapreview
Dominant language
C#
Stars
1.1k
Forks
166
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

When I try to use sample codes of CameraPreview, the camera frame freezes after few frames.__

### Steps to reproduce

```text
1. Create new project -> Template Studio for WinUI(Template Studio version:5.5), all default.
2. Use defalut Microsoft.WindowsAppSDK(1.4.231008000) and Microsoft.Windows.SDK.BuildTools(10.0.22621.756)
3. Install CommunityToolkit.WinUI.Controls.CameraPreview 8.0.230907
4. Add sample codes on https://github.com/CommunityToolkit/Windows/blob/main/components/CameraPreview/samples/CameraPreviewSample.xaml and https://github.com/CommunityToolkit/Windows/blob/main/components/CameraPreview/samples/CameraPreviewSample.xaml.cs
5. Build Debug x64 Packaged
6. Camera frames stops updating 2 seconds after app launch
```

### Expected behavior

Camera frame keeps updating.

### Screenshots

_No response_

### Code Platform

- [ ] UWP
- [X] WinAppSDK / WinUI 3
- [ ] Web Assembly (WASM)
- [ ] Android
- [ ] iOS
- [ ] MacOS
- [ ] Linux / GTK

### Windows Build Number

- [ ] Windows 10 1809 (Build 17763)
- [ ] Windows 10 1903 (Build 18362)
- [ ] Windows 10 1909 (Build 18363)
- [ ] Windows 10 2004 (Build 19041)
- [ ] Windows 10 20H2 (Build 19042)
- [ ] Windows 10 21H1 (Build 19043)
- [ ] Windows 10 21H2 (Build 19044)
- [ ] Windows 10 22H2 (Build 19045)
- [ ] Windows 11 21H2 (Build 22000)
- [X] Other (specify)

### Other Windows Build number

Windows 11 23H2 (Build 22635)

### App minimum and target SDK version

- [ ] Windows 10, version 1809 (Build 17763)
- [ ] Windows 10, version 1903 (Build 18362)
- [ ] Windows 10, version 1909 (Build 18363)
- [X] Windows 10, version 2004 (Build 19041)
- [ ] Windows 10, version 2104 (Build 20348)
- [ ] Windows 11, version 22H2 (Build 22000)
- [ ] Other (specify)

### Other SDK version

_No response_

### Visual Studio Version

2022

### Visual Studio Build Number

Version 17.8.2

### Device form factor

_No response_

### Additional context

When GC triggered, the frames update for about 0.5 sec, then it freezes again.
![image](https://github.com/CommunityToolkit/Windows/assets/91111027/a0c53bb2-e544-4d30-a418-27c95dace833)

### Help us help you

No, I'm unable to contribute a solution.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.