makemkvcon mkv -- title IDs confused with internal index IDs

Discussion of advanced MakeMKV functionality, expert mode, conversion profiles
Post Reply
jvanns
Posts: 5
Joined: Sun May 18, 2014 6:22 pm

makemkvcon mkv -- title IDs confused with internal index IDs

Post by jvanns »

Hi. It seems that when I specify a title id, makemkvcon either considers it it's own internal index or it re-writes title ids depending on it's selection criteria (e.g. titles < 5mins are dropped and the title ids change).

Could someone confirm this independently? My example is a disc with 8 titles on and if I specify titles 3-8 inclusive, makemkvcon actually copies (or tries to) the titles with an *index* of 3-7 as output by the 'makemkvcon info' command - despite that same command also identifying the correct title IDs.

A simpler example is actually where I specify title 2 which makemkvcon info recognises as having a length of 3 hours yet when I supply 2 as the title ID to copy ala 'mkv' sub-command it actually rips index 2 which has a length of 30 minutes.

This happens with more than 1 disc from different, independent TV show box sets from different broadcast companies.

.... or am I going bat-shit crazy!?
CA Opa
Posts: 6
Joined: Thu Nov 09, 2023 2:12 am

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by CA Opa »

I can confirm that <title id> does not correspond to the listed Title #number. It appears that the <title id> is related to titles added that meet the minimum length specified,
such as --minlength=1600 in this example. So from the example below Title #5 becomes <title id> 0 and Title #12 becomes <title id> 1

Title #3 has length of 26 seconds which is less than minimum title length of 1600 seconds and was therefore skipped
Title #4 has length of 14 seconds which is less than minimum title length of 1600 seconds and was therefore skipped
Title #5 was added (12 cell(s), 0:32:45)
Title #6 has length of 694 seconds which is less than minimum title length of 1600 seconds and was therefore skipped
Title #7 has length of 319 seconds which is less than minimum title length of 1600 seconds and was therefore skipped
Title #8 has length of 267 seconds which is less than minimum title length of 1600 seconds and was therefore skipped
Title #9 has length of 324 seconds which is less than minimum title length of 1600 seconds and was therefore skipped
Title #10 has length of 359 seconds which is less than minimum title length of 1600 seconds and was therefore skipped
Title #12 was added (22 cell(s), 1:36:01)
Title #14 has length of 779 seconds which is less than minimum title length of 1600 seconds and was therefore skipped
Title #15 has length of 179 seconds which is less than minimum title length of 1600 seconds and was therefore skipped

This pretty much makes using a <title id> worthless. You can never predict which title will be selected. Very frustrating.
If anyone can offer commands to make it possible to select the correct Title # I would like to see it.
flojo
Posts: 57
Joined: Thu Jun 22, 2023 4:27 am
Location: El Paso

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by flojo »

jvanns wrote:
Wed Jun 04, 2014 7:24 pm
I supply 2 as the title ID to copy ala 'mkv' sub-command it actually rips index 2
Do you mean it's an off-by-1 error? If instead of '2' you use '3' do you get the correct result?
CA Opa wrote:
Thu Nov 09, 2023 2:31 am
You can never predict which title will be selected.
Is there no way to parse for the string "added" before hand? If not, you could start the process then send SIGINT. Clearly that's dirty, but should work. Could you equally rip based on playlist.mpls?
CA Opa
Posts: 6
Joined: Thu Nov 09, 2023 2:12 am

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by CA Opa »

Just to elaborate what I am doing. I'm on Windows working with a DOS Batch file. I want to find the Main Title and rip it. I don't know how to do that with makemkvcon64. So I use Handbrake cli and scan the ISO to a file. I parse the scanned file to find the Main Title index number. I tried using the index number with makemkvcon64 but the result is not what I expected. After much trial and error with title length I realized that makemkvcon64 only considers the titles added and counts them starting from 0. I tried setting a title length of 0 hoping all titles would be added. Then my desired index number minus 1 would match makemkvcon64 id number. That failed because any title that has 0 length is not added and creates an error.
Since my last post I decided to work with the Main Title length, parse the Handbrake scan for the Main Title length and use it with makemkvcon64. That seems to work but I am finding that the title lengths between the handbrake scan and makemkvcon64 differ. So I am subtracting 20 seconds from Handbrake's Main Title length. Now the Main Title gets added first by makemkvcon64 and I use title id 0 to rip the desired title.
This is a lot of gymnastics. There may be a more straight forward way but I have not found any complete documentation for makemkvcon. If there is a document site or Wiki for makemkvcon please let me know.
flojo
Posts: 57
Joined: Thu Jun 22, 2023 4:27 am
Location: El Paso

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by flojo »

CA Opa wrote:
Thu Nov 09, 2023 6:09 pm
So I use Handbrake cli and scan the ISO to a file. I parse the scanned file to find the Main Title index number.
Can you post this scanned file here in a codebox?
CA Opa
Posts: 6
Joined: Thu Nov 09, 2023 2:12 am

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by CA Opa »

I am new to this forum. How do I post a file in a codebox?
d00zah
Posts: 1414
Joined: Mon Jun 06, 2016 8:23 pm

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by d00zah »

CA Opa wrote:
Fri Nov 10, 2023 4:36 am
I am new to this forum. How do I post a file in a codebox?
Highlight to text you wish to appear in a "codebox" & then select the '</>' (5th from left) icon above the editor window.
Woodstock
Posts: 9914
Joined: Sun Jul 24, 2011 11:21 pm

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by Woodstock »

You post the code inside a pair of [code][/code] tags, as in:

[code]
Stuff to output
[/code]
CA Opa
Posts: 6
Joined: Thu Nov 09, 2023 2:12 am

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by CA Opa »

Below is the output from a Handbrake ISO scan using a " --min-duration 1800" (30 minutes).
Using makemkvcon64 "--minlength=1800" Title #5 becomes <title id> 0 and Title #12 becomes <title id> 1.
If I use makemkvcon64 "--minlength=5,751" (20 seconds less than Feature length 1:36:11) Title #12 becomes <title id> 0.
Parsing the scanned file tells me the Main Feature is Title index 12 with a 5771 second duration.

To rip the Main Feature of this ISO I use this command:
makemkvcon64 --minlength=5,751 mkv iso:"Z:\Movie ISOs\THE_BOXTROLLS.ISO" 0 "G:\MakeMkv\THE_BOXTROLLS"

Code: Select all

