Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

edit meta comment tag of an mkv file

I use mkvpropedit to edit the meta tag title of some mkv files which works great.

find . -type f -name '*.mkv' -exec sh -c 'mkvpropedit --set "title=$(basename "$1")" "$1"' sh '{}' \;

but I also want to edit the comment tag, but whatever I try I always get:

Error: The name 'comment' is not a valid property name for the current edit specification in '--set comment= '

the man page of mkvpropedit explains only that --set is followerd by name=value and that's also everything I could find online, no decription of what the possible names are

like image 411
Hisfantor Avatar asked Oct 15 '25 16:10

Hisfantor


1 Answers

I know it has been like 2 years but, I recently had this error and was able to find its solution.

The thing is this command is specifically to edit properties, but not tags, as comments are tags, you need to use an XML file to add the comment attribute.

First, you need to set up the XML file with the following information:

<?xml version="1.0"?>
<!-- <!DOCTYPE Tags SYSTEM "matroskatags.dtd"> -->
<Tags>
  <Tag>
    <Targets />
    <Simple>
      <Name>COMMENT</Name>
      <String>Comment you wish to add</String>
    </Simple>
  </Tag>
</Tags>

Next you need to run the following command

mkvpropedit filename.mkv --tags all:comment.xml

I recommend using mkvextract to extract the existing tags and adding the ones you wish to add, otherwise a lot of them might be deleted.

mkvextract my_movie.mkv tags tag_file.xml
like image 88
EdgarAllanCode Avatar answered Oct 17 '25 09:10

EdgarAllanCode