fix(#7): ESP32-CAM 최신 프레임 캡처 모드 적용#8
Merged
Conversation
- 카메라 grab mode를 CAMERA_GRAB_LATEST로 변경 - 최신 프레임 갱신을 위해 frame buffer 수를 2개로 조정 - 하드웨어 동작 검증 전 - 참고: https://docs.espressif.com/projects/esp-faq/en/latest/application-solution/camera-application.html
There was a problem hiding this comment.
Pull request overview
ESP32-CAM에서 이미지 캡처 시 프레임 버퍼에 남아 있던 과거 프레임이 업로드되는 문제(#7)를 완화하기 위해, 카메라 드라이버가 “가장 최신 프레임”을 우선 반환하도록 캡처 모드를 조정하는 PR입니다.
Changes:
- 카메라 grab mode를
CAMERA_GRAB_WHEN_EMPTY→CAMERA_GRAB_LATEST로 변경 CAMERA_GRAB_LATEST동작을 위해 frame buffer 개수를fb_count = 1→fb_count = 2로 변경
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🍀 이슈 번호
📝 변경 사항
CAMERA_GRAB_LATEST로 변경🎯 목적
ESP32-CAM에서 서버로 이미지를 전송할 때, 현재 화면이 아니라 과거 이미지가 업로드되는 문제가 있었습니다.
이는 카메라 드라이버의 frame buffer에 남아 있던 이전 프레임이 반환되어 서버로 전송되는 것으로 추정되며, 실시간 인원 카운팅 정확도에 영향을 줍니다.
이번 변경에서는 Espressif 공식 문서의 capture mode 설명을 참고하여, 기존 프레임보다 최신 프레임을 우선적으로 가져올 수 있도록
CAMERA_GRAB_LATEST모드를 적용했습니다.📂 적용 범위
embedded/ssccam/main/camera_manager.cgrab_mode설정 변경fb_count설정 변경🖥️ 주요 코드 설명
기존 설정에서는 frame buffer가 비어 있을 때만 새 프레임을 받는
CAMERA_GRAB_WHEN_EMPTY방식을 사용했습니다.이번 변경에서는 백그라운드 드라이버가 최신 프레임을 계속 갱신하도록
CAMERA_GRAB_LATEST를 적용했습니다.또한
CAMERA_GRAB_LATEST모드에서는 드라이버가 frame buffer 하나를 점유하므로, 애플리케이션 레이어에서 프레임을 정상적으로 가져올 수 있도록fb_count를 2로 조정했습니다.📋 체크리스트
📌 참고 사항
https://docs.espressif.com/projects/esp-faq/en/latest/application-solution/camera-application.html