Opened 19 months ago
Closed 12 months ago
#9419 closed enhancement (fixed)
support current standard font mimetypes in matroska metadata
|Reported by:||bfhpx4hjah||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
Summary of the bug:
Only legacy font mimetypes are recognized in matroska mimetype metadata tags. E.g. a truetype font is only recognized if the mimetype metadata tag is "application/x-truetype-font", the current standard "font/ttf" isn't recognized.
One problem resulting from this is that when using the subtitles filter, fonts tagged with current standard mimetypes won't be used and subtitles thus might be rendered incorrectly.
The current standard mimetypes for fonts can be found here: https://www.iana.org/assignments/media-types/media-types.xhtml#font
Mkvtoolnix-gui uses these mimetypes for fonts by default, any matroska file created by it containing attached fonts will exhibit this issue (unless the option to use legacy mimetypes for fonts is enabled or an old version of mkvtoolnix-gui is used).
How to reproduce:
Create a matroska file with an attached font using a recent version (58.0.0 or later, based on my testing) of mkvtoolnix-gui and try to open the file with ffmpeg:
% ffmpeg -i mime_current.mkv ffmpeg version N-103603-gc4973e2148 built on arch linux ... [matroska,webm @ 0x562ab0532b40] Could not find codec parameters for stream 1 (Attachment: none): unknown codec ... Stream #0:1, 0, 1/90000: Attachment: none Metadata: filename : NotoSans-Regular.ttf mimetype : font/ttf ...
Simply changing the mimetype metadata tag to the legacy value (e.g. using mkvpropedit or the edit headers tool in mkvtoolnix-gui) will solve the issue:
% ffmpeg -i mime_legacy.mkv ffmpeg version N-103603-gc4973e2148 built on arch linux ... [matroska,webm @ 0x55649aa2eb40] All info found ... Stream #0:1, 0, 1/90000: Attachment: ttf Metadata: filename : NotoSans-Regular.ttf mimetype : application/x-truetype-font ...
Change History (5)
comment:1 by , 19 months ago
|Summary:||support current standard font mimeypes in matroska metadata → support current standard font mimetypes in matroska metadata|
comment:2 by , 19 months ago
comment:3 by , 19 months ago
|Status:||new → open|
I actually wanted to do this as soon as there is official agreement about this here. But it seems that the "soon(ish)" there can be pretty long, so I will just add all the mime types even without an official list.
comment:4 by , 12 months ago
Is this enough? af6081273f483844fc055bc8623ec07198462c2a
comment:5 by , 12 months ago
|Status:||open → closed|
Well, that is just a bug here. https://github.com/FFmpeg/FFmpeg/blob/9abf0e0419c1ebfe6ba9075af0f032b6d45ef741/libavformat/matroskadec.c#L790