Updated: October 28, 2024 |
Get metadata properties of a single track or image inside the input file
#include <mm/renderer/events.h>
strm_dict_t* mmr_metadata_split(strm_dict_t const *md, const char *type, unsigned idx)
This function examines the metadata set stored in the md dictionary and extracts the properties indicated by type from the entry stored at idx. These properties are parsed into key-value pairs and put into a new dictionary, and a handle to this dictionary is returned.
When you receive a METADATA event through mmr_event_get(), the data field in the returned structure stores a dictionary containing the metadata properties of the attached input or a track referenced by it (e.g., a playlist entry). The dictionary's handle can be passed into mmr_metadata_split() to read properties of audio, video, and subpicture tracks, and artwork inside the input.
Type | Properties |
---|---|
audio | sample_rate, channels, bitrate, fourcc, and lang |
image | width, height, mime, and type |
subpicture | Same as for video, except frame_rate isn't present |
video | frame_rate, bitrate, width, height, pixel_width, pixel_height, fourcc, and lang |
For information about reading these values in the dictionary, see the Dictionary Object API reference.