Commit Graph

27943 Commits

Author SHA1 Message Date
Isaac Connor
c58a3ccdda Merge pull request #4758 from IgorA100/patch-718309
When using ONVIF, the console page should not display simply "Use ONVIF Events", but should also indicate which event the trigger is configured for.
2026-05-01 18:24:01 -04:00
Isaac Connor
b267c18cf6 Merge pull request #4762 from IgorA100/patch-447707
Now we will pause audioMotion in MonitorStream.js
2026-05-01 18:19:36 -04:00
Isaac Connor
810fc0944c Merge pull request #4753 from IgorA100/patch-546864
Provide the user with up-to-date information about the supported version of audioMotionAnalyzer
2026-05-01 18:16:55 -04:00
Isaac Connor
1cfe6eeb07 Merge pull request #4760 from IgorA100/patch-690135
FIX: Avoid reinitializing audioMotion if the previous one has not yet finished.
2026-05-01 18:16:15 -04:00
Isaac Connor
4cb5fe5d8f Merge pull request #4768 from IgorA100/patch-684933
Chore: Minor improvements to statistics display on the Event page
2026-05-01 18:15:23 -04:00
Isaac Connor
df381f7837 Merge pull request #4752 from IgorA100/patch-974193
Chore: UI optimization on User page
2026-05-01 18:15:13 -04:00
Isaac Connor
c99bf88078 Merge pull request #4769 from IgorA100/patch-826994
Change from translate('What display') to translate('Show') on Event page
2026-05-01 18:14:15 -04:00
Isaac Connor
1ad5c55fe2 Merge pull request #4770 from IgorA100/patch-976642
Chore: Minor style optimization for ".tags-container" on the Event page
2026-05-01 18:13:55 -04:00
Isaac Connor
0ce6155ef2 Merge pull request #4771 from IgorA100/patch-142774
Correction of the Russian translation (ru_ru.php)
2026-05-01 18:13:18 -04:00
Isaac Connor
cbf43e0472 Merge pull request #4764 from IgorA100/patch-923399
Prevent an error from being generated when processing the file "index.m3u8" (image.php)
2026-05-01 18:08:55 -04:00
Isaac Connor
68b05f3dba Merge pull request #4759 from IgorA100/patch-400417
Apply "chosen" to the Event page
2026-05-01 18:08:24 -04:00
Isaac Connor
45dd04aae4 Merge pull request #4749 from IgorA100/patch-590744
Display a modal window confirming the deletion of a user on Options page -> users
2026-05-01 18:07:02 -04:00
Isaac Connor
1413362d9e Merge branch '4777-output-file-range-parsing' 2026-05-01 16:01:04 -04:00
Isaac Connor
9233d5cc2b fix: parse HTTP Range header correctly in output_file() fixes #4777
The previous implementation used `str_replace($range, '-', $range)` which
is a no-op (wrong arg order, return value discarded), then cast the raw
Range value (e.g. "12345-67890" or "-500") to int. The function then
ignored the requested END entirely and always streamed from the parsed
start to EOF.

For a suffix range like `Range: bytes=-500` -- which Chrome's media stack
sends to locate the moov atom in many HEVC mp4s -- (int)"-500" is -500,
producing Content-Length = filesize + 500. fseek with SEEK_SET fails for
negative offsets, so the body delivered was filesize bytes against an
inflated Content-Length, triggering ERR_CONTENT_LENGTH_MISMATCH in the
browser and blocking HEVC playback in the files view.

Parse `bytes=start-end`, `bytes=start-`, and `bytes=-suffix` per RFC 7233,
clamp the end to file size, return 416 for unsatisfiable ranges, set
Content-Length to the actual byte count served, and stop reading once
that many bytes have been emitted. Guard ob_flush() with ob_get_level()
so it does not warn when no buffer is active.

Verified on pseudo by loading an HEVC mp4 in Chrome -- the
ERR_CONTENT_LENGTH_MISMATCH is gone, the browser parses metadata
(duration, dimensions) and buffers playback data normally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 16:00:59 -04:00
Isaac Connor
97dd74d875 build: add Profile CMAKE_BUILD_TYPE for perf/flamegraph
Adds a Profile build type with -O2 -g -fno-omit-frame-pointer so perf
can walk stacks accurately while running optimized code. Use with
cmake -DCMAKE_BUILD_TYPE=Profile ..
2026-04-30 19:07:46 -04:00
Isaac Connor
8b4c93ea1f fix: bail from MonitorStream::runStream when monitor failed to load
When setStreamStart()->loadMonitor() failed (e.g. monitor id not found,
shm not yet mapped), zms continued into runStream() for non-SINGLE
stream types and dereferenced a null Monitor shared_ptr at
monitor->GetFPS(), crashing in get_capture_fps with fault address 0x618.

