Please return 1/x scaling in live and event veiw!

Current Development version likely to have breaking changes
Post Reply
MarsRover
Posts: 46
Joined: Sat Apr 30, 2022 10:34 am

Please return 1/x scaling in live and event veiw!

Post by MarsRover »

Hello.
There's a breaking change in Web UI in v1.37.60 that doesn't allow scaling event and live view то fractional scales.
I really need 1/2, 1/4 and 1/8 because of the bandwidth issues (some of my ZMs are at remote locations with 0.4-1 Mbps connectivity).

I was able to quickly restore this functionality for event view by patching config.php and and event.js, but watch.js is a bit more complicated (I'm not a web dev at all).
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Please return 1/x scaling in live and event veiw!

Post by IgorA100 »

There is a Scale=Auto mode, but I understand that this image is still too big for you?

I'll think about solving this problem.
I see two options:
1. Make the image even smaller, for example enter a fixed width parameter of 480px and/or 640px
2. Leave the size as it is now, but reduce the image quality.

Scale = 1/2, 1/4 and 1/8 is generally an abstract parameter. 1/4 of what size? :) From the camera resolution? From the monitor resolution? From the visible area in the browser?
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Please return 1/x scaling in live and event veiw!

Post by IgorA100 »

I had another thought:
- In the bandwidth settings, add the "Image quality" parameter (Best, Medium, Low)
- On the Event and Watch pages add to Scale: maxWidth = 480px and 640px
MarsRover
Posts: 46
Joined: Sat Apr 30, 2022 10:34 am

Re: Please return 1/x scaling in live and event veiw!

Post by MarsRover »

This won't work, since sometimes I do need full-scale.
As I was able to solve it with event view with the old-way "Scale" dropdown, I don't think doing the same for live view should be really hard or impossible.
I'm not using WebRTC or Janus, just standart ZM one.
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Please return 1/x scaling in live and event veiw!

Post by IgorA100 »

MarsRover wrote: Thu May 30, 2024 7:24 pm This won't work, since sometimes I do need full-scale.
To be honest, now I don’t understand at all what you want.
Please explain in detail what you need, just without the wording 1/2, 1/4.....
I hope you don’t want to view the image in FHD with FPS=20 with a channel width of 1 Mbps???
Forget about the old "Scale" options, they won't exist anymore. But in order for me to help you, I need to clearly understand what you want.
MarsRover
Posts: 46
Joined: Sat Apr 30, 2022 10:34 am

Re: Please return 1/x scaling in live and event veiw!

Post by MarsRover »

Please explain in detail what you need, just without the wording 1/2, 1/4.....
I hope you don’t want to view the image in FHD with FPS=20 with a channel width of 1 Mbps???
I just need a live or recorded event view scaled to whatever factor I specify.
Forget about the old "Scale" options, they won't exist anymore. But in order for me to help you, I need to clearly understand what you want.
They do exist.
I'm able to view livestream with any scale and FPS I want just by using the right URL, like it was before.
For example, Monitor 2, scale=18% and maxFPS=5

Code: Select all

<img src="http://<IP>/zm/cgi-bin/nph-zms?mode=jpeg&amp;maxfps=5&amp;scale=18&amp;state=1&amp;monitor=2">
It's just now it became unavailable in ZM Web UI .
Last edited by MarsRover on Fri May 31, 2024 12:58 pm, edited 1 time in total.
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Please return 1/x scaling in live and event veiw!

Post by IgorA100 »

MarsRover wrote: Fri May 31, 2024 6:27 am scaled to whatever factor I specify.
New Pan & Zoom systems are used for scale images
Less than 1 there is no point in reducing the image.
MarsRover wrote: Fri May 31, 2024 6:27 am They do exist.
I'm able to view livestream with any scale and FPS I want just by using the right URL, like it was before.
For example, Monitor 2, scale=18% and maxFPS=5
scale=18% - is intended to change the quality of the transmitted frame, 100 is the maximum quality. Scale is calculated automatically depending on the size of the frame displayed in the browser. The larger the image size, the better quality the frame will be transmitted.

