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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Y6FieTwEXuLhhR4e2yiax
This commit is contained in:
Isaac ConnorandClaude Opus 5 committed 2026-10-10 09:32:17 -04:00
1 parent ce16d3eb08
commit 61cd030d63
3 files changed
+43 -4

No files matched your search

+3 -3
View File
@@ -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',
+39
View File
@@ -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';
+1 -1
View File
@@ -1 +1 @@
1.39.37
1.39.38