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

How to do a snapshoot while displaying video stream? #10113

Closed
MyZQL opened this issue Dec 28, 2021 · 5 comments
Closed

How to do a snapshoot while displaying video stream? #10113

MyZQL opened this issue Dec 28, 2021 · 5 comments

Comments

@MyZQL
Copy link

MyZQL commented Dec 28, 2021


Required Info
Camera Model D435
Firmware Version 05.13.00.50
Operating System & Version Linux (Ubuntu 20LTS)
Kernel Version (Linux Only) 5.11
Platform PC
SDK Version pyrealsense 2.50
Language python
Segment Others

Issue Description

I'm using the pyrealsense for convenience to develop an application. How can I do an RGB snapshoot by a hot key meanwhile displaying video stream?

@MartyG-RealSense
Copy link
Collaborator

Hi @ZhongQingliang If you wanted to be able to save an RGB image snapshot whilst video streaming continues seamlessly then that might require the use of multithreading like the Python case linked to below, where a RealSense user had one thread for the live-captured images and another thread to write the captured images to video.

https://support.intelrealsense.com/hc/en-us/community/posts/360033158094-Recording-Video-in-60fps-with-threading-and-queue-Python-

Another Python discussion about multithreading is at #6039

If having continuous RGB streaming wasn't a requirement then a simpler Python example at #9448 (comment) demonstrates how to save an image using imwrite

@MyZQL
Copy link
Author

MyZQL commented Dec 29, 2021

@MartyG-RealSense It seems the pipeline.wait_for_frame() method can be called by different threads at the same time, isn't it?

@MartyG-RealSense
Copy link
Collaborator

You can move frames from one thread to another when using wait_for_frames(), as described in the section of Intel's Frame Management documentation linked to below.

https://dev.intelrealsense.com/docs/frame-management#section-frames-and-threads

@MartyG-RealSense
Copy link
Collaborator

Hi @ZhongQingliang Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants