[RESOLVED] MKV demux support

Support forum for DGDecNV
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Fixed a bug, please re-download.

The bug: if a track is present but there are no actual frames present for that track (due to cutting) then dgmkvextract would crash. Now, I simply do not generate an output file for such tracks. gMKVExtractGUI creates an empty file.

I also fixed a crash when the MKV file is not specified, and made it a tiny bit faster by masking the video track.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Re: Feature Requests

Post by Guest 2 »

admin wrote:
Fri Mar 02, 2018 11:15 am
Elapsed time for the full Wonder Woman blu-ray is 15 seconds. gMKVExtractGUI took 20 seconds.
O-M-G. You did such a great job... and what storage subsystem you have?!? I thought mine was fast but yours is smoking.

I did some tests on Murder on the Orient Express and the results follows:

dgmkvextract.exe 1:50
gMKVExtractGUI 1:07

Audio are bit per bit identical.

There is a minor bug on srt, i.e. on forced ones there are jumps on subs numbers, for example:

gMKVExtractGUI output:

Code: Select all

1
00:00:47,423 --> 00:00:52,094
ASSASSINIO SULL'ORIENT EXPRESS

2
00:01:13,157 --> 00:01:16,953
Il Muro del Pianto, Gerusalemme
1934

3
00:03:42,640 --> 00:03:43,808
Così va meglio.

4
00:07:09,221 --> 00:07:10,389
Molto bene, signore.

5
00:18:02,290 --> 00:18:03,500
Ah, numero tre.

6
00:18:04,709 --> 00:18:06,586
Lei è il sig. MacQueen?
dgmkvextract.exe output:

Code: Select all

2
00:00:47,423 --> 00:00:52,094
ASSASSINIO SULL'ORIENT EXPRESS

6
00:01:13,157 --> 00:01:16,953
Il Muro del Pianto, Gerusalemme
1934

52
00:03:42,640 --> 00:03:43,808
Così va meglio.

168
00:07:09,221 --> 00:07:10,389
Molto bene, signore.

605
00:18:02,290 --> 00:18:03,500
Ah, numero tre.

609
00:18:04,709 --> 00:18:06,586
Lei è il sig. MacQueen?
I want to ask you also how you honor the delay of audio tracks. The best think is to show it in the filename, such as "Assassinio sull'Orient Express_track3_ita_DELAY 1ms.dts" so programs recognize it and know how to handle.

If possibile give the possibility to save output streams to another directory, for benchmark purposes. To be fair I output gMKV on same phisical SDD too.
DAE avatar
jpsdr
Posts: 214
Joined: Tue Sep 21, 2010 4:16 am

Re: Feature Requests

Post by jpsdr »

Nice work. :hat:
And reading this i just discover gMKVExtractGUI... :wow:
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Re: Feature Requests

Post by Guest 2 »

jpsdr wrote:
Sat Mar 03, 2018 4:10 am
And reading this i just discover gMKVExtractGUI... :wow:
We are here to serve :hat:
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Guest 2 wrote:
Sat Mar 03, 2018 3:16 am
admin wrote:
Fri Mar 02, 2018 11:15 am
Elapsed time for the full Wonder Woman blu-ray is 15 seconds. gMKVExtractGUI took 20 seconds.
O-M-G. You did such a great job... and what storage subsystem you have?!? I thought mine was fast but yours is smoking.
Thank you for your testing.

Hmm, my setup is nothing special (even if I do call it "The Beast"):

i7 7700K with 64GB fast memory
Win 10 64-bit
C: (system) is on an SSD
H: (data) is a Hitachi HDD
1080 Ti video (not relevant here)

I have the blu-ray ripped to H: and the MKV is 24GB
I open a cmd window on the H: directory and run dgmkvextract there
so I am reading and writing to the same dir on the HDD
there are 5 ac3's and 7 sup's
completes in ~15 seconds

Of course, to demux doesn't require the entire file to be read, as there are indices, etc. It does seem rather fast. Maybe the disk cache flushing hasn't occurred and completion is signaled but the data is still in OS caches being flushed out to the physical drive. I'm not sure. Is write caching enabled on your drive? Or maybe it is due to my large amount of RAM, such that no swapping occurs and the OS caches can be large.

EDIT: The first run with nothing in the cache may be slower. I don't remember if I had already saved the project once before taking the timing, and as mentioned I have a lot of fast RAM. I could easily hold the entire stream in cache if Windows allows it.
There is a minor bug on srt, i.e. on forced ones there are jumps on subs numbers
Please re-download. Should be fixed.
I want to ask you also how you honor the delay of audio tracks. The best think is to show it in the filename, such as "Assassinio sull'Orient Express_track3_ita_DELAY 1ms.dts" so programs recognize it and know how to handle.
I'll address that as part of the file name improvement.
If possible give the possibility to save output streams to another directory, for benchmark purposes. To be fair I output gMKV on same phisical SDD too.
It's not worth it for this app as it is going away as soon as it is tested and integrated into DGIndexNV. I'm going to start integrating it today.
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

