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 > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th September 2023, 14:29   #1  |  Link
Earthnuker
Registered User
 
Earthnuker's Avatar
 
Join Date: Mar 2021
Location: Germany
Posts: 11
How can i extract DVD Chapter titles using libdvdread or libdvdnav?

Hello everyone,

I am currently working on a cross-platform DVD Ripper built on top of libdvdread and libdvdnav and i have noticed that MakeMKV can extract "proper" chapter names from certain DVDs (Zentrix Volume 1 Disc 1 in this case) which are apparently stored in VIDEO_TS.IFO (see attached screenshot) but have not found a way to get them using VLC's libdvdread or libdvdnav (and opening the ISO in VLC also does not show the chapter names).



If anyone has any pointer towards where i could find more info on how and where they are stored i would greatly appreciate that.

Best regards,

Earthnuker

Last edited by Earthnuker; 24th September 2023 at 16:00.
Earthnuker is offline   Reply With Quote
Old 25th September 2023, 12:59   #2  |  Link
Earthnuker
Registered User
 
Earthnuker's Avatar
 
Join Date: Mar 2021
Location: Germany
Posts: 11
After some messing around with ifoEdit i figured it out:
Code:
- open VIDEO_TS.IFO (DVDOpenFile(handle, 0, dvd_read_domain_t::DVD_READ_INFO_FILE))
- seek to offset 0xd4
- read a 32-bit big endian unsigned integer (U32BE)
- seek to that offset in blocks (offset*2048 in bytes)
- skip 0xc bytes (company ID)
- read number of language units as U32BE
- read end_byte offset as U32BE
- for each language unit
   - read 1 U16BE (language code)
   - skip 6 bytes (unknown)
- for each language unit
   - skip 4 + 2 + 2 + 9 * 20 + 16 = 204 bytes
   - read num_entries as U16BE 
   - skip 2 bytes
   - check if num_entries is even (if not throw error?)
   - divide num_entries by 2 (reserved)
   - for each entry:
      - read entry_type U32LE
      - skip 4 byte (unknown)
- read tab (0x9) separated strings until you've reached position offset+end_byte
entry types seem to be:
- 0x1 for disc
- 0x2 for feature title
- 0x4 for chapter title
- 0x46 for ??? (contians "Spruce0200MenuGPRM03ITag b68" in my case)
__________________
Hack the planet!
Earthnuker is offline   Reply With Quote
Old 25th September 2023, 23:18   #3  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
You may go from there:
http://mpucoder.com/DVD/ifo.html
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 26th September 2023, 07:37   #4  |  Link
Earthnuker
Registered User
 
Earthnuker's Avatar
 
Join Date: Mar 2021
Location: Germany
Posts: 11
Quote:
Originally Posted by Emulgator View Post
You may go from there:
http://mpucoder.com/DVD/ifo.html
I did stumble upon that site during my research, sadly it doesn't contain any info on how the data in the VMG_TXTDT_MG is laid out, so it's not too useful, and all the other data i need is already extracted by libdvdread and libdvdnav
__________________
Hack the planet!
Earthnuker is offline   Reply With Quote
Old 27th September 2023, 12:45   #5  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,379
Hi Earthnuker

That is very interesting and I have never found such info while I wrote my own IFO parser.
Could you imagine to share with me the DVD you had mentioned? Or if the entire DVD is to much, the IFO files would be also helpful.
hubblec4 is offline   Reply With Quote
Old 28th September 2023, 14:44   #6  |  Link
Earthnuker
Registered User
 
Earthnuker's Avatar
 
Join Date: Mar 2021
Location: Germany
Posts: 11
Quote:
Originally Posted by hubblec4 View Post
Hi Earthnuker

That is very interesting and I have never found such info while I wrote my own IFO parser.
Could you imagine to share with me the DVD you had mentioned? Or if the entire DVD is to much, the IFO files would be also helpful.
I have uploaded the VIDEO_TS.IFO file to https://s31.0w0.wtf/s/wHC9dDgs4JrcNwA (Nextcloud instance hosted by a friend) i do have an ISO of the DVD but it's over 5GB so uploading that somewhere might take a while, i had thought it was available on archive.org, but i must have been mixing it up with something else
__________________
Hack the planet!
Earthnuker is offline   Reply With Quote
Old 29th September 2023, 10:58   #7  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,379
Many thanks for this VIDEO_TS.IFO file.
I hope it is enough to figure out everything for parsing the chapter names.
hubblec4 is offline   Reply With Quote
Old 30th September 2023, 20:55   #8  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
DVD Architect Pro allows for named chapters, once I find time I can make some test projects.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 6th October 2023, 21:02   #9  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
Well, DVD-A 7.0 does not seem to render the chapter names from its timeline window into the VIDEO_TS.IFO
I can input up to 39 characters per Chapter, even Unicode symbols (musical notes) were accepted, except the first chapter 1, this can not be named.
After rendering and opening with MakeMKV only standard names are assigned : Chapter 01, Chapter 02...
DVDLabPro2: One cannot enter chapter names there anyway. MakeMKV shows the same.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 6th October 2023, 21:22   #10  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,545
Just downloaded Earthnuker's VIDEO_TS.IFO.
BTW, good find, Earthnuker. Did not go through all steps but the concatenation of all strings at the end
indeed tells that applying the calculated offsets one should be able to parse following your procedure in post #2.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."

Last edited by Emulgator; 6th October 2023 at 21:25.
Emulgator is offline   Reply With Quote
Reply

Tags
dvd, dvd ripper

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 03:03.


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