Can't change resolution on Astra Pro

Hello,I’m trying to change the resolution for a simple color stream in the following way but i’m always getting status 2, which I saw was Device error.

astra::StreamSet streamSet;
astra::StreamReader reader = streamSet.create_reader();

auto colorStream = reader.stream<astra::ColorStream>();
auto oldMode = colorStream.mode();

//We don't have to set the mode to start the stream, but if you want to here is how:
astra::ImageStreamMode colorMode;
colorMode.set_width(1280);
colorMode.set_height(720);
colorMode.set_pixel_format(astra_pixel_formats::ASTRA_PIXEL_FORMAT_RGB888);
colorMode.set_fps(10);

colorStream.set_mode(colorMode);

auto newMode = colorStream.mode();
printf("Changed depth mode: %dx%d @ %d -> %dx%d @ %d\n",
    oldMode.width(), oldMode.height(), oldMode.fps(),
    newMode.width(), newMode.height(), newMode.fps());

colorStream.start();

ColorFrameListener listener;
reader.add_listener(listener);

In the documentation it says this higher resolution is supported. Idk what’s happening.

Hello UannaFF,

I think you stumped upon some kind of bug in the SDK (or we failed to learn something about it).
I tried your code and for me it does not fail with status 2, but the resolution stays 640x480 no matter what I do.

However, if I set the fps to 30 (instead of 10), then everything works fine. Could you give that a try?

By the way, I have an Astra Pro. According to product specs this is the only Astra model in the Astra series which supports a 1280x720@30fps RGB stream.

Tom

Thanks for the answer, I confirm it works with 30fps.