[11:07:22] Compile-time hardening features are enabled
Cannot load nvEncodeAPI64.dll
Cannot load nvEncodeAPI64.dll
Cannot load nvEncodeAPI64.dll
Cannot load nvEncodeAPI64.dll
[11:07:22] hb_init: starting libhb thread
[11:07:22] thread 1 started ("libhb")
HandBrake 1.5.1 (2022011000) - MinGW x86_64 - https://handbrake.fr
20 CPUs detected
Opening Z:\Movie ISOs\THE_BOXTROLLS.ISO...
[11:07:22] CPU: 12th Gen Intel(R) Core(TM) i7-12700K
[11:07:22]  - logical processor count: 20
[11:07:22] Intel Quick Sync Video support: yes, gpu list: 0
[11:07:22] Intel Quick Sync Video integrated adapter with index 0
[11:07:22]  - Intel Media SDK hardware: API 1.255 (minimum: 1.3)
[11:07:22]  - Decode support:  h264 hevc (8bit: yes, 10bit: yes) av1 (8bit: yes, 10bit: yes)
[11:07:22]  - H.264 encoder: yes
[11:07:22]     - preferred implementation: hardware (1) via D3D11
[11:07:22]     - capabilities (hardware):  breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[11:07:22]  - H.265 encoder: yes (8bit: yes, 10bit: yes)
[11:07:22]     - preferred implementation: hardware (1) via D3D11
[11:07:22]     - capabilities (hardware):  lowpower bpyramid icq vsinfo opt1
[11:07:22] hb_scan: path=Z:\Movie ISOs\THE_BOXTROLLS.ISO, title_index=0
src/libbluray/disc/disc.c:437: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:437: error opening file BDMV\BACKUP\index.bdmv
src/libbluray/bluray.c:2646: nav_get_title_list((null)) failed
[11:07:22] bd: not a bd - trying as a stream/file instead
libdvdread: Encrypted DVD support unavailable.
libdvdnav: DVD Title: THE_BOXTROLLS
libdvdnav: DVD Serial Number: 456c8062
libdvdnav: DVD Title (Alternative): R2
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 01 02 03 04 05 06 07 08
libdvdread: Encrypted DVD support unavailable.
[11:07:22] scan: DVD has 29 title(s)
[11:07:22] scan: scanning title 1
[11:07:22] scan: duration is 00:00:00 (533 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 2
[11:07:22] scan: duration is 00:00:00 (533 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 3
[11:07:22] scan: duration is 00:00:26 (26133 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 4
[11:07:22] scan: duration is 00:00:14 (14200 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 5
[11:07:22] scan: duration is 00:32:50 (1970500 ms)
[11:07:22] pgc_id: 1, pgn: 1: pgc: 0000000006a13850
[11:07:22] scan: checking audio 1
[11:07:22] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[11:07:22] scan: checking subtitle 1
[11:07:22] scan: id=0x20bd, lang=English (Wide Screen) [VOBSUB], 3cc=eng ext=0
[11:07:22] scan: checking subtitle 2
[11:07:22] scan: id=0x21bd, lang=espa ol (Wide Screen) [VOBSUB], 3cc=spa ext=0
[11:07:22] scan: checking subtitle 3
[11:07:22] scan: id=0x22bd, lang=Francais (Wide Screen) [VOBSUB], 3cc=fra ext=0
[11:07:22] scan: title 5 has 6 chapters
[11:07:22] scan: chap 1, 694133 ms
[11:07:22] scan: chap 2, 320401 ms
[11:07:22] scan: chap 3, 267367 ms
[11:07:22] scan: chap 4, 324933 ms
[11:07:22] scan: chap 5, 363132 ms
[11:07:22] scan: chap 6, 533 ms
[11:07:22] scan: aspect = 16:9
[11:07:22] scan: scanning title 6
[11:07:22] scan: duration is 00:11:34 (694700 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 7
[11:07:22] scan: duration is 00:05:19 (319500 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 8
[11:07:22] scan: duration is 00:04:27 (267367 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 9
[11:07:22] scan: duration is 00:05:24 (324533 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 10
[11:07:22] scan: duration is 00:05:59 (359667 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 11
[11:07:22] scan: duration is 00:00:00 (533 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 12
[11:07:22] scan: duration is 01:36:11 (5771467 ms)
[11:07:22] pgc_id: 1, pgn: 1: pgc: 0000000006a13850
[11:07:22] scan: checking audio 1
[11:07:22] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[11:07:22] scan: checking audio 2
[11:07:22] scan: id=0x81bd, lang=espa ol (AC3), 3cc=spa ext=0
[11:07:22] scan: checking audio 3
[11:07:22] scan: id=0x82bd, lang=Francais (AC3), 3cc=fra ext=0
[11:07:22] scan: checking audio 4
[11:07:22] scan: id=0x83bd, lang=English (AC3), 3cc=eng ext=3
[11:07:22] scan: checking subtitle 1
[11:07:22] scan: id=0x20bd, lang=English (Wide Screen) [VOBSUB], 3cc=eng ext=0
[11:07:22] scan: checking subtitle 2
[11:07:22] scan: id=0x21bd, lang=espa ol (Wide Screen) [VOBSUB], 3cc=spa ext=0
[11:07:22] scan: checking subtitle 3
[11:07:22] scan: id=0x22bd, lang=Francais (Wide Screen) [VOBSUB], 3cc=fra ext=0
[11:07:22] scan: checking subtitle 4
[11:07:22] scan: id=0x23bd, lang=espa ol (Wide Screen) [VOBSUB], 3cc=spa ext=0
[11:07:22] scan: checking subtitle 5
[11:07:22] scan: id=0x24bd, lang=Francais (Wide Screen) [VOBSUB], 3cc=fra ext=0
[11:07:22] scan: title 12 has 21 chapters
[11:07:22] scan: chap 1, 351867 ms
[11:07:22] scan: chap 2, 360700 ms
[11:07:22] scan: chap 3, 207834 ms
[11:07:22] scan: chap 4, 301300 ms
[11:07:22] scan: chap 5, 405166 ms
[11:07:22] scan: chap 6, 317133 ms
[11:07:22] scan: chap 7, 240333 ms
[11:07:22] scan: chap 8, 319233 ms
[11:07:22] scan: chap 9, 238966 ms
[11:07:22] scan: chap 10, 371633 ms
[11:07:22] scan: chap 11, 242700 ms
[11:07:22] scan: chap 12, 363300 ms
[11:07:22] scan: chap 13, 322000 ms
[11:07:22] scan: chap 14, 241500 ms
[11:07:22] scan: chap 15, 299700 ms
[11:07:22] scan: chap 16, 337367 ms
[11:07:22] scan: chap 17, 204500 ms
[11:07:22] scan: chap 18, 122767 ms
[11:07:22] scan: chap 19, 147367 ms
[11:07:22] scan: chap 20, 375567 ms
[11:07:22] scan: chap 21, 533 ms
[11:07:22] scan: aspect = 16:9
[11:07:22] scan: scanning title 13
[11:07:22] scan: duration is 00:00:00 (533 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 14
[11:07:22] scan: duration is 00:12:59 (779533 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 15
[11:07:22] scan: duration is 00:02:59 (179033 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 16
[11:07:22] scan: duration is 00:02:50 (170133 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 17
[11:07:22] scan: duration is 00:02:58 (178800 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 18
[11:07:22] scan: duration is 00:02:00 (120567 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 19
[11:07:22] scan: duration is 00:02:29 (149367 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 20
[11:07:22] scan: duration is 00:00:00 (533 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 21
[11:07:22] scan: duration is 00:00:00 (533 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 22
[11:07:22] scan: duration is 00:03:11 (191600 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 23
[11:07:22] scan: duration is 00:00:32 (32567 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 24
[11:07:22] scan: duration is 00:00:48 (48567 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 25
[11:07:22] scan: duration is 00:00:32 (32567 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 26
[11:07:22] scan: duration is 00:00:31 (31567 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 27
[11:07:22] scan: duration is 00:01:41 (101567 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 28
[11:07:22] scan: duration is 00:04:38 (278700 ms)
[11:07:22] scan: ignoring title (too short)
[11:07:22] scan: scanning title 29
[11:07:22] scan: duration is 00:00:34 (34533 ms)
[11:07:22] scan: ignoring title (too short)
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 01 02 03 04 05 06 07 08

Scanning title 29 of 29, 50.00 %[11:07:22] scan: decoding previews for title 5
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 01 02 03 04 05 06 07 08
[11:07:22] scan: title angle(s) 1
[11:07:22] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch) (192 kbps)
[11:07:22] scan: 10 previews, 720x480, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 32:27, color profile: 6-1-6, chroma location: left
[11:07:22] scan: decoding previews for title 12
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 01 02 03 04 05 06 07 08
[11:07:22] scan: title angle(s) 1

Scanning title 2 of 2, preview 1, 77.50 %[11:07:22] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch) (448 kbps)
[11:07:22] scan: audio 0x81bd: ac3, rate=48000Hz, bitrate=384000 espa ol (AC3) (5.1 ch) (384 kbps)
[11:07:22] scan: audio 0x82bd: ac3, rate=48000Hz, bitrate=384000 Francais (AC3) (5.1 ch) (384 kbps)
[11:07:22] scan: audio 0x83bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (Director's Commentary 1) (2.0 ch) (Dolby Surround) (192 kbps)
[11:07:23] scan: 10 previews, 720x480, 23.976 fps, autocrop = 0/2/0/0, aspect 16:9, PAR 32:27, color profile: 6-1-6, chroma location: left

Scanning title 2 of 2, preview 10, 100.00 %[11:07:23] libhb: scan thread found 2 valid title(s)
Searching for main feature title...
 + Title (0) index 5 has length 1970sec
 + Title (1) index 12 has length 5771sec
Found main feature title 12
+ title 5:
  + index 5
  + duration: 00:32:50
  + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: duration 00:11:34
    + 2: duration 00:05:20
    + 3: duration 00:04:27
    + 4: duration 00:05:25
    + 5: duration 00:06:03
    + 6: duration 00:00:01
  + audio tracks:
    + 1, English (AC3) (2.0 ch) (192 kbps) (iso639-2: eng), 48000Hz, 192000bps
  + subtitle tracks:
    + 1, English (Wide Screen) [VOBSUB]
    + 2, español (Wide Screen) [VOBSUB]
    + 3, Francais (Wide Screen) [VOBSUB]
+ title 12:
  + Main Feature
  + index 12
  + duration: 01:36:11
  + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 23.976 fps
  + autocrop: 0/2/0/0
  + chapters:
    + 1: duration 00:05:52
    + 2: duration 00:06:01
    + 3: duration 00:03:28
    + 4: duration 00:05:01
    + 5: duration 00:06:45
    + 6: duration 00:05:17
    + 7: duration 00:04:00
    + 8: duration 00:05:19
    + 9: duration 00:03:59
    + 10: duration 00:06:12
    + 11: duration 00:04:03
    + 12: duration 00:06:03
    + 13: duration 00:05:22
    + 14: duration 00:04:02
    + 15: duration 00:05:00
    + 16: duration 00:05:37
    + 17: duration 00:03:25
    + 18: duration 00:02:03
    + 19: duration 00:02:27
    + 20: duration 00:06:16
    + 21: duration 00:00:01
  + audio tracks:
    + 1, English (AC3) (5.1 ch) (448 kbps) (iso639-2: eng), 48000Hz, 448000bps
    + 2, español (AC3) (5.1 ch) (384 kbps) (iso639-2: spa), 48000Hz, 384000bps
    + 3, Francais (AC3) (5.1 ch) (384 kbps) (iso639-2: fra), 48000Hz, 384000bps
    + 4, English (AC3) (Director's Commentary 1) (2.0 ch) (Dolby Surround) (192 kbps) (iso639-2: eng), 48000Hz, 192000bps
  + subtitle tracks:
    + 1, English (Wide Screen) [VOBSUB]
    + 2, español (Wide Screen) [VOBSUB]
    + 3, Francais (Wide Screen) [VOBSUB]
    + 4, español (Wide Screen) [VOBSUB]
    + 5, Francais (Wide Screen) [VOBSUB]

HandBrake has exited.
flojo
Posts: 57
Joined: Thu Jun 22, 2023 4:27 am
Location: El Paso

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by flojo »

First, is there not a file/playlist that marks the main title? Do you really have to comb for the longest timestamp?

Anyways, to verify match the handbrake output of...

Code: Select all

  + Main Feature
  + index 12
... to the output of makemkvcon's.

Code: Select all

Title #12 was added (22 cell(s), 1:36:01)
Since you have it working, I'm now kind of confused on what you want to do :-/. I will say though that makemkvcon has inconsistencies. Here is the usage: https://www.makemkv.com/developers/usage.txt
Also read this thread as well, in particular the last post: viewtopic.php?f=17&t=31557&p=139088&hil ... on#p139088
Also, the "info" option prints more information with the -r switch, which isn't documented. It seems makemkvcon is explicitly programmed to output for the GUI's usage and not for independent usage.

Anyways, I'm guessing because I don't rip to mkv, but this should work...

Code: Select all

./makemkvcon mkv disc:0 $title_num $HOME/output/
... where $title_num is the problematic number :-/ (12? 0? 1?...?). I don't own a plain DVD anymore but I'll pick one up at thrift store and join in your pain for a little bit.
CA Opa
Posts: 6
Joined: Thu Nov 09, 2023 2:12 am

Re: makemkvcon mkv -- title IDs confused with internal index IDs

Post by CA Opa »

I tried your suggestion with this:

Code: Select all

"C:\Program Files (x86)\MakeMKV\makemkvcon64.exe" mkv disc:0 1 "G:\MakeMkv"
And I got this with no movie ripped:

Code: Select all

MakeMKV v1.17.5 win(x64-release) started
Using direct disc access mode
Title #1 was added (15 cell(s), 1:12:49)
Operation successfully completed
However this worked:

Code: Select all

"C:\Program Files (x86)\MakeMKV\makemkvcon64.exe" mkv disc:0 0 "G:\MakeMkv"
So using the Title #1 fails and you have to figure out the number of titles added and start counting from 0
Post Reply