Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd September 2019, 20:43   #461  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,544
But mkvinfo does not provide "raw length"?
sneaker_ger is offline   Reply With Quote
Old 23rd September 2019, 21:06   #462  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,024
At least not that I'm aware of, from what I know you have to calculate it yourself by parsing the blocks.
I hoped there might be some additional (and 'new') data somewhere providing the info, since parsing the whole output is a pain for large files with xy streams.

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 24th September 2019, 09:09   #463  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,024
For video stream detecting the stretch is easy you could compare the 'Codec's private data: size' and the 'Default duration' for the stream. My guess is this is how MediaInfo reports container vs. stream fps.
Sadly for audio streams (even if the frame size should be constant), you only sometimes have a 'Default duration' info and I haven't seen any 'Codec's private data: size' so far. :/
-> @Mosu: would it be possible to simply keep a single entry per stream which shows how much a streams duration was stretched in case this happens? Or is there some easy way to calculate stretch value?
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 24th September 2019, 09:28   #464  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,544
A codec's private data doesn't change when stretched.
sneaker_ger is offline   Reply With Quote
Old 30th September 2019, 07:05   #465  |  Link
Liisachan
李姗倩 Lǐ Shān Qin
 
Liisachan's Avatar
 
Join Date: Nov 2002
Posts: 1,229
Font file: Which attachment-mime-type should I use?

Hi! I'd appreciate any input from anyone.

Currently, when attached via GUI on Windows, a TTF file seems to get --attachment-mime-type application/x-truetype-font by default (*), an OTF gets --attachment-mime-type application/vnd.ms-opentype. On the other hand, RFC 8081 in Feb 2017 defined the official Media Types for them, font/ttf and font/otf, respectively, and there is also font/sfnt. My friend who muxes on Mac actually gets "application/font-sfnt" then "font/sfnt" by default for TTF, saying mkvmerge (on Mac) probably updated how it does things. Hence this ongoing debate among our group:
Opinion 1: We should now use the standardized media types (e.g. font/ttf), instead of non-standard wild types such as "application/x-font-ttf".
Opinion 2: We shouldn't. That will confuse many players, and the fonts won't be loaded/used properly.

In the long run, maybe we should start using "font/ttf" sooner or later, but if there is some kind of guideline that says that for maximum interoperability/compatibility one SHOULD keep using "application/x-truetype-font" for TTF in Matroska, perhaps that makes sense too.

@Mosu Do you (or Matroska devs) have any specs/opinions/plans about this matter?

(*) Very early versions of mkvmerge may have used "application/octet-stream", if I check old MKV files muxed in 2003-2004.

Last edited by Liisachan; 7th October 2019 at 10:13. Reason: FIX: RFC 8081 in Feb 2007 -> Feb 2017
Liisachan is offline   Reply With Quote
Old 30th September 2019, 08:32   #466  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,039
Quote:
Originally Posted by Liisachan View Post
Hi! I'd appreciate any input from anyone.

Currently, when attached via GUI on Windows, a TTF file seems to get --attachment-mime-type application/x-truetype-font by default (*), an OTF gets --attachment-mime-type application/vnd.ms-opentype. On the other hand, RFC 8081 in Feb 2007 defined the official Media Types for them, font/ttf and font/otf, respectively, and there is also font/sfnt.
Ouch!
Fonts never ever should have been defined as "application/something", to begin with. That suxxx as badly as configuring a web server to define a video file as "application/x-oleobject"
~woman facepalming emoji~

Quote:
In the long run, maybe we should start using "font/ttf" sooner or later
In the long run, SURELY we should start using "font/ttf" sooner or later. The idiocies from the not-very-smart past should be terminated as soon as possible.

Last edited by filler56789; 30th September 2019 at 08:36.
filler56789 is offline   Reply With Quote
Old 30th September 2019, 09:30   #467  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 687
From my point of view, I don't care what type we use. I was more interested in the possibility of adding ttf to subtitle and then playing. Under the condition that the recipient likes to watch with subtitles. If the ttf size was over 4MB, the movie didn't play on my computer. So what are we discussing?
Jamaika is offline   Reply With Quote
Old 30th September 2019, 11:19   #468  |  Link
Liisachan
李姗倩 Lǐ Shān Qin
 