I completed a PR https://github.com/ZoneMinder/zoneminder/pull/4058 in which it will be possible to specify both the maximum image size and the quality of the transmitted frame. This allows you to flexibly adjust the quality/bandwidth

You still haven't answered my question:
Scale = 1/2, 1/4 and 1/8 is generally an abstract parameter. 1/4 of what size? :) From the camera resolution? From the monitor resolution? From the visible area in the browser?
But ask to return the option
I really need 1/2, 1/4 and 1/8
I’m trying to understand what exactly doesn’t suit you in my proposal, but you don’t answer me anything specific.

You probably want to apply "scale=18%" to some frame, but then at least tell what the resolution of your camera is and what the size of the image displayed in the browser is. I will need this to understand your logic.
MarsRover
Posts: 46
Joined: Sat Apr 30, 2022 10:34 am

Re: Please return 1/x scaling in live and event veiw!

Post by MarsRover »

Scale = 1/2, 1/4 and 1/8 is generally an abstract parameter. 1/4 of what size?
They were not abstract before v1.37.60, in my case they meant (WxH)/x, and WxH was the camera resolution since I'm always specifying real camera resolution on Monitor Source page.
I'm not sure what happens if Camera WxH is not the same as Monitor Wxh, didn't check.
Scale is calculated automatically depending on the size of the frame displayed in the browser.
Not when I'm using the above code (<img src=...>) my own "Montage" page. It's just scale in this case

Thanks' for the PR!
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Please return 1/x scaling in live and event veiw!

Post by IgorA100 »

MarsRover wrote: Fri May 31, 2024 12:56 pm They were not abstract before v1.37.60, in my case they meant (WxH)/x, and WxH was the camera resolution
Ok, so 1/4 is the camera resolution. And if one camera is 1920x1080, and the second is 3840x2160, then when displaying the first camera, the visible size in the browser is 480x270, and in the second case - 960x540. Is this beautiful?
MarsRover wrote: Fri May 31, 2024 12:56 pm Thanks' for the PR!
Will my PR suit you?
You responded to my proposal:
This won't work, since sometimes I do need full-scale.
User avatar
iconnor
Posts: 3357
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Please return 1/x scaling in live and event veiw!

Post by iconnor »

@MarsRover,

Use css to make the viewable image any size you want, and use the scale= in the url to drop the resolution sent. You can have the best of both worlds. Low bandwidth and large image. Just not the clearest image, We should probably have a quality= to adjust the actual jpeg compression quality..
MarsRover
Posts: 46
Joined: Sat Apr 30, 2022 10:34 am

Re: Please return 1/x scaling in live and event veiw!

Post by MarsRover »

Hello, nice to see you here!
use the scale= in the url
If you mean on my own page, like

Code: Select all

<img src=url> 
then I'm already doing exactly what you say.
Because for example

Code: Select all

/zm/?view=watch&mid=1&scale=20
just won't work (should it?)
User avatar
iconnor
Posts: 3357
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Please return 1/x scaling in live and event veiw!

Post by iconnor »

No I mean <img src=urll&scale=20 style="width: 100%;" />
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Please return 1/x scaling in live and event veiw!

Post by IgorA100 »

After https://github.com/ZoneMinder/zoneminder/pull/4058 I don’t know what else there is not to like. I no longer have any idea how to improve anything in the interface.
iconnor wrote: Mon Jun 03, 2024 6:39 pm We should probably have a quality= to adjust the actual jpeg compression quality..
Maybe yes.
MarsRover
Posts: 46
Joined: Sat Apr 30, 2022 10:34 am

Re: Please return 1/x scaling in live and event veiw!

Post by MarsRover »

I don’t know what else there is not to like
Updated to .61 and happy again, thanks!
Post Reply