Page 1 of 1
Please return 1/x scaling in live and event veiw!
Posted: Tue May 28, 2024 8:22 am
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).
Re: Please return 1/x scaling in live and event veiw!
Posted: Wed May 29, 2024 5:24 pm
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?
Re: Please return 1/x scaling in live and event veiw!
Posted: Wed May 29, 2024 5:41 pm
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
Re: Please return 1/x scaling in live and event veiw!
Posted: Thu May 30, 2024 7:24 pm
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.
Re: Please return 1/x scaling in live and event veiw!
Posted: Thu May 30, 2024 8:42 pm
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.
Re: Please return 1/x scaling in live and event veiw!
Posted: Fri May 31, 2024 6:27 am
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&maxfps=5&scale=18&state=1&monitor=2">
It's just now it became unavailable in ZM Web UI .
Re: Please return 1/x scaling in live and event veiw!
Posted: Fri May 31, 2024 11:28 am
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.
Re: Please return 1/x scaling in live and event veiw!
Posted: Fri May 31, 2024 12:56 pm
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!
Re: Please return 1/x scaling in live and event veiw!
Posted: Fri May 31, 2024 1:30 pm
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.
Re: Please return 1/x scaling in live and event veiw!
Posted: Mon Jun 03, 2024 6:39 pm
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..
Re: Please return 1/x scaling in live and event veiw!
Posted: Tue Jun 04, 2024 10:53 am
by MarsRover
Hello, nice to see you here!
use the scale= in the url
If you mean on my own page, like
then I'm already doing exactly what you say.
Because for example
just won't work (should it?)
Re: Please return 1/x scaling in live and event veiw!
Posted: Tue Jun 04, 2024 12:21 pm
by iconnor
No I mean <img src=urll&scale=20 style="width: 100%;" />
Re: Please return 1/x scaling in live and event veiw!
Posted: Tue Jun 04, 2024 3:41 pm
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.
Re: Please return 1/x scaling in live and event veiw!
Posted: Thu Jun 06, 2024 6:56 am
by MarsRover
I don’t know what else there is not to like
Updated to .61 and happy again, thanks!