[RESOLVED] MKV demux support

Support forum for DGDecNV
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Re: Feature Requests

Post by Guest 2 »

admin wrote:
Tue Feb 20, 2018 6:37 am
Thank you, gents. I'll start with SSA/ASS. I am able to make my own sample files with different subtitle types so there's no need for you to provide samples.
With attached fonts too? :bow:
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

No. You can feel free to give me any samples you like.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Re: Feature Requests

Post by Guest 2 »

admin wrote:
Tue Feb 20, 2018 10:53 am
Alright gents, start your engines. Here is a test version supporting SRT and SSA in MKV.
  • SRT extraction finishes after Finished! is shown in toolbox.
  • sometimes SRT are not extracted at all, truncated or bit for bit different from MKVTools extracted ones
Please, more than name to the stream and channel number, add language, description and delay if present.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Re: Feature Requests

Post by Guest 2 »

admin wrote:
Tue Feb 20, 2018 1:05 pm
No. You can feel free to give me any samples you like.
Tom I will.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Who is Tom? :lol:

I'm aware of the "Finished" coming too early and will fix that. The only reason I can think of for missing or truncated SRTs is that you exit DGIndexNV right after seeing "Finished" and before the demuxing thread is complete. Good to see you are on your toes with the testing. ;)
DAE avatar
Sharc
Posts: 233
Joined: Thu Sep 23, 2010 1:53 pm

Re: Feature Requests

Post by Sharc »

Just a huge THANK YOU Donald for your ongoing development of DGDecNV and for keeping the forum alive!

Greetings
Sharc
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

My pleasure Sharc. Encouragement and support from you guys and gals is the food that nourishes my coding soul.

@Guest 2

I have the "Finished" issue fixed locally. For now please just don't exit DGIndexNV until all the SRTs are done. If doing that you still see some issues please report. One case I do know where the output differs from mkvextract is for SSA. mkvextract erroneously sets Mark=0 for all events. I print the correct value from the event blocks. Another case, again for SSA, mkvextract omits a blank line (which is coded in the stream), but it appears to be insignificant. If you see any other unexpected differences please report. I have not seen any differences for the SRTs I have looked at. Thank you.

BTW, the demuxed subtitles honor the project range.

EDIT: Guest 2.zip refreshed with the "Finished" fix.
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Thanks for the continuous improvements and upgrades
Can hardly wait for the PGS subtitle section
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Hmm, PGS. That may be a tough one. We'll see. Do you have a sample for me please? I found one on the web but mkvextract just produces garbage where I was expecting a nice image file or something. Anybody know anything about this? A general google search shows people asking how to demux PGS and I did not see a definitive answer. So help me out!

EDIT: Possible solution here:

http://www.makemkv.com/forum2/viewtopic.php?f=1&t=808

The process seems rather unwieldy.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: Feature Requests

Post by jpsdr »

I don't know if font can be extracted (don't remember anything in mkvextract)... :scratch:
The only thing i know, is that font can be embended with the ASS/MKV in two ways :
- Either "external", you add the font with mkvtoolnix in the third panel (probably "attachment" in english).
- Or... i've discovered this ultra very recently, the font can be within the ASS. Yes, you can have within the ASS file a [Font] tag/section, with the data in some kind of binary/text format.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Thanks for the info, jp. My work is driven by the sample files I receive, so...
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: Feature Requests

Post by jpsdr »

Maybe you can create you own mkv with pgs this way :
From any m2ts (principal movie file with subtitles) Blu-Ray you have, extract the PGS with eac3to.
Command line would be something like this (if track 15 is a subtitle) :
eac3to 00000.m2ts 15: C:\Movie.sup
Then, create an mkv with mkvtoolnix muxing this sup inside. This way, you are sure to have a proper mkv.
To simply open sup file you have BDSup2sub, or SubtitleEdit.

It's past midnight for me now, so right now, direct to bed, i don't have time to prepare anything.
But, if tomorrow evening (leaving almost 24h), nobody provide you anything, i'll see if i can provide you things helping others.

Must confess, personnaly, i use eac3to to extract audio/PGS, and aegisub to extract ASS if necessary...
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Ok, thanks, I'll have a go at it. It would still be great to get samples, just to be sure.
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