Liisachan's Avatar
 
Join Date: Nov 2002
Posts: 1,229
Thanks for the comments.

Quote:
Originally Posted by filler56789 View Post
Ouch!
Fonts never ever should have been defined as "application/something", to begin with.
Well, Matroska was born around 2003; the official Media Type "application/font-sfnt" was only defined in 2013 (and became obsolete in 2017 when "font/ttf" was defined), thus there was no "correct" choice in the first place between 2003-2013, except maybe generic "application/octet-stream" if anything. It's not like someone did something not-very-smart. Simply there was no "correct" answer at all.

@Jamaika You can use font subsetting so that only the glyphs used in your script will be supported. Say, you have a CJK font (4 MiB) supporting 40,000 glyphs, but you actually use 2,000 glyphs, then your compacted font will be like 0.2 MiB, which you can attach to your MKV instead of the huge original font file.

If we use "font/ttf" now, potentially many existing players won't load the attached TTF files. One example of such players is the last official version of MPC-HC from 2017, perhaps still used by a few people. We geeks can just use a newer (unofficial) MPC-HC for example, but that's something like using ECMAScript 2017 in an webpage simply because "our" nightly builds support it, ignoring normal users with regular browsers who want to enjoy the same page (but will experience problems).

Last edited by Liisachan; 30th September 2019 at 20:57. Reason: made the important part bold; changed 1 word (options->answer)
Liisachan is offline   Reply With Quote
Old 30th September 2019, 11:31   #469  |  Link
Jamaika
Registered User
 
Join Date: Jul 2015
Posts: 687
Quote:
Originally Posted by Liisachan View Post
Thanks for the comments.
@Jamaika You can use font subsetting so that only the glyphs used in your script will be supported. Say, you have a CJK font (4 MiB) supporting 40,000 glyphs, but you actually use 2,000 glyphs, then your compacted font will be like 0.2 MiB, which you can attach to your MKV instead of the huge original font file.
I don't know how to do it. I haven't seen users do this. There was to be a new version of libass v5.0 with new font tab options. Nothing that I know of. I think the topic has died and it's certainly not Matroska's problem. Anyway, the problem of enabling new features is associated with potential piracy than improving the video world.

About ttf: I read convert everything to otf. There are converters. How many votes so many ideas.

Last edited by Jamaika; 30th September 2019 at 11:34.
Jamaika is offline   Reply With Quote
Old 30th September 2019, 16:53   #470  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,039
Quote:
Originally Posted by Liisachan View Post
Well, Matroska was born around 2003; the official Media Type "application/font-sfnt" was only defined in 2013 (and became obsolete in 2017 when "font/ttf" was defined), thus there was no "correct" choice in the first place between 2003-2013, except maybe generic "application/octet-stream" if anything. It's not like someone did something not-very-smart. Simply there was no "correct" options at all.
Well, I didn't say and I didn't mean that the Matroska developers are the ones to blame in this case. I stopped playing around with Web "development" (read: programming) ages ago, when nearly-nobody used font-embedding in HTML pages... and I was too ignorant and lazy to perceive that the "application/something" mime types were not a very-logical thing.

And yes, someone did something that was not-smart-at-all. Namely, the ones who decided that "application/sth" should be the umbrella label for anything that they were too lazy to classify properly... For example, they should have chosen archive/zip, archive/rar, document/pdf, document/msword, document/msexcel, mmedia/mp4, etc, instead of application/zip, application/rar, application/pdf and so on.
filler56789 is offline   Reply With Quote
Old 30th September 2019, 23:15   #471  |  Link
Liisachan
李姗倩 Lǐ Shān Qin
 
Liisachan's Avatar
 
Join Date: Nov 2002
Posts: 1,229
Let me clarify the context of my original question:

1. A media player that supports softsubbed MKV won't load the attached font files if it doesn't recognize them as fonts. Then styled subs will be broken (shown with some system default fonts), unless the attached fonts are already installed. This is bad!
2. Many programs (splitter, demuxer, etc.) seem to recognize an attached file as a font by checking its MIME type. So, in principle, you want to use an attachment-mime-type that makes every tool happy. But if "application/x-truetype-font" is going to be obsolete soon, we may want to discard backward compatibility.

