Tools to manipulate .mkv (matroska) audio/video files
From WickyWiki
Tools: mkvmerge, mkvinfo, mkvextract, mkvpropedit, mmg
sudo apt-get install mkvtoolnix
Example:
#describe the mkv contents and tracks mkvinfo *.mkv #or for short list including attachment ID's mkvmerge -i *.mkv #extract tracks 1,2,3 mkvextract tracks *.mkv 1:video.mpeg 2:audio.mp3 3:subtitles.srt #extract attachments id=1 mkvextract attachments *.mkv 1:attachments.ext #edit metadata mkvpropedit file.mkv --edit info --set "title=some title for file"
Add global tags to mkv
You need to create an xml file with the tags and values:
gedit tags.xml
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE Tags SYSTEM "matroskatags.dtd"> <Tags><Tag> <Simple><Name>SomeTagName1</Name><String>SomeTagValue1</String></Simple> <Simple><Name>SomeTagName2</Name><String>SomeTagValue2</String></Simple> <!-- repeat ... --> </Tag></Tags>
Run the following command, tags are added or replaced:
mkvpropedit yourfile.mkv --tags global:"tags.xml"
To list existing tags:
mkvinfo -v yourfile.mkv | sed '1,/|+ Tags/d'