Bail early after the STREAM_SINGLE branch with a "Not connected" text
frame, mirroring the SINGLE-type recovery. For STREAM_JPEG, emit the
multipart Content-Type first so sendTextFrame produces a well-formed
response. Placed before openComms()/command_processor spawn so there
is no resource teardown to do on the bail path.
2026-04-30 18:11:55 -04:00
IgorA100
f796429bc1 Update ru_ru.php 2026-04-30 22:03:57 +03:00
IgorA100
61636950f3 Correction of the Russian translation (ru_ru.php) 2026-04-30 21:06:46 +03:00
IgorA100
5aeeeb0561 Chore: Minor UI optimization for ".tags-container" on the Event page (skin.css) 2026-04-30 17:13:28 +03:00
IgorA100
2f4927fac0 Merge branch 'master' into patch-690135 2026-04-30 16:50:30 +03:00
IgorA100
8a33d2506a Merge branch 'master' into patch-826994 2026-04-30 16:49:38 +03:00
Isaac Connor
23060048e7 fix: parse audioMotionAnalyzer.js as module so ESLint succeeds
The file uses ES module import/export syntax but the global ESLint
config sets sourceType: "script", which caused CI to fail with a parse
error. Add a per-file override that parses it as a module, run
eslint --fix for the now-visible whitespace/indent/semi issues, and
drop two unused locals in createMotionAnalyzer that --fix could not
resolve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 09:09:53 -04:00
IgorA100
384243e696 Change from translate('What display') to translate('Show') (event.php) 2026-04-30 15:06:37 +03:00
IgorA100
d01ad984df Fix: Eslint (skin.js) 2026-04-30 13:52:44 +03:00
IgorA100
d82a90b6a7 In applyTemplateAudioMotionTranslation() , execute createClickableLink() & replaceDoubleTildeToBR() (monitor.js) 2026-04-30 13:48:53 +03:00
IgorA100
b219d3b023 Revert (lang.php) 2026-04-30 13:44:45 +03:00
IgorA100
19ff4caf60 Added replaceDoubleTildeToBR() & createClickableLink() function (skin.js)
https://github.com/ZoneMinder/zoneminder/pull/4753#discussion_r3158319968
https://github.com/ZoneMinder/zoneminder/pull/4753#discussion_r3158319976
2026-04-30 13:43:21 +03:00
Isaac Connor
b2b50aba5d perf: skip clearPackets early-returns and allow drop-to-iterator-keyframe
Two related changes to PacketQueue::clearPackets, called by the analysis
thread on every video packet:

1. Lock-free call-site gate (should_try_clear) on the analysis path.
   In keep_keyframes mode the existing early-return at the top of
   clearPackets discards most non-keyframe video packets after acquiring
   the queue mutex. Add an inline lock-free check at the call site so
   non-keyframe packets skip the mutex acquire entirely. clear_packets_pending_
   is now std::atomic<bool> so it can be read without the lock; a stale
   read is harmless (at worst we make one extra cheap early-returning call).
   The !keep_keyframes path always returns true from the gate because that
   mode pops one packet at a time on every video packet.

2. Iterator boundary in the scan loop changed from >= to >. Setting
   next_front to a packet that an iterator points at is safe because
   clearPackets deletes strictly before next_front, so the iterator's
   own packet stays in the queue. Previously, an event-start (or other)
   iterator landing exactly on a keyframe blocked the leading GOP from
   being dropped until the iterator advanced; now we can include that
   keyframe as next_front while the iterator continues to point at it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 19:39:04 -04:00