Thus the original question: what should I type after --attachment-mime-type when attaching a TTF: "font/sfnt" as seen on Mac, "font/ttf" as in RFC, or actually "application/x-truetype-font" after all?

@Jamaika Subsetting is supported by Windows OS itself. It's widely used when embedding fonts in general, and there is no license problem unless subsetting is forbidden in fsType in the 'OS/2' table of that font. Since this is off-topic, you can start a new thread and/or PM me if interested.

@filler56789 To use new top-level types ("archive", "document", etc.), you MUST first define them via RFC, which would be probably time-consuming. But I see your point - e.g. "application/vnd.ms-opentype" looks a bit ugly (why ms- when it's supposed to be an open standard).
Liisachan is offline   Reply With Quote
Old 4th October 2019, 18:18   #472  |  Link
arrgh
Registered User
 
Join Date: Dec 2007
Posts: 143
Mvc - 3d

hi
after some significant time, I wanted to check what the timeline might be for the muxing of MVC mkv-files...
here was the last reference to this...:
https://forum.doom9.org/showpost.php...postcount=5078

as can be seen here 3D is still of interest to many people, as also the tsmuxer open source project shows:
https://forum.doom9.org/showthread.p...21#post1879321

for a Fantasy / SciFi enthusiast 3D is still a topic, even when some people frown on it as on Micro-Plastic...
arrgh is offline   Reply With Quote
Old 6th October 2019, 13:02   #473  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 3,873
Quote:
Originally Posted by Liisachan View Post
Thus the original question: what should I type after --attachment-mime-type when attaching a TTF: "font/sfnt" as seen on Mac, "font/ttf" as in RFC, or actually "application/x-truetype-font" after all?
mkvmerge doesn't detect MIME types itself. It uses the widely used "libmagic" from the "file" project. Waaaay back when "libmagic" used to return "application/…" for fonts. Then one day they switched to "font/…". That was sometime in 2011, and it didn't go down well with users (see bug 682[1]) as their programs weren't ready for "font/…". Therefore I implemented a workaround in mkvmerge in v5.2.0 which manually mapped "font/…" back to "application/…".

However, that was quite a long time ago. I don't think there's a definitive answer at the moment, though, as I'm not aware of any research/comparison of application wrt. them supporting "font/…". We would all benefit from a comprehensive test of all known implementations that support fonts in Matroska; try using both MIME types and create a mapping which implementation support which MIME type.

My gut feeling would be that there are still implementations out there that don't support "font/…", but I don't have any evidence for it.

Edit: Depending on the result I would definitely change MKVToolNix' default back to "font/…"; maybe make it configurable in the GUI for those who'd need backwards compatibility.

[1] Even though GitLab shows that the bug was "opened 4 years ago", that's only the date when I migrated the bug tracker to GitHub (!); the original dates couldn't be kept during that migration. The original bug was filed in 2011.
__________________
Latest MKVToolNix is v47.0.0

If I ever ask you to upload something, please use my file server.

Last edited by Mosu; 6th October 2019 at 13:06.
Mosu is offline   Reply With Quote
Old 6th October 2019, 14:16   #474  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 3,873
MKVToolNix v38.0.0 released

Looks like it's time for MKVToolNix v38, which continues the bug-fixing tradition of previous releases.

There's one minor change wrt. packaging: Boost's Operators header library is now required.

Here are the usual links: the MKVToolNix home page, the Windows installer/portable version & macOS DMG & Linux AppImage and the source code.

The Windows and macOS binaries as well as the Linux AppImage are available already. The other Linux binaries are still being built and will be available over the course of the next couple of hours.

Here are the NEWS since the previous release:

Version 38.0.0 "The Silent Type" 2019-10-06

New features and enhancements
  • mkvextract: chapters, tags & cue sheets will now be written to standard output if no file name is given, same as if "-" is given as the file name.
  • MKVToolNix GUI: job queue: added a new setting in the preferences' "job queue & job status" section that, when enabled, will cause the GUI to remove all output files created by jobs that are either aborted by the user or that end in an error. Implements #2614.

Bug fixes
  • all programs: macOS: fixed file access if the file name (including all path components) contains any Unicode character where NFC (Normalization Form Canonical Composed) and NFD (Normalization Form Canonical Decomposed) differ, e.g. German Umlauts. Fixes #2620.
  • mkvmerge: when splitting by chapters the user can now split by chapters coming from one of the appended files, too. Fixes #2625.
  • mkvmerge: AAC reader: fixed reading codec parameters (channels, sample rate) if a file starts with garbage that includes valid-but-bogus AAC headers. Fixes #2622.
  • MKVToolNix GUI: Hebrew was added to the list of often-used languages so that it can be selected by default again. Fixes #2610.
  • MKVToolNix GUI: when updating the GUI's settings from v37.0.0 or older, the GUI checks if the list of often-used languages equals the built-in list from v36.0.0. If it does, it will be updated to the built-in list changed in v37.0.0. Fixes #2611.

Build system changes
  • Boost's Operators header library is now required.


Have fun
__________________
Latest MKVToolNix is v47.0.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 7th October 2019, 06:34   #475  |  Link
Liisachan
李姗倩 Lǐ Shān Qin
 
Liisachan's Avatar
 
Join Date: Nov 2002
Posts: 1,229
Mosu: thank you very much for your detailed answer/clarification!
Quote:
Originally Posted by Mosu View Post
We would all benefit from a comprehensive test of all known implementations that support fonts in Matroska; try using both MIME types and create a mapping which implementation support which MIME type.
Not a comprehensive test, but a few key facts: Do players support an embedded TTF with the FileMimeType "font/" on Windows?
  • The latest version of MPC-BE (v1.5.3 @ 2019-04-01): NO
  • The latest (final) official version of MPC-HC (v1.7.13): NO
  • The latest unofficial version of MPC-HC (clsid2 builds): YES
  • zoomplayer: NO (according to my friend)

Those players marked NO do support an embedded TTF with the FileMimeType "application/x-truetype-font". So your gut feeling seems correct (e.g. MPC-BE from April 2019 does not support "font/"). I'd say it's still too early to migrate to "font/".

As a side note, it seems that when you mux a file on Mac, "font/sfnt" is used by default for TTF and "application/vnd.ms-opentype" for OTF; which is less than ideal even if one prefers "font/". RFC says, Use of "font/sfnt" is likely to be rare in practice. I.e. if you do use "font/", "font/ttf" should be used for TTF, not "font/sfnt"; and "font/otf" should be used for OTF, not "application/vnd.ms-opentype".
Liisachan is offline   Reply With Quote
Old 7th October 2019, 07:26   #476  |  Link
Aleksoid1978
Registered User
 
Aleksoid1978's Avatar
 
Join Date: Apr 2008
Location: Russia, Vladivostok
Posts: 2,352
Quote:
Originally Posted by Liisachan View Post
Mosu: thank you very much for your detailed answer/clarification!


Not a comprehensive test, but a few key facts: Do players support an embedded TTF with the FileMimeType "font/" on Windows?
  • The latest version of MPC-BE (v1.5.3 @ 2019-04-01): NO
  • The latest (final) official version of MPC-HC (v1.7.13): NO
  • The latest unofficial version of MPC-HC (clsid2 builds): YES
  • zoomplayer: NO (according to my friend)

Those players marked NO do support an embedded TTF with the FileMimeType "application/x-truetype-font". So your gut feeling seems correct (e.g. MPC-BE from April 2019 does not support "font/"). I'd say it's still too early to migrate to "font/".

As a side note, it seems that when you mux a file on Mac, "font/sfnt" is used by default for TTF and "application/vnd.ms-opentype" for OTF; which is less than ideal even if one prefers "font/". RFC says, Use of "font/sfnt" is likely to be rare in practice. I.e. if you do use "font/", "font/ttf" should be used for TTF, not "font/sfnt"; and "font/otf" should be used for OTF, not "application/vnd.ms-opentype".
Upload short samples with "font/" mime type - i check and add support in MPC-BE.
__________________
I7 2600K@4.2 /Asrock P67 Extreme4 Gen 3 /Kingston HyperX 8Gb 1866 (4x2) Kit /OCZ Vertex 3 256Gb /Gigabyte GTX 960 /BenQ EW2430 /LG 47LM620T /Yamaha RX-V471 + NS-555 + NS-C444 + NS-333 + YST-SW215
Aleksoid1978 is offline   Reply With Quote
Old 7th October 2019, 08:11   #477  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 9,929
Quote:
Originally Posted by Liisachan View Post
Not a comprehensive test, but a few key facts: Do players support an embedded TTF with the FileMimeType "font/" on Windows?
  • The latest version of MPC-BE (v1.5.3 @ 2019-04-01): NO
  • The latest (final) official version of MPC-HC (v1.7.13): NO
  • The latest unofficial version of MPC-HC (clsid2 builds): YES
  • zoomplayer: NO (according to my friend)
To be fair, MPC-HC does not actually support these mimetypes, it just has a fallback to look at the file extension of the attachment if its an unrecognized mimetype, and then accept .ttf and .otf files.
I have, however, added support just now for future versions. Software like ZoomPlayer that also uses LAV Filters should automatically inherit this support once its updated accordingly.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 7th October 2019 at 08:20.
nevcairiel is offline   Reply With Quote
Old 7th October 2019, 09:10   #478  |  Link
Mosu
MKVToolNix author
 
Mosu's Avatar
 
Join Date: Sep 2002
Location: Braunschweig, Germany
Posts: 3,873
Thanks!

Quote:
Originally Posted by Liisachan View Post
Not a comprehensive test, but a few key facts: Do players support an embedded TTF with the FileMimeType "font/" on Windows?
  • The latest version of MPC-BE (v1.5.3 @ 2019-04-01): NO
  • The latest (final) official version of MPC-HC (v1.7.13): NO
  • The latest unofficial version of MPC-HC (clsid2 builds): YES
  • zoomplayer: NO (according to my friend)
Yikes, that's bad but not entirely unexpected. This is the usual situation in which there is a solution that is "good enough" and where nothing much will change without a lot of (outside) pressure. In this case such pressure might be all applications creating Matroska files only using "font/". However, that won't fly with users who'll rightfully complain that their newly created files don't work as expected.

Catch 22, once more.

Great to hear that both Aleksoid1978 and nevcairiel will add support for "font/".
__________________
Latest MKVToolNix is v47.0.0

If I ever ask you to upload something, please use my file server.
Mosu is offline   Reply With Quote
Old 7th October 2019, 09:50   #479  |  Link
Liisachan
李姗倩 Lǐ Shān Qin
 
Liisachan's Avatar
 
Join Date: Nov 2002
Posts: 1,229
Quote:
Originally Posted by Aleksoid1978 View Post
Upload short samples with "font/" mime type - i check and add support in MPC-BE.
fonts_embedded.mkv (268 KiB, 10 sec), testing four different FileMimeType values:
Test1 font/ttf
Test2 font/sfnt
Test3 application/font-sfnt
Test4 font/otf

Ideally, something like this is shown:

Above = hardsubbed
Below = softsubbed <-- check this
(PNG)
Liisachan is offline   Reply With Quote
Old 7th October 2019, 11:12   #480  |  Link
Aleksoid1978
Registered User
 
Aleksoid1978's Avatar
 
Join Date: Apr 2008
Location: Russia, Vladivostok
Posts: 2,352
Quote:
Originally Posted by Liisachan View Post
fonts_embedded.mkv (268 KiB, 10 sec), testing four different FileMimeType values:
Test1 font/ttf
Test2 font/sfnt
Test3 application/font-sfnt
Test4 font/otf

Ideally, something like this is shown:

Above = hardsubbed
Below = softsubbed <-- check this
(PNG)

It is interesting - who and why come up with different names for the same types.
What diff font/sfnt & application/font-sfnt ??

P.S. Do you have spec for new font/ mime types ?
__________________
I7 2600K@4.2 /Asrock P67 Extreme4 Gen 3 /Kingston HyperX 8Gb 1866 (4x2) Kit /OCZ Vertex 3 256Gb /Gigabyte GTX 960 /BenQ EW2430 /LG 47LM620T /Yamaha RX-V471 + NS-555 + NS-C444 + NS-333 + YST-SW215

Last edited by Aleksoid1978; 7th October 2019 at 11:28.
Aleksoid1978 is offline   Reply With Quote
Reply

Tags
matroska

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.