admin wrote:
Tue Feb 20, 2018 4:55 pm
Hmm, PGS. That may be a tough one. We'll see. Do you have a sample for me please? I found one on the web but mkvextract just produces garbage where I was expecting a nice image file or something. Anybody know anything about this? A general google search shows people asking how to demux PGS and I did not see a definitive answer. So help me out!

EDIT: Possible solution here:

http://www.makemkv.com/forum2/viewtopic.php?f=1&t=808

The process seems rather unwieldy.
That process appears to involve more than extracting
I was referring to simple extraction
How many test clips, and how long do you need, want?
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

One or a few clips will be fine. Length is not that important but need enough for multiple subtitles. Bandwidth is cheap now. ;)

I would aim to emulate mkvextract and produce just a sup file. From there it's up to you.
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

I'll start uploading now
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

:hat:

I've refreshed Guest 2.zip with the "Finished" fix, so please re-download and update.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

I found one stream with PGS in my streams database (collected over the years). The codec ID reported by gMKVExtractGUI is S_HDMV/PGS and it extracts to a sup file. Still, the more streams the better.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

I can't figure out from inspection how the MKV's S_HDMV/PGS blocks translate to the SUP file contents. I'll have to look at the source code for mkvextract to see what is going on. Tomorrow, or should I say Tom?
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Tom?
How about Dick and Harry
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

I'm close to having PGS working. The first big thing was that the data is zlib compressed in the MKV, so I had to enable zlib support in the matroska code and build zlib for windows, etc. That seems to be working as I can see proper PGS segment data now after decompressing the MKV blocks. Now working on parsing out the blocks to a SUP file.

Before finishing that, though, I am going to slipstream the Guest 2.zip version.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: Feature Requests

Post by jpsdr »

Do you mean you've until now handle mkv without zlib support ?
You're lucky, because in the mkv spec, you can choose to compress any steam, should it be audio, video or anything else.
Practical use, compressing audio and video give no benefit, so, in mkvtoolnix, default setting is to not compress audio/video, and compress others things like subtitles. Personnaly, i deactivate all compressions, because even if it's in mkv spec, some hardware players may not like it.
So, if we are talking about the compression that can be enable when merging mkv, it means :
- Audio and video can also be compressed.
- PGS are not always compressed.
Unless... I'm mistaken/mixing things... And the compression of mkv stream is automaticaly handled by your mkv parser, and zlib compressed is something within the specs of PGS ? (Like PNG, you can have uncompressed or zlib compressed data for the picture, but it's within the PNG spec).

Edit :
Looking again at mkvtoolnix gui, in it, you can just choose to enable/disable compression for subtitles. There was once, if my memory is not tricking me, in gui option, the possibility to choose something like : "compress all", "compress just subtitles", "compress nothing". I don't know if the change is just within the gui, but compress all streams is still possible (means still within specs) using advanced command line mode, or if specs have changed and compression of audio and video is not possible anymore.

Edit 2:
And, if again my memory is still not tricking me, there was also the possibility to choose what kind of compression (there was 2 or 3 possibilities, zlib was one of them). So, i don't know if the mkv specs had some "uncertain/unstable" period and have changed to something more restrictive, or if there is still all these possibilties, even if they're almost never used...
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

I wouldn't call it lucky. Previously I supported only video and audio and never encountered an MKV with zlib compression enabled for video or audio, which as you say would make little sense even if it is possible. So there was no need for the zlib support until now.

Yes, I need to honor whether the streams are compressed or not. It's signaled in the MKV obviously.

I have not seen any compression other than zlib, and the MKV library code from Mike :bow: supports only zlib, so I will support only zlib for now, keeping open the option to revisit that.
User avatar
admin
Posts: 4551
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

I slipstreamed the last Guest 2.zip changes as slipstream 125. Thus Guest 2.zip has been deleted.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: Feature Requests

Post by jpsdr »

admin wrote:
Thu Feb 22, 2018 7:14 am
Yes, I need to honor whether the streams are compressed or not, it's signaled in the MKV obviously.
Do you know by any chance if it's only zlib, or if there is also others compression format that can legaly be used ?
The fact that i remember (properly or not...?) once a gui where you can choose compression format is still bugging me... :?
Post Reply