MKA and Title Metadata

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
AliceWonderMisc
Blank Cone
Blank Cone
Posts: 11
Joined: 11 Aug 2016 03:52

MKA and Title Metadata

Postby AliceWonderMisc » 21 Nov 2017 03:33

Hello,

I run a site (content offensive to some so I can't link) that allows some users to upload audios, where they get transcoded into m4a, mp3, vorbis, and opus. I then when I have time create WebVTT transcripts for the audios and when played on the website they are fine. However those are not much benefit to people who are hard of hearing who download them.

So I want to create downloadable versions with SRT embedded and it looks like Matroska is the best container for that. I can add a SRT via ffmpeg to a .m4a audio but accessing the captions is really difficult, and they display at a small size, But in VLC anyway when I make a .mka file - it can contain both the aac and opus streams so codec support is non-issue, and the SRT captions display beautifully at least in VLC (though an equalizer has to be in use, not sure why)

The problem is getting the right audio metadata. I am using the xml file format but it seems that VLC shows the filename instead of audio title. Here is an example of the xml:

Code: Select all

<?xml version="1.0" ?> <!DOCTYPE Tags SYSTEM 'matroskatags.dtd'> <Tags> <Tag> <Simple> <Name>ARTIST</Name> <String>Goddess Rachel</String> </Simple> <Simple> <Name>ALBUM</Name> <String>ReDacted</String> </Simple> <Simple> <Name>TITLE</Name> <String>Purple ReDacted</String> </Simple> <Simple> <Name>GENRE</Name> <String>Erotic Audio</String> </Simple> <Simple> <Name>PUBLISHER</Name> <String>Redacted Publisher</String> </Simple> <Simple> <Name>DISCNUMBER</Name> <String>1</String> </Simple> <Simple> <Name>TRACKNUMBER</Name> <String>2</String> </Simple> <Simple> <Name>CONTACT</Name> <String>Redacted Link</String> </Simple> <Simple> <Name>DATE_RELEASED</Name> <String>2017-11-05</String> </Simple> </Tag> </Tags>
it is added with --global-tags meta.xml via mkvmerge

Unfortunately the title never shows correctly, instead the filename is used. Tracknumber is also not used but I don't care about that as much. There must be something I'm not understanding about how Matroska tags work.

How do I get the correct audio title to display in VLC?

The .m4a and .opus files all are correct, but they are tagged with mutagen and I'm not sure I can tag Matroska with mutagen.

AliceWonderMisc
Blank Cone
Blank Cone
Posts: 11
Joined: 11 Aug 2016 03:52

Re: MKA and Title Metadata

Postby AliceWonderMisc » 21 Nov 2017 05:27

Okay I think I solved it - by creating two different Tag elements and adding Target information. The python in xml genertion -

CatTag = tagdom.createElement("Tag")
Tags.appendChild(CatTag)
TrackTag = tagdom.createElement("Tag")
Tags.appendChild(TrackTag)

Targets = tagdom.createElement("Targets")
CatTag.appendChild(Targets)
TypeV = tagdom.createElement("TargetTypeValue")
TypeV.appendChild(tagdom.createTextNode("70"))
Targets.appendChild(TypeV);
TypeS = tagdom.createElement("TargetType")
TypeS.appendChild(tagdom.createTextNode("COLLECTION"))
Targets.appendChild(TypeS)

Targets = tagdom.createElement("Targets")
TrackTag.appendChild(Targets)
TypeV = tagdom.createElement("TargetTypeValue")
TypeV.appendChild(tagdom.createTextNode("30"))
Targets.appendChild(TypeV);
TypeS = tagdom.createElement("TargetType")
TypeS.appendChild(tagdom.createTextNode("TRACK"))
Targets.appendChild(TypeS)

Then I create the key/value pairs for the metadata and add to CatTag TITLE (collection title), GENRE, PUBLISHER and to the TrackTag node the track specific metadata including it's title.

The resulting xml then seems to be seen by VLC the way I want it to be.

So I think I'm good. I just needed to use two different Tag nodes, and set up Targets in them.

I much prefer vorbis comments ;)

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: MKA and Title Metadata

Postby Jean-Baptiste Kempf » 21 Nov 2017 16:16

MKV multi-level metadata are a bit complex, yes :)
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 124 guests