Analytics plugin components (such as Plugin, Engine, and DeviceAgent) must send JSON manifests to the Media Server. These manifests define static plugin configurations and dynamic runtime settings.
During development and testing, you can capture these JSON manifests and settings to inspect them. You can also substitute them with custom files to test different behaviors without rebuilding your plugin.
Capture manifests
To capture manifests sent from your plugin to the Media Server:
Open the
vms_server_plugins.inifile in a text editor.Create the target directory on your system if it does not already exist.
Set the
analyticsManifestOutputPathoption to your target directory path:analyticsManifestOutputPath=captured/manifestsRestart the Media Server.
The Media Server saves every manifest it receives as a JSON file in the specified directory. File names include details about the component that generated them. If a file already exists, the Media Server overwrites it.
NOTE: You can use a relative path (relative to the .ini file directory) or an absolute path. |
Example manifest output files
For a plugin named Stub Analytics Plugin, the generated files look like this:
Plugin manifest:
stub_analytics_plugin_manifest.jsonEngine manifest:
stub_analytics_plugin_engine_a6f9ed2c-261f-be90-5627-5bac6d0e7110_manifest.jsonDeviceAgent manifest (specific camera):
stub_analytics_plugin_device_e3e9a385-7fe0-3ba5-5482-a86cde7faf48_manifest.json
For full details on naming conventions, check the comments for analyticsManifestOutputPath in your vms_server_plugins.ini file.
Substitute manifests
To test how your plugin or Media Server behaves when a manifest changes, you can override the manifest string sent by the plugin with a custom file.
Capture the original manifests following the steps in the aforementioned Capture manifests.
Create a directory to hold your custom manifest files.
Copy the captured manifest files you want to modify into your new directory.
Edit the copied JSON files with your desired test values. Ensure the filenames match the original captured naming scheme.
In
vms_server_plugins.ini, set theanalyticsManifestSubstitutePathoption to your custom directory:analyticsManifestSubstitutePath=substitute/manifestsRestart the Media Server.
The Media Server now ignores the plugin's native manifests and reads your custom manifest files instead.
| NOTE: If you enable both capturing and substituting at the same time, the captured directory continues to store the original manifest generated by the plugin before substitution occurs. |
Capture settings
You can capture the settings that the Media Server sends to your plugin.
Open
vms_server_plugins.ini.Create the target directory if it does not exist.
Set the
analyticsSettingsOutputPathoption to your target directory:analyticsSettingsOutputPath=captured/settingsRestart the Media Server.
The Media Server writes the settings files to your directory. Generated filenames use the suffix _effective_settings.json.
Example settings output files
stub_analytics_plugin_engine_687611a2-fd30-94e7-7f4c-8705642b0bcc_effective_settings.jsonstub_analytics_plugin_device_ed93120e-0f50-3cdf-39c8-dd52a640688c_effective_settings.json
Substitute settings
You can force the Media Server to send specific settings to your plugin for testing.
In
vms_server_plugins.ini, set theanalyticsSettingsSubstitutePathoption to your custom settings directory:analyticsSettingsSubstitutePath=substitute/settingsAdd your custom settings JSON files to this directory.
Name the files using the captured settings naming scheme, but remove the
_effectivestring from the filename.Edit the JSON files to specify your test values.
Restart the Media Server.
NOTE: You can omit _<engine-id> from the filename if you want a settings file to apply to every Engine instance in that plugin. |
Example settings JSON structure
Settings files must contain an array of key-value JSON objects:
[
{ "name": "testCheckBox", "value": "true" },
{ "name": "testComboBox", "value": "value2" },
{ "name": "testDoubleSpinBox", "value": "3.1415" },
{ "name": "testSpinBox", "value": "42" },
{ "name": "text", "value": "a text" }
]Best practices for settings management
Use a shared or parallel folder structure: Because substitute settings filenames mirror captured filenames (minus
_effective), you can quickly copy a captured settings file, delete_effectivefrom its name, edit the values, and move it to your substitution folder.Understand captured output during substitution: If you enable both capturing and substituting for settings, captured files (containing
_effective) reflect the substituted values being delivered to the plugin, matching active server input.
Comments
0 comments
Article is closed for comments.