Skip to content

Conversation

@rhoninl
Copy link
Collaborator

@rhoninl rhoninl commented Apr 28, 2025

What this PR does / why we need it:
Improve Hikvision Stream because the old one with high workflow
Will this PR make the community happier?
yes
Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

How is this PR tested

  • unit test
  • e2e test
  • other (please specify)

Special notes for your reviewer:

Release note:

Copilot AI review requested due to automatic review settings April 28, 2025 13:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the Hikvision stream integration by enhancing frame capture reliability and reconnection logic.

  • Introduces a frame queue and a dedicated capture thread for more robust video streaming.
  • Replaces print statements with consistent logging and adds reconnection attempts for stream failures.
Files not reviewed (1)
  • .gitattributes: Language not supported

Comment on lines +111 to +116
try:
if self.frame_queue.full():
self.frame_queue.get_nowait()
except queue.Empty:
pass

Copy link

Copilot AI Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The try/except block used to catch queue.Empty is misaligned. Wrap the call to self.frame_queue.get_nowait() in its own try block so that the exception is caught correctly.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Apr 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 33.05%. Comparing base (c7063a0) to head (dfc7769).
Report is 192 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1182       +/-   ##
===========================================
- Coverage   55.00%   33.05%   -21.95%     
===========================================
  Files          23       55       +32     
  Lines        2287     4864     +2577     
===========================================
+ Hits         1258     1608      +350     
- Misses        915     3116     +2201     
- Partials      114      140       +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

continue
continue

if frame.shape[1] != CAMERA_WIDTH or frame.shape[0] != CAMERA_HEIGHT:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider using a resize ratio for reducing the frame size instead of fixed width and height

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

Successfully merging this pull request may close these issues.

3 participants