Image URL: can I force main stream?

fabsenet

n3wb
Joined
Sep 10, 2020
Messages
4
Reaction score
2
Location
Germany
Hi!

I currently use this url http://blueirisIP:81/image/Cam1?user=...&pw=...&q=90 to fetch a picture of Cam1. This camera is 4k and uses substreams and the first picture is from that substream only. If I repeatedly reload the image it switches to the main stream and privdes better images.
I am wondering, is there a way to tell blue iris that I want a high def picture from the main stream and are willing to wait, if it has to start decoding for that?
I made that up but what I need is some URL parameter like:
Code:
...&forceStream=main
or
Code:
...&forceStream=sub
any ideas?

...I implemented some kind of heuristic currently. The image dimension do not change when the stream changes but the high def image from the main stream needs more kB! If the file is too small, I keep fetching it in my node red flow until it is larger. But I noticed last night that the night time images are way smaller in file size, even the high def one so the logic breaks there.
 

fabsenet

n3wb
Joined
Sep 10, 2020
Messages
4
Reaction score
2
Location
Germany
I tried it but the dimensions do not change, they are 1280x720 regardless of what stream was used.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
I remember discussing this with the BI developer back when jpeg snapshots were only sourced from the sub stream, but as far as I know he never implemented a way to force loading from the main stream. You should ask Blue Iris support for this, because the more he receives a feature request, the more likely he is to implement it.

Requesting a snapshot or a video stream causes Blue Iris to begin decoding the main stream in the background, and upscale sub stream frames until the main stream is ready (which can take a few seconds or more sometimes). To complicate matters, Blue Iris reuses old video decoders and doesn't flush them properly so right at the moment the main stream loads, you get some old video frames from the last time you viewed that camera's main stream. Perhaps this only happens when you're using Intel hardware acceleration, I'm not sure. I told the BI developer about this bug but he sort of shrugged it off and didn't deal with it. Again, this is something he needs to hear about more often from customers before he will fix it.

There is a way, albeit somewhat unintuitive, to force the use of the sub stream by requesting a specific width that is less than or equal to than the sub stream's scaled width. For example I have a 4MP cam (2688x1520) with a sub stream enabled (704x480). Blue Iris rescales the sub stream to 848x480 to better match the main stream's aspect ratio, as evidenced by the Size shown in BI Camera Properties > Video tab. If I request JPEG frames with a width argument specifying a size less than or equal to that width, then Blue Iris will not load the main stream, and will simply use the sub stream as the source for the image data. E.g. &w=848 would yield a frame sourced from the sub stream. This approach is considerably faster and more efficient if only a low resolution image is required.
 

fabsenet

n3wb
Joined
Sep 10, 2020
Messages
4
Reaction score
2
Location
Germany
I can not confirm the issue of getting old screenshots, but as you are writing, it may have to do with what actual hardware was used.

I want to send the images to azure cognitive services for analysis and/or to telegram and I want to have the best quality. Even if it is only 720p resolution, it is considerably sharper if main stream is used compared to the sub stream.

It would also help, if for example, blue iris would write image metadate stating the source used or if it would send http-headers stating the source stream. I could use this for a reliable retry logic.
 

aesterling

Getting comfortable
Joined
Oct 9, 2017
Messages
352
Reaction score
346
To complicate matters, Blue Iris reuses old video decoders and doesn't flush them properly so right at the moment the main stream loads, you get some old video frames from the last time you viewed that camera's main stream. Perhaps this only happens when you're using Intel hardware acceleration, I'm not sure. I told the BI developer about this bug but he sort of shrugged it off and didn't deal with it. Again, this is something he needs to hear about more often from customers before he will fix it.
I always wondered why I see a second of old video when switching between a camera’s sub and main streams in UI3. I’ll email BI support about this! Thanks for the explanation.
 
Last edited:

IAmATeaf

Known around here
Joined
Jan 13, 2019
Messages
3,304
Reaction score
3,282
Location
United Kingdom
I always wondered why I see a second of old video when switching between a camera’s sub and main streams in UI3. I’ll email BI support about this! Thanks for the explanation.
I also see this and could tell it was an old view but never really understood why until now.
 

fabsenet

n3wb
Joined
Sep 10, 2020
Messages
4
Reaction score
2
Location
Germany
so just as a (somewhat late) follow up. I contacted the blue iris support as suggested by @bp2008 and they added my feature wish.

you can add a url paramert: ...&decode=1 where 1 means mainstream, -1 means substream and 0 means "i do not care" (default). This is also documented in the manual.

Sometimes I observe an internal server error 500 but most of the time it just works as expected. Also as expected, if the mainstream is currently not decoded but is requested, it takes some time to deliver the image. my cam makes 12fps and I configured an I-Frame every 12 frames, so it can take up to a full second. so just keep this in mind!

consider this thread done :cool:
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,674
Reaction score
14,020
Location
USA
so just as a (somewhat late) follow up. I contacted the blue iris support as suggested by @bp2008 and they added my feature wish.

you can add a url paramert: ...&decode=1 where 1 means mainstream, -1 means substream and 0 means "i do not care" (default). This is also documented in the manual.
Yep, UI3 has been using this when saving snapshots for over a month :)
 
Top