mkclean is a command line tool to clean and optimize Matroska files
https://www.matroska.org/downloads/mkclean.html