FFmpeg icon indicating copy to clipboard operation
FFmpeg copied to clipboard

matroska: Support >3 chars for Language and add LanguageIETF

Open adipose opened this issue 5 years ago • 7 comments

Matroska language strings are not limited to 3 characters, and support tags like en-US, etc. Using only 3 characters leads to funny strings like "en-". Given that LAVFilters doesn't support that format of languages, I simply truncate those to "en".

Also added LanguageIETF which is a supported Matroska tag for BCP-47 languages. When using this, set the new "langType" to identify it as BCP-47.

adipose avatar Sep 24 '20 03:09 adipose

@nevcairiel

Any plans for official support for LanguageIETF in LAV Filters? It was added in MkvToolNix v50.

clsid2 avatar Sep 24 '20 10:09 clsid2

To be clear, there are actually 3 fields in the matroska standard that can use both Language and LanguageIETF. And both are strings of no specific length, rather than the 3 char implementation currently supported by this branch.

https://matroska.org/technical/basics.html

The ISO 639-2 Language Elements are “Language Element”, “TagLanguage Element”, and “ChapLanguage Element”. The BCP 47 Language Elements are “LanguageIETF Element”, “TagLanguageIETF Element”, and “ChapLanguageIETF Element”.

I only dealt with one of them so far, as that's the main one causing an issue. The others had a strange memory issue that I wasn't able to track down yet, so I left them alone.

adipose avatar Sep 24 '20 19:09 adipose

I added code to support the other two Language tags, now.

adipose avatar Sep 25 '20 03:09 adipose

@adipose: Is there something of this patch that can be ported upstream ( https://ffmpeg.org/ )?

ale5000-git avatar Sep 20 '21 15:09 ale5000-git

@ale5000-git

I refuse to use mailing lists for code contributions. It's such a poorly designed interface and about 8 years out of date for collaboration. I have been on a few in the past and I really hate digging through emails to find things later.

So...you have my blessing if you want to submit my code to the ffmpeg mailing list and see if they'll accept a patch.

They also rejected my PR here: https://github.com/FFmpeg/FFmpeg/pull/353 and I was too lazy to submit via mailing list.

adipose avatar Sep 20 '21 19:09 adipose

@adipose: Beside that (that I can do when I have time) I wonder if you know if there is something that can be ported since if I'm not wrong the "matroskadec_haali.c" was deprecated in main ffmpeg and replaced with something else.

ale5000-git avatar Sep 20 '21 20:09 ale5000-git

matroskadec_haali has never been part of FFmpeg

clsid2 avatar Sep 21 '21 19:09 clsid2