FFmpeg
FFmpeg copied to clipboard
matroska: Support >3 chars for Language and add LanguageIETF
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.
@nevcairiel
Any plans for official support for LanguageIETF in LAV Filters? It was added in MkvToolNix v50.
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.
I added code to support the other two Language tags, now.
@adipose: Is there something of this patch that can be ported upstream ( https://ffmpeg.org/ )?
@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: 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.
matroskadec_haali has never been part of FFmpeg