Skip to content

Improve image capture speed #1818

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

Closed
tiax615 opened this issue Mar 1, 2019 · 3 comments
Closed

Improve image capture speed #1818

tiax615 opened this issue Mar 1, 2019 · 3 comments

Comments

@tiax615
Copy link

tiax615 commented Mar 1, 2019

Hi community,I think I may have found a way to improve the speed of image capture.
Modify the code in PIPCamera.cpp, updateCaptureComponentSetting(),
change
render_target->InitAutoFormat(setting.width, setting.height);
to
render_target->InitCustomFormat(setting.width, setting.height, PF_B8G8R8A8, true);

AirSim use SceneCaptureComponent2D SceneCapture mode is LDR, using RGBA8 is enough, may not need to use RGBA16f, which is supporting HDR mode. The Format of RenderTarget initialized by InitAutoFormat() is RGBA16f, which takes up resources. You can customize the Format by using InitCustomFormat(). So screenshots might become more efficient.

Thank you for reading!

@tiax615
Copy link
Author

tiax615 commented Mar 1, 2019

By the way, I used the Victory plugin by Rama to take screenshots and the frame rate was up to 20fps!
I think it's also possible to write methods in C++ code without blueprints
_20190301200638

@pengjili
Copy link

pengjili commented Mar 8, 2019

@tiax615 Really appreciate your sharing. I've tried your first way(didn't try 2nd yet), it did save a lot of time. But can I ask what's your image's resolution? Mine is 1280x800, and even using viewMode: "NoDisplay", but it still costs about 250ms each frame. I'd also like to put my frame rate up to 20fps, is there any other way to reduce time on saving images? Thanks so much again

@tiax615
Copy link
Author

tiax615 commented Mar 13, 2019

@tiax615 Really appreciate your sharing. I've tried your first way(didn't try 2nd yet), it did save a lot of time. But can I ask what's your image's resolution? Mine is 1280x800, and even using viewMode: "NoDisplay", but it still costs about 250ms each frame. I'd also like to put my frame rate up to 20fps, is there any other way to reduce time on saving images? Thanks so much again

Hi, My image resolution is 1280x720. And I'm looking for a faster way to do it, like video live. OBS?

madratman added a commit to madratman/AirSim that referenced this issue Apr 19, 2019
madratman added a commit to madratman/AirSim that referenced this issue Apr 19, 2019
…ingly image response matches subwindow exactly for RGB now!
madratman added a commit to madratman/AirSim that referenced this issue Apr 19, 2019
…ingly image response matches subwindow exactly for RGB now!
madratman added a commit to madratman/AirSim that referenced this issue Apr 19, 2019
…ingly image response matches subwindow exactly for RGB now!
@msb336 msb336 closed this as completed Oct 8, 2019
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

No branches or pull requests

3 participants