That wasn't so bad. I have it integrated into DGIndexNV with the new Demux dialog, etc. The only thing left to do is to improve the filenames. Gonna take a break for a bath and then I have to do my swim coaching, after which I'll do the filenames and then give you a test version.
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

OK, back from swimming. One of my swimmers missed a state cut by 0.08 seconds at regionals. Oy. Next time!

Here is the first test version of the full MKV demux support. The only thing not done yet is chapters. Although I tried my best, there may be some bugs so please test it thoroughly, including MP4 and CLI -a.

http://rationalqm.us/misc/DGIndexNV_test.exe

As always, your test results will be greatly appreciated.

I am removing dgmkvextract.exe as it is no longer needed.

@Guest 2

I tried to match gMKVExtractGUI file names. There should be no delay on MKV demuxed stuff, so I don't do anything with that. We can revisit it if I am wrong about that.
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Thanks for the testing, gonca!
PCM files are extracted but no file extension is given in the name
Ah yes, I know why without even looking. I'll fix it.
Some Mkvs have delays in the audio so that could be useful, these are lossless remuxes from disk
Yeah, I wondered if there could be a container specified delay. Can you give me a sample? Or tell me how to make one?
SUP files are so far working as expected
Have to find one with forced subs to test
That is invisible to DGIndexNV, should work fine.
EDIT: Forced flags are being retained
Beat me to it. :D

I'm getting wasted right now, so I'll make a new build tomorrow. C'mon, it's Saturday night. :wow: One day I want to share a quality single-malt Scotch with you. You're my kind of guy.
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Oh crud, I seem to have hit edit on your post instead of reply. I'll see if I can repair that.

EDIT: nope, can't fix it as I lost the cached version. Hopefully the quotes will be sufficient. Sorry!
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Its fine, its just looks like I am having a discussion with myself
Gotta get some meds so I stop talking to myself
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

:idea: Lights out! :idea:
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

I know that you are more of a CLI kind of guy
but in the MKVToolNix GUI
Load a mkv
Highlight the audio track
In the options on the right hand side add the delay in the Delay(ms) box under Timestamps
I am uploading a couple of samples right now
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

I added the delay value in the file name and fixed the missing extension for PCM:

http://rationalqm.us/misc/DGIndexNV_test.exe

I show delay for subtitle files too, although I am not sure if it is significant because MediaInfo does not show a delay for subtitle tracks. Anybody know about this?

This is my release candidate so please beat the crap out of it.
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Subtitles
I deal primarily (99.99%) with PGS
I didn't even know they had delays
They are IGS with their own time stamps so I don't know how the delays would be relevant
Later today I will test them to see if it makes a difference
Good work Don
:hat:
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Thanks, gonca.

There is no explicit delay field defined in the Matroska spec. You derive it from the difference between the StartTime of the first video block and the StartTime of the first audio/subtitle block. That makes things ambiguous if the MKV has multiple video tracks, but I have never seen such an MKV in the wild. If I ever do then it would be time to think about what to do. :scratch:

What is "IGS"?
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Interactive Graphics Subsystem
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Demuxing of audio and pgs works as expected.
As to the delay of the pgs
MKVToolNix ignores the delay in the name of the subtitle, which is a good thing
I manually introduced the delay on the name to see the effect
Resulting example
If the delay to the first block was 1000ms, MKVToolNix would add 1000ms to the timestamps of all subtitles resulting in the the first PGS to start at 2000ms

Dolby Vision carries its metadata in a secondary 1080p stream
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Thanks for the explanations.

So everything is good with what I am doing, then?
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

All is good
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

Sweet. Thanks, Luis.

Do you do anything with chapters?
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Not really, I create trimmed m2ts files with DGIndexNV from the main movie mpls
Give me a few minutes and I'll remux a mpls to mkv and check the chapters
Forgot about checking those, sorry about that
DAE avatar
Guest

Re: Feature Requests

Post by Guest »

Does DGIndexNV-test demux the chapters from MKV?
Tried and it didn't give an option for it
Note
All this made me think of a feature request for your consideration after you finish the MKV stuff
User avatar
admin
Posts: 4554
Joined: Thu Sep 09, 2010 3:08 pm

Re: Feature Requests

Post by admin »

No chapter support. I was trying to decide if it is worth it.

Please make your suggestion in the features thread as I have just split the threads. Thanks.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Re: Feature Requests

Post by Guest 2 »

admin wrote:
Sat Mar 03, 2018 5:43 pm
OK, back from swimming.
At 45 to get Divemaster license I have to learn how to swim again and better. Hard but necessary as it will be part of exams.
admin wrote:
Sat Mar 03, 2018 5:43 pm
There should be no delay on MKV demuxed stuff, so I don't do anything with that.
By design? Usually demuxing leaves audio tracks as they are. AFAIK the only way to correct it is to put it back when muxing again, reencoding or trimming in some way.
DAE avatar
Guest 2
Posts: 903
Joined: Mon Sep 20, 2010 2:18 pm

Re: Feature Requests

Post by Guest 2 »

admin wrote:
Sun Mar 04, 2018 6:00 pm
No chapter support. I was trying to decide if it is worth it.
IMHO yes, as we are looking for a GMkv (or similar) alternative.
Post Reply