How to edit tags on mkv

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
Unknwn
Posts: 9
Joined: Fri Feb 18, 2022 11:17 pm

How to edit tags on mkv

Post by Unknwn »

Hi everyone.

I finally ripped my first full series and now I wanted to edit the tags and name them.
I currently have the files on my nas and watch them with vlc. I used 3delite mkv tag editor to edit the tags. Since it uses the imdb database for that it was really easy to use and the "rename" feature is nice since you can edit the file name based on tags. The problem is that vlc does not use the tags and the new title, it still shows the standard text (in this case "PERSON OF INTEREST SEASON 1 DISC 2") which is not helpful when watching a show.

I also tried mkvtoolnix but either it can't do what I'm looking for or I don't understand what to do.

I also read (even in this forum) that mkv is such a general container file, that there is no such tag editor.

So my question is: How do you guys edit filename and tags, or even sort your files in general? I could use VLC but that is manual and takes a lot of time..
Woodstock
Posts: 10311
Joined: Sun Jul 24, 2011 11:21 pm

Re: How to edit tags on mkv

Post by Woodstock »

mkvtoolnix, header editor. Lets you change, add, or delete tags. You can also use the command line version included.

It comes down to selecting the correct tags to edit - the one that will show up on a DLNA server is the "Title" tag.

I use a batch file to let me set a number of things on MKV files after processing:

Code: Select all

c:\MKVTools\MKVToolNix\mkvpropedit.exe %1 -e track:s1 --set flag-default=1 --set flag-forced=1 --edit info --set "title=%~n1"
The --set "title=%~n1" sets the title field to the file name without the extension.
Unknwn
Posts: 9
Joined: Fri Feb 18, 2022 11:17 pm

Re: How to edit tags on mkv

Post by Unknwn »

I use a batch file to let me set a number of things on MKV files after processing:

Code: Select all

c:\MKVTools\MKVToolNix\mkvpropedit.exe %1 -e track:s1 --set flag-default=1 --set flag-forced=1 --edit info --set "title=%~n1"
The --set "title=%~n1" sets the title field to the file name without the extension.
Oh, that's perfect. I wrote a little PowerShell script based on that, thanks! Can you explain what the other options do in your code? Also is there a tag that I can use for the season and episode?
Woodstock
Posts: 10311
Joined: Sun Jul 24, 2011 11:21 pm

Re: How to edit tags on mkv

Post by Woodstock »

The other parts set both the "default" and "forced" flags on the first subtitle track in the file, which makes it so most players will use that track by default. I run everything through handbrake, so I've moved the "correct" subtitle track to the first slot.

I found out over the years that players ignore the "default" flag, and the "forced" flag is only correct about 50% of the time if you let MakeMKV set it (disks are often mastered weird).

As for setting additional metadata, that would depend a lot on the player and server. Plex is popular as a server, and it can make use of a lot of metadata as I understand it. For me, I put the season and episode information in the file name AND in the title, like "Ah My Goddess S2 E01.mkv". Simpler for my old brain to deal with.
dcoke22
Posts: 3052
Joined: Wed Jul 22, 2020 11:25 pm

Re: How to edit tags on mkv

Post by dcoke22 »

I try to get a lot of the metadata right in MakeMKV to minimize how much mkvpropedit work I have to do after the fact. You can edit the name of subtitle tracks, audio tracks, individual episode titles and movie names in MakeMKV before you rip.

mkvpropedit has decent documentation. https://mkvtoolnix.download/doc/mkvpropedit.html
aprilia1k
Posts: 1
Joined: Thu Nov 16, 2023 3:21 am

Re: How to edit tags on mkv

Post by aprilia1k »

Greetings!

I am new to the forum, very cool - thanks!

Question: Is 'title' truly a tag? I ask because when I have used mkvinfo and mkvpropedit, it seems to me that 'title' is identified as a "segment" property [not attached to a specific track at all].

I am trying to set/add a comment tag, but --set "comment=string" isn't working for adding a tag, for me.

My script for adding title is very similar to yours, but I do not specify track.
I added a comment in my script saying that "since title is a segment property, no track is required". Since it was a couple of years ago, I'm just going by my comment, lol.

When I try to just use --set "comment=string", mkvpropedit returns an error:

"Error: The name 'comment' is not a valid property name for the current edit specification"

Using "title=string" works just fine, but again, it seems to set the segment title property, as opposed to a "tag". Still trying to figure out how to add a tag (as identified by mkvinfo).

Unfortunately, despite the docs being really pretty good, I haven't found much info about "tags" within the container file. I've been wanting to add comments for a long while, finally found an mkv with an existing comment tag within (when wrapping/converting mp4 files, I've had to just drop existing comments since I didn't know how to bring them over the the mkv container).

Thanks, and cheers!

Stephen
Post Reply