IgorA100
d7f7279e02 Apply ".flex-col-2" and ".flex-col-3" to all pages, not just the User page (skin.css)
This won't cause any problems, as ".flex-col-2" and ".flex-col-3" aren't currently used anywhere else.
2026-04-29 23:22:02 +03:00
IgorA100
68bbd7d753 Added ".flex-col-3" for "#frames" (event.php) 2026-04-29 22:44:37 +03:00
IgorA100
a49ce26ae0 Changed style for "#frames img" (event.css) 2026-04-29 22:16:35 +03:00
IgorA100
db0b0a7d05 Chore: Minor improvements to statistics display on the Event page (event.css) 2026-04-29 20:00:18 +03:00
IgorA100
db910df563 customElements.define moved after the class declaration (audioMotionAnalyzer.js) 2026-04-29 18:09:18 +03:00
IgorA100
8896bcfdc0 Abort checkVerAudioMotion() if we couldn't get the CURRENT_AUDIO_MOTION_ANALYZER_VERSION value (monitor.js)
https://github.com/ZoneMinder/zoneminder/pull/4753/changes#r3158319956
2026-04-29 18:05:01 +03:00
IgorA100
f9df56c43f Apply suggestion from @Copilot
We check for the file's existence, and if it does, we set AUDIO_MOTION_ENABLED = true.
Okay, let's do an additional check in case the import fails for some reason.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-29 17:27:12 +03:00
IgorA100
ce9c93dc5a Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-29 16:01:10 +03:00
IgorA100
cfa951abd2 Merge branch 'master' into patch-974193 2026-04-29 15:52:35 +03:00
IgorA100
16298046c0 Fix: https://github.com/ZoneMinder/zoneminder/pull/4752#discussion_r3158319612 (user.php) 2026-04-29 15:50:45 +03:00
IgorA100
840c1f0bc2 For now, apply the "legend" style only to the User page (skin.css) 2026-04-29 15:29:22 +03:00
IgorA100
564abeec37 Update web/skins/classic/css/base/skin.css
Ok. Let it be so, anyway, for now more than 3 pillars will not be used.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-29 15:24:30 +03:00
IgorA100
518ba21251 Update web/lang/en_gb.php
Oh, my bad English :(

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-29 14:47:55 +03:00
IgorA100
8f8274e86e Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-04-29 14:25:33 +03:00
IgorA100
74a4b40f9e Don't use "await" when calling "insertModalHtml()" (options.js)
I tested adding large amounts of data to the DOM, and the synchronous operation of "replaceWith" and "append" in the insertModalHtml() function works quite correctly.
This was just my extra precaution.
2026-04-29 14:21:10 +03:00
Isaac Connor
257ecafa4d fix: clean up ONVIF subscription before re-Subscribe to stop NotAuthorized loop
When PullMessages failed, Run() looped back into Subscribe() and called
CreatePullPointSubscription on the same soap context without unsubscribing
the previous one. Cameras with per-user pull-point caps (Hikvision,
Reolink, etc.) only release a slot when the originating socket closes, so
each cycle leaked a slot until the camera started rejecting new
subscriptions with ter:NotAuthorized. Only a zmc restart (which closed
sockets and ran the destructor) recovered.

- Subscribe() now calls cleanup_subscription() and tears down the soap
  context up front when has_valid_subscription_ is set, forcing a fresh
  TCP connection.
- WaitForMessage()'s failure path calls cleanup_subscription() before
  going unhealthy so the camera-side slot is released as soon as we know
  we're abandoning it.
- try_usernametoken_auth is reset at the start of each subscription cycle
  so a transient plain-auth fallback doesn't pin for the lifetime of the
  process.
- Auth-error detection in CreatePullPointSubscription now checks
  soap_fault_string in addition to soap_fault_detail; the observed fault
  carries the "...not authorized" wording in fault_string with detail=null,
  so the existing plain-UsernameToken fallback never fired.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 21:36:49 -04:00
IgorA100
a38c41a499 Update image.php 2026-04-28 20:07:42 +03:00
IgorA100
a1ff19c9d7 Update image.php 2026-04-28 19:01:10 +03:00
IgorA100
8957dcee56 Prevent an error from being generated when processing the file "index.m3u8" (image.php)
This is a very quick fix: https://github.com/ZoneMinder/zoneminder/issues/4763
2026-04-28 17:36:33 +03:00
IgorA100
5d958111ff We'll now pause audioMotion in MonitorStream.js. (MonitorStream.js) 2026-04-28 16:27:17 +03:00
IgorA100
e3df53de38 Added the pauseAudioMotion() function. (skin.js) 2026-04-28 16:26:13 +03:00
IgorA100
00d2ada3a2 Now we will pause audioMotion in MonitorStream.js (watch.js) 2026-04-28 16:23:30 +03:00