From 61cd030d636d0df6723aa08dbfd5574dbfea9ed7 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 20 Sep 2026 17:51:13 -0400 Subject: [PATCH] feat: migrate Libvlc and NVSocket monitors to Ffmpeg NVSocket is removed in this release and Libvlc is deprecated. Both reach cameras ffmpeg reaches, so existing monitors are converted rather than left to fail at capture time. The migration is 1.39.38. Libvlc only changes type; Path already holds the full url, and User and Pass are merged by FfmpegCamera the same way. NVSocket has no url to convert -- it spoke a bespoke socket protocol to one vendor's nvr -- so those monitors are disabled rather than left with a type the daemon no longer recognises, which is Fatal and would take zmc down rather than skip the monitor. The rows are kept so their zones, groups and history survive. The value is then dropped from the Type enum in all three tables that carry it, and from zm_create.sql.in so a fresh install matches. Verified against a scratch database built with the live schema, covering Libvlc, NVSocket, and existing Ffmpeg and Local monitors. Re-running the file is a no-op. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015Y6FieTwEXuLhhR4e2yiax --- db/zm_create.sql.in | 6 +++--- db/zm_update-1.39.38.sql | 39 +++++++++++++++++++++++++++++++++++++++ version.txt | 2 +- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 db/zm_update-1.39.38.sql diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 4acc281c4..d755b6a67 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -65,7 +65,7 @@ DROP TABLE IF EXISTS `Controls`; CREATE TABLE `Controls` ( `Id` int(10) unsigned NOT NULL auto_increment, `Name` varchar(64) NOT NULL default '', - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket','VNC') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local', `Protocol` varchar(64) default NULL, `CanWake` tinyint(3) unsigned NOT NULL default '0', `CanSleep` tinyint(3) unsigned NOT NULL default '0', @@ -612,7 +612,7 @@ CREATE TABLE `MonitorPresets` ( `Id` int(10) unsigned NOT NULL auto_increment, `ModelId` int unsigned, FOREIGN KEY (`ModelId`) REFERENCES `Models` (Id), `Name` varchar(64) NOT NULL default '', - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket','VNC') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local', `Device` tinytext, `Channel` tinyint(3) unsigned default NULL, `Format` int(10) unsigned default NULL, @@ -649,7 +649,7 @@ CREATE TABLE `Monitors` ( `StorageId` smallint(5) unsigned default 0, `ManufacturerId` int unsigned, FOREIGN KEY (`ManufacturerId`) REFERENCES `Manufacturers` (Id), `ModelId` int unsigned, FOREIGN KEY (`ModelId`) REFERENCES `Models` (Id), - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket','VNC') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local', `DeviceClass` enum('Camera','Speaker') NOT NULL default 'Camera', `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', `Capturing` enum('None','Ondemand', 'Always') NOT NULL default 'Always', diff --git a/db/zm_update-1.39.38.sql b/db/zm_update-1.39.38.sql new file mode 100644 index 000000000..c06157d38 --- /dev/null +++ b/db/zm_update-1.39.38.sql @@ -0,0 +1,39 @@ +-- +-- This updates a 1.39.37 database to 1.39.38 +-- +-- Move monitors off capture methods that are going away. +-- +-- NVSocket is removed in this release and Libvlc is deprecated. Both reach +-- cameras that ffmpeg reaches, so the monitors are converted rather than +-- left to fail. +-- + +-- +-- Libvlc becomes Ffmpeg. Path already holds the full url for this type, and +-- User and Pass are merged the same way, so only the type changes. +-- +UPDATE `Monitors` SET `Type` = 'Ffmpeg' WHERE `Type` = 'Libvlc'; + +-- +-- NVSocket has no url to convert: it spoke a bespoke socket protocol to one +-- vendor's nvr. There is nothing to point ffmpeg at, so the monitor is +-- disabled instead of being left with a type the daemon no longer knows -- +-- an unrecognised type is Fatal, which would take zmc down rather than skip +-- the monitor. The row is kept so its zones, groups and history survive for +-- whoever has to decide what to do with it. +-- +UPDATE `Monitors` SET `Type` = 'Ffmpeg', `Capturing` = 'None' WHERE `Type` = 'NVSocket'; +UPDATE `Controls` SET `Type` = 'Ffmpeg' WHERE `Type` = 'NVSocket'; +UPDATE `MonitorPresets` SET `Type` = 'Ffmpeg' WHERE `Type` = 'NVSocket'; + +-- +-- Now that no row uses it, drop the value from the three enums that carry it. +-- Libvlc stays: it is deprecated, not removed, and a monitor can still be set +-- to it by hand. +-- +ALTER TABLE `Monitors` + MODIFY `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local'; +ALTER TABLE `MonitorPresets` + MODIFY `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local'; +ALTER TABLE `Controls` + MODIFY `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local'; diff --git a/version.txt b/version.txt index 5685d9c56..1c410917f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.39.37 +1.39.38