libvideo-metadata is a C library that handles the serialization and de-serialization of video metadata in both streaming and recording.
- serializing/de-serializing of frame (timed) metadata
- serializing/de-serializing of session (untimed) metadata
- metadata conversion to CSV or JSON formats
- various helper functions
The library depends on the following Alchemy modules:
- libfutils
- libulog
- json (optional)
Building is activated by enabling libvideo-metadata in the Alchemy build configuration.
The API functions are not thread safe and should always be called from the same thread, or it is the caller's resposibility to synchronize calls if multiple threads are used.
As a writer the library takes as input vmeta_frame structures and serializes the data as vmeta_buffer objects, ready to use in a stream sender (see libvideo-streaming) or in a MP4 muxer.
As a writer the library takes as input a vmeta_session structure and serializes the data as either data for a stream sender (SDES RTCP packets - see libvideo-streaming - and/or SDP attributes - see libsdp) or for a MP4 muxer (in meta or udta boxes).
As a reader the library takes as input vmeta_buffer objects coming either from a stream receiver (see libvideo-streaming) or a MP4 demuxer (see libmp4) and de-serializes the data as vmeta_frame structures.
As a writer the library takes as input data coming either from a stream receiver (SDES RTCP packets - see libvideo-streaming - and/or SDP attributes - see libsdp) or a MP4 demuxer (values from meta or udta boxes - see libmp4) and de-serializes the data as a vmeta_session structure.
The library can be tested using the provided vmeta-extract command-line tool which takes as input a MP4 video file or a *.pcap packet capture and optionally outputs CSV, JSON and KML files.
To build the tool, enable vmeta-extract in the Alchemy build configuration. To use with mp4 files as input, libmp4 must be enabled in the build configuration. To use with *.pcap files, the libpcap-dev package must be installed on the system. For JSON output json must be enabled in the build configuration.
For a list of available options, run
$ vmeta-extract -h