Multiple video streams in exported Matroska file.

Exporting a Matroska file using MKVExporter we set the properties FileName, Path, CameraList, and AudioList.

In the resultant file we find there are two video streams.

Video stream index 0 - codec_id = AV_CODEC_ID_H264, pic_fmt = AV_PIX_FMT_YUVJ420P

Video stream index 1 - codec_id = AV_CODEC_ID_MJPEG, pic_fmt = AV_PIX_FMT_NONE

If we use stream index 0 the video plays normally, however, it appears that the second stream may not be fully formed and we cannot display anything from it.

The documentation suggests that there should only be one video stream per exported Matroska file. Since we are seeing two is there a configuration/setting/property that is required to be set to restrict the video streams to one?

I have asked an expert in Milestone Development saying that -

The JPEG track is there on purpose. In some cases the exporter is forced to transcode the video to JPEG. This can happen if the resolution of the video changes at some point in the exported segment or if there is a privacy mask that must be applied. If that happens the JPEG track is used, and if not it is left empty but still present.

It is on a wish list to change this. For the change to happen prioritization needs to be made by Milestone Product Management, so it is currently not possible to say when, or even if, this will be developed.

Look at this thread: https://developer.milestonesys.com/s/question/0D53X00008pOfbFSAS/mkv-exporter-output-file-size-and-alternatives

Freddy