Skip to content

new feature: record stream instead of raw #5

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import cv2

from DeepLabStream import DeepLabStream, show_stream
from utils.configloader import MULTI_CAM, STREAMS, RECORD_EXP
from utils.configloader import MULTI_CAM, STREAMS, RECORD_EXP, RECORD_RAW
from utils.gui_image import QFrame, ImageWindow, emit_qframes

from PyQt5.QtCore import QThread
Expand Down Expand Up @@ -45,10 +45,6 @@ def run(self):
all_frames = stream_manager.get_frames()
color_frames, depth_maps, infra_frames = all_frames

# writing the video
if stream_manager.recording_status():
stream_manager.write_video(color_frames, stream_manager.frame_index)

if stream_manager.dlc_status():
# outputting the frames
res_frames, res_time = stream_manager.get_analysed_frames()
Expand All @@ -60,6 +56,13 @@ def run(self):
else:
self._stream_frames(color_frames)

# writing the video
if stream_manager.recording_status():
if res_frames and not RECORD_RAW:
stream_manager.write_video(res_frames, stream_manager.frame_index)
else:
stream_manager.write_video(color_frames, stream_manager.frame_index)

stream_manager.frame_index += 1

def stop(self):
Expand Down
5 changes: 4 additions & 1 deletion utils/advanced_settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
STREAMS = color, depth, infrared
MULTIPLE_DEVICES = False
STACK_FRAMES = False
ANIMALS_NUMBER = 1
ANIMALS_NUMBER = 1

[Video]
RECORD_RAW = True
1 change: 1 addition & 0 deletions utils/configloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ def get_script_path():
'STACK_FRAMES') is not None else False
ANIMALS_NUMBER = adv_dsc_config['Streaming'].getint('ANIMALS_NUMBER') if adv_dsc_config['Streaming'].getint(
'ANIMALS_NUMBER') is not None else 1
RECORD_RAW = adv_dsc_config['Video'].getboolean('RECORD_RAW')