-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Fix endless poll from ffmpeg subprocess (#2)
1. Updated the read_img_from_rtsp_ffmpeg function in the rtsp_reader.py file to handle exceptions when the RTSP stream shape is obtained but no data is available. This prevents the code from getting stuck in an endless loop. Added a timeout of 10 seconds for the communicate() method in the ffmpeg subprocess to prevent it from hanging indefinitely. 2. Moved the main program logic to the main.py file for better organization and readability. 3. Made various changes in the stream_helper.py file, including: Initialized the state attributes. Implemented a missing count mechanism to track the number of times the cat is missing from the scene. Switched to the default scene if the cat is missing for a specified tolerance limit. Improved error logging and scene switching logic.
- Loading branch information
1 parent
8f9afe7
commit 3d36757
Showing
7 changed files
with
53 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = '0.1.0' | ||
__version__ = '0.1.1' | ||
|
||
|
||
def parse_version_info(version_str): | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type = 'StreamHelper' | ||
obs_ws_url = 'ws://192.168.111.111:4455' | ||
obs_ws_pwd = 'qqdIciF8FPNfzrqX' | ||
cat_det_cfg = dict(type='YOLOv5CatDetection', device='cpu') | ||
rtsp_reader_backend = 'ffmpeg' | ||
obs_scenes = dict( | ||
balcony=dict(default=True, media_source='MeizuX'), | ||
kitchen_lo=dict(media_source='Mi8SE'), | ||
kitchen_hi=dict(media_source='Redmi4'), | ||
entry_hi=dict(media_source='MiMax'), | ||
entry_lo=dict(media_source='Nokia6')) | ||
detect_interval = 10 | ||
missing_tolerance = 6 |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type = 'StreamHelper' | ||
obs_ws_url = 'ws://192.168.111.111:4455' | ||
obs_ws_pwd = 'qqdIciF8FPNfzrqX' | ||
cat_det_cfg = dict(type='YOLOv5CatDetection', device='cpu') | ||
rtsp_reader_backend = 'ffmpeg' | ||
obs_scenes = dict( | ||
balcony=dict(default=True, media_source='MeizuX'), | ||
kitchen_lo=dict(media_source='Mi8SE'), | ||
kitchen_hi=dict(media_source='Redmi4'), | ||
entry_hi=dict(media_source='MiMax'), | ||
entry_lo=dict(media_source='Nokia6')) | ||
detect_interval = 10 | ||
missing_tolerance = 6 |
This file contains 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