Skip to content
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

OAK-D support H264 and H265 video encoding and gzip detph data #993

Merged
merged 3 commits into from
May 9, 2024

Conversation

m3d
Copy link
Member

@m3d m3d commented May 7, 2024

  • extend video encoders
  • gzip depth data

before:

(osgar) md@md-ThinkPad-P50:~/git/osgar$ python -m osgar.logger /home/md/git/osgar/test-oak-camera-usb-240507_171842.log
 k                 name    bytes | count | freq Hz
--------------------------------------------------
 0                  sys     1243 |  9 |   0.9Hz
 1            oak.depth 35337246 | 69 |   6.9Hz
 2            oak.color 32602560 | 68 |   6.8Hz
 3 oak.orientation_list    36366 | 66 |   6.6Hz
 4       oak.detections        0 |  0 |   0.0Hz
 5        oak.depth_seq      759 | 69 |   6.9Hz
 6        oak.color_seq      748 | 68 |   6.8Hz
 7   oak.detections_seq        0 |  0 |   0.0Hz

Total time 0:00:10.039510

after

(osgar) md@md-ThinkPad-P50:~/git/osgar$ python -m osgar.logger /home/md/git/osgar/test-oak-camera-usb-240507_172759.log 
 k                 name   bytes | count | freq Hz
-------------------------------------------------
 0                  sys    1271 |  9 |   0.9Hz
 1            oak.depth 1823576 | 68 |   6.8Hz
 2            oak.color 2426190 | 68 |   6.8Hz
 3 oak.orientation_list   36917 | 67 |   6.7Hz
 4       oak.detections       0 |  0 |   0.0Hz
 5        oak.depth_seq     748 | 68 |   6.8Hz
 6        oak.color_seq     748 | 68 |   6.8Hz
 7   oak.detections_seq       0 |  0 |   0.0Hz

Total time 0:00:10.064269

@m3d m3d requested a review from tajgr May 7, 2024 17:34
class OakCamera:
def __init__(self, config, bus):
self.input_thread = Thread(target=self.run_input, daemon=True)
self.bus = bus

self.bus.register('depth', 'color', 'orientation_list', 'detections',
self.bus.register('depth:gz', 'color', 'orientation_list', 'detections',
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change increases the load on the cpu. In my opinion, this option (:gz) must be optional.

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you sure about it? Realsense also uses :gz version - I mean it will surely slow down CPU, but save time on storage??

Copy link
Member Author

Choose a reason for hiding this comment

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

p.s. it would be interesting/nice, to do this packing already on OAK-D side, but then you spend CPU time unpacking if you use it

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree let this be the default setting. However, in one application in particular we are hitting a cpu performance limit and this change will probably make our work more difficult.
Thus, if possible, I would be happy for the option to turn this off.
Yes, the situation is the same with the RS camera, but we don't use it now.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, thanks - if we agree that default should be gzipped and you already have application which would reach the limit, then let's add the on/off option.

@tajgr
Copy link
Collaborator

tajgr commented May 9, 2024

Please add some config parameter e.g. disable_depth_compression.
But yes, the effect is huge. Thanks.

@m3d
Copy link
Member Author

m3d commented May 9, 2024

I hope this extra flag will work for you (if not please let me know). I tried also H265 and it also seems to work, but lidarview etc will be tricky. Thanks & merging

@m3d m3d merged commit acbf511 into master May 9, 2024
6 checks passed
@m3d m3d deleted the feature/oak-h264 branch May 9, 2024 17:29
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.

2 participants