XML Validation
Schema Files
Example files and files are provided allowing standard XML validation tools to be used to validate NDI metadata messages. A parser which understands XSD version 1.1 is required.
Free tools that support XSD 1.1 include Xerces2 (Java) from apache.org and the Python3 xmlschema library by . The community version of the Liquid Studio XML editor is a convenient editing and validation environment for the Xerces2 Java library.
Validation using python can be as simple as a few lines of code (tested on with the python3-xmlschema package installed):
Several top-level schema files are provided to assist with validating the various metadata streams available:
ndi_metadata_all
A collection of all valid NDI metadata messages, regardless of how or where they are sent.
ndi_metadata_recv
Valid metadata messages received by an NDI receiver.
ndi_metadata_send
Valid metadata messages received by an NDI sender.
ndi_metadata_video
Valid metadata messages received with an NDI video frame.
model_name
Product model name
serial
Product serial number
session_name
Session name for TriCaster or similar products General product information for other devices
The remaining files in the Schemas
directory define specific metadata elements and are pulled in by the top-level files listed above.
There is a Liquid Studio project file NDI_Metadata.lxsproj
in the top level directory which can be used with the community (or paid) version of Liquid Studio to assist with editing and validation of the NDI metadata and schema files.
Schema Limitations
There are a few known limitations to the schema files:
The logic for the use of the various attributes available under the
ndi_capabilities
element is incomplete and under review.No user-defined element name should ever match the regex
[nN][dD][iI].*
or[nN][tT][kK].*
, which is not currently expressed in the schema files. The Python validation script programmatically checks for this.There are currently no specific metadata elements defined for sending with an NDI audio frame.
XML Files
Typical examples of various NDI metadata frames are provided in the Documents
directory.
Validation Application
A Python application is provided that will listen for metadata from an NDI sender or receiver and can be used to validate the formatting and in some cases the content of an NDI metadata frame. This application can also validate XML metadata from a file or provided on the command line (be careful with shell expansion and quoting when passing metadata on the command line).
The python validation app requires the xmlschema
and ndi-python
libraries. The xmlschema
library can typically be installed via OS packages or using pip, but the ndi-python
library currently needs to be installed from source. Since the source repository includes a git submodule, it does not install properly using pip.
Last updated
Was this helpful?