Log in

View Full Version : IFO parsing - Audio+Sub StreamID's


hubblec4
30th March 2017, 14:15
Hi all


Hi r0IZ

I have a question about IFOEdit and I hope it is ok when I ask you via pn. (IFOEdit is an old topic)

When I load this IFO
http://forum.gleitz.info/attachment.php?attachmentid=99324&d=1490833860
and select the first entry in the top treeview, I get a "VTS Overview" in the bottom listview.

Info about Title Set (Movie) attributes show for the 1. Audio stream two ID's (ID: 0x80,0x83).
Substreams have until 3 ID's and all uses the 0x20-ID.

This behaviour/logic confuse me.
Could you told me which Bytes or Bits I have to parse for this info?
When my ifo parse reads the PGC table-structure -> Audio Stream Control or Subpicture Stream Control, I don't know which ID correspond to the correct stream.

Best regards

Hi,

I'm not sure I understand what you want. Anyway, please send me all IFOs from that DVD (or, better, the full content of the PgcEdit_backup folder after having opened that DVD with PgcEdit). I'm totally blind when using IfoEdit alone, and PgcEdit requires the complete set of IFOs to work.

In short, it is normal that a single subtitle track uses several physical streams, because the subtitles (or button highlights) must be (or are often) different for the different display modes (4:3, letterbox, pan & scan). However, an audio track is normally made of a single physical stream, and indeed I don't understand why IfoEdit shows you two stream IDs for the same track in the overview. I guess it's simply a discrepancy in IfoEdit, but I'm not sure. Remember that the overview is simply a compilation of some informations from different tables, and it has no direct equivalent in the IFO. Personally, I have never paid attention to that overview. Maybe IfoEdit does something wrong here. Honestly, I don't know. I may be able to understand why it does that with the full set of IFOs, but not with only this one.

Also, it might be a good idea to post that question in the forum and not by PM. I'm not specialist in IfoEdit, and others may be able to help much more than me.

Good luck,
r0lZ

hubble

Here is the PgcEdit backup (http://forum.gleitz.info/attachment.php?attachmentid=99325&d=1490879204) from the Aliens DVD which contains two versions of the movie.

PGC Title 3 uses for the first audio stream a streamID 3 (0x83) and normally is this audio track 4 but there is no audio track 4. The streamID 3 is used for audio track 1(ID 0).

However, my main question is which Bytes reads IfoEdit to get info which streamID correspond to an audio/subtitle track.

Ghitulescu
30th March 2017, 16:17
You got the answer in the gleitz forum.
The properties are common for all 3 PGCs that are there.
In PGCedit you should have a better view of what's there (at least for me it's much better presented there than in IFOEdit).
So, there are streams 0 and 2 for probably DE and EN, as you said and yet another one, #1 which appears to be the director's comment, according to you.

The whole problem comes from the fact that the first and only stream of the last PGC is again EN but has a different stream ID, to be differentiated from the original EN one.

As Ligh explained to you in the same thread, the streams are numbered from 80 for AC-3, so the first 0 is 80, the second is 81 and so on...
In your case the first PGC has the audio 1 as stream 0 and audio 2 as stream 2.
The second PGC has 3 audio tracks, streams 0, 2 and 1 in this order.
The last PGC has only one audio, but it has stream ID 3.

Is this you wanted to know?

r0lZ
31st March 2017, 08:46
Yep, Ghitulescu is right. Apparently, in its summary, IfoEdit groups together the tracks with the same language. It's somewhat confusing, as it seems that there are only 2 tracks but 3 physical streams, but when you examine the Domain Track Attributes with PgcEdit, you see that indeed there are 3 tracks, with two tracks in English plus one in German. They are really 3 different tracks, and not two tracks with one bizarre track with two physical streams, as suggested by IfoEdit.

Nothing to worry about. This DVD is perfectly legit.

Here is the list of the tracks of Title 2 (the main movie) as displayed by PgcEdit's Info -> PGC. The PGC uses 3 audio tracks, as you can see in red. Note the stream numbers (0, 2 and 1). They are not in the usual order, but that's perfectly legit. Since the 3 tracks are encoded in AC3, you have to add 0x80 to obtain the stream IDs (0x80, 0x82 and 0x81). The ID can be deduced from the track status (bits 8-15).

That corresponds to the info displayed by IfoEdit, although I don't think that grouping the tracks by language is a good thing.
VTST 1 , 2 TTN 2 (2:28:05) Title 2 - Chapters: 44, Programs: 44, Cells: 103

Playback time: 02:28:05.14 (at 25 fps)
PG Playback mode: sequential
PUOs: 4194304 (0x00400000)
- Angle change (0x00400000)
NextPGCN: 0
PrevPGCN: 0
GoUpPGCN: 0
PGC Still Time: 0
Audio track 1 status: 0x00008000 (stream=0)
Audio track 2 status: 0x00008200 (stream=2)
Audio track 3 status: 0x00008100 (stream=1)
Subpic track 1 status: 0x80000000 (streams for 4:3=0, wide=0, letterbox=0, pan&scan=0)
Subpic track 2 status: 0x80010100 (streams for 4:3=0, wide=1, letterbox=1, pan&scan=0)
Subpic track 3 status: 0x80020200 (streams for 4:3=0, wide=2, letterbox=2, pan&scan=0)
Subpic track 4 status: 0x80030300 (streams for 4:3=0, wide=3, letterbox=3, pan&scan=0)
Subpic track 5 status: 0x80040400 (streams for 4:3=0, wide=4, letterbox=4, pan&scan=0)

hubblec4
31st March 2017, 11:21
Hi r0lZ

Title 1 and Title 2 are ok, all streamID's match to an audio track where I can find more info(channels, codec etc.).
Title 3 has one audio with streamID 0x83 (33536) which means audio track 4, but there is no audio track 4. Title 3 uses audio track 1(ID 0).

Same thing with the last Subtitle stream from PGC-Title 1: you find the streamID 5 which means subtitle track 6 but there is not present (track 5 will be used).

r0lZ
31st March 2017, 14:08
Oh, yes, it seems that the audio track of Title 3 uses stream 0x83. That's bizarre and probably an authoring error, but that doesn't mean that that physical stream doesn't exist in the VOBs. Use VobEdit to verify. If it exists and can be played, then I suppose that the best thing to do is to leave it as it is. Else, try to replace it with stream 0, 1 or 2, until you find the correct audio stream. Anyway, title 3 is very short (26 seconds) and is probably just a studio logo. If I were you, I would just bypass it or remove it completely.

For the last subtitle track of title 1, it's the same thing. If stream 0x25 doesn't exist in the VOB and you are sure that stream 0x24 has the right content, just fix the stream number. It's easy with PgcEdit.

Ghitulescu
31st March 2017, 14:23
He confounds the streamIDs with their corresponding order. And this is why he's confused. It's not an authoring error.

streamIDs are given only to help separate the streams from each other.

A stream may contain whatever one wants.

This is a double indexing. That's why one has to look in the tables to see "who's who". Otherwise one would simply needed only to parse the PS by itself, without the need for the PGC tables.

r0lZ
31st March 2017, 15:07
I agree, although usually the ID corresponds to the stream number. But in this DVD, things are complex and not really well done. In the case of the short title 3, it is surprising that a new physical stream is created just for that track. It could have used one of the existing streams. Furthermore, 3 tracks are defined in the Domain Track Attributes, but only title 2 uses them all. That means that there are unused tracks in Title 1 and 3, and they are normally visible in the list of audio tracks shown by the player, although they are not connected to a real physical stream. The presence of "gaps" in the tracks is well known to cause problems with some players. Therefore, if it's not really an authoring error, it's at least a good example of what should never happen. Ideally, the 3 titles should have been authored in different titlesets, with a correct mapping of tracks and physical streams, and the exact number of really available tracks, without ambiguity.

hubblec4
31st March 2017, 15:26
Oh, yes, it seems that the audio track of Title 3 uses stream 0x83. That's bizarre and probably an authoring error, but that doesn't mean that that physical stream doesn't exist in the VOBs. Use VobEdit to verify.
Ok that could be possible and maybe for other disc's is it correct.


If it exists and can be played, then I suppose that the best thing to do is to leave it as it is. Else, try to replace it with stream 0, 1 or 2, until you find the correct audio stream. Anyway, title 3 is very short (26 seconds) and is probably just a studio logo. If I were you, I would just bypass it or remove it completely.
This short PGC is the logo which plays before PGC1 and/or PGC2 start.
I can't edit the IFO's from a physical disc.


For the last subtitle track of title 1, it's the same thing. If stream 0x25 doesn't exist in the VOB and you are sure that stream 0x24 has the right content, just fix the stream number. It's easy with PgcEdit.

My aim is to make a Multi-Edition/Angle-mkv from such DVD's with chapterEditor. Only PgcDemux and BDSup2Sub should be used as external programs, so I will parse all info from the IFO's by myself.
And when I have such DVD's with "streamID-issues" the mkv-creating process is then maybe not correct.

PgcDemux handle this DVD correct and the streamID's are identical to IFOEdit (so I think it is not an authoring error, or both programs uses the same workaround).

Log for Title 3 -> VobID 67
[General]
Total Number of PGCs in Titles=3
Total Number of PGCs in Menus=36
Total Number of VobIDs in Titles=67
Total Number of VobIDs in Menus=70
Total Number of Cells in Titles=139
Total Number of Cells in Menus=70
Demuxing Mode=by VOB Id
Demuxing Domain=Titles
Total Number of Frames=671
Selected VOBID=67
Number of Cells in Selected VOB=1
Selected PGC=None
Number of Cells in Selected PGC=None
[Demux]
Number of Video Packs=9088
Number of Audio Packs=640
Number of Subs Packs=0
Number of Nav Packs=45
Number of Pad Packs=0
Number of Unkn Packs=0
[Audio Streams]
Audio_1=None
Audio_2=None
Audio_3=None
Audio_4=0x83
Audio_5=None
Audio_6=None
Audio_7=None
Audio_8=None
[Audio Delays]
Audio_4=-32
[Subs Streams]
Subs_01=None
Subs_02=None
Subs_03=None
Subs_04=None
Subs_05=None
Subs_06=None
Subs_07=None
Subs_08=None
Subs_09=None
Subs_10=None
Subs_11=None
Subs_12=None
Subs_13=None
Subs_14=None
Subs_15=None
Subs_16=None
Subs_17=None
Subs_18=None
Subs_19=None
Subs_20=None
Subs_21=None
Subs_22=None
Subs_23=None
Subs_24=None
Subs_25=None
Subs_26=None
Subs_27=None
Subs_28=None
Subs_29=None
Subs_30=None
Subs_31=None
Subs_32=None


When I mux Title 1(2 Audio tracks) to an mkv then are all 3 audio tracks included.
The audio stream control mechanism is for me like the same in Matroska "ChapterTrackNumber" mechanism.
3 physical audio streams but only 2 streams are availble for this Title. I'm right?

hubblec4
31st March 2017, 15:41
He confounds the streamIDs with their corresponding order. And this is why he's confused. It's not an authoring error.
streamIDs are given only to help separate the streams from each other.
No. streamID's and their corresponding order is 100% logical to me.



This is a double indexing. ...

Exactly, and I would like to know how IFOEdit(and PgcDemux) parse this.
In IFOEdit's "VTS Overview" has the first audio stream 2 ID's and this info I need too.

hubblec4
31st March 2017, 15:56
I agree, although usually the ID corresponds to the stream number. But in this DVD, things are complex and not really well done. In the case of the short title 3, it is surprising that a new physical stream is created just for that track. It could have used one of the existing streams. Furthermore, 3 tracks are defined in the Domain Track Attributes, but only title 2 uses them all. That means that there are unused tracks in Title 1 and 3, and they are normally visible in the list of audio tracks shown by the player, although they are not connected to a real physical stream. The presence of "gaps" in the tracks is well known to cause problems with some players. Therefore, if it's not really an authoring error, it's at least a good example of what should never happen. Ideally, the 3 titles should have been authored in different titlesets, with a correct mapping of tracks and physical streams, and the exact number of really available tracks, without ambiguity.

The Aliens DVD (and the other 3 disc) have 2 editions of the movie and are seamless branching authored.
Title 1 is the Theatrical edition with 2 Audios(en,de), Title 2 is the Director's Cut and has 3 Audios(en,de,en-comment).
Like you said, all 3 audios are available/selectable in a player for Titel 2 only.

IFOEdit/PgcDemux reads this info from the IFO.
When I parse the Audio Stream Control of PGC-Title 3 and I get 0x83 as streamID, what I have to do to know which audio track is used?

r0lZ
31st March 2017, 16:15
When I mux Title 1(2 Audio tracks) to an mkv then are all 3 audio tracks included.
It's typical with that kind of (bad) authoring and (bad) program. It is unusual (but not illegal) to define more tracks than really used. In the PGC table, it is possible to see that some of the tracks are not linked to a real physical stream, and therefore the player or MKV muxer should omit them automatically. But rudimentary programs do not verify that and include all tracks. You end up with a silent track at best. Anyway, I strongly suggest to deselect manually the unused tracks, to NOT include them in the final MKV.
3 physical audio streams but only 2 streams are availble for this Title. I'm right?I haven't the VOBs, but according to the IFOs, there are 4 physical streams in the VOBs, with IDs 0x80, 0x81, 0x82 and 0x83, and 3 tracks are defined in Domain Track Attributes. That means that the maximum number of tracks that can be visible to the user is 3.

Title 1 has only 2 (real) tracks, and they use streams 0x80 and 0x82. Some players (or muxers) will show the track 3, but it cannot be played because it is not linked to any physical stream. It's why I don't like at all that kind of authoring, although it is legit.

Title 2 uses the 3 first physical streams and it's correct. The mapping is somewhat unusual (0x80, 0x82, 0x81) but that should never be a problem. AFAIK, all players will play the correct stream. I don't know if all muxers will include the tracks in the right order, but that's another problem, not related to the DVD itself.

Title 3 is the most bizarre. It uses only a single track (and has therefore 2 useless tracks that may be displayed anyway by bad players or muxers), and that track is linked to the fourth physical stream (0x83). That means that the two long tracks 1 and 2 must have a (probably silent) fourth audio stream, just because it is necessary for title 3. IMO, that's really bizarre, and I would have authored that 3 titles in different VTSs, just to define exactly the number of tracks that are really useful. That would have been much more easy to understand, and almost all DVDs are authored that way. But that doesn't mean that this DVD is not legit. It's just stupid.

BTW, the confusion of the track as seen by the user (with a specific language and perhaps additional info such as "director comments") and the physical streams in the VOBs (identified by its stream ID, like 0x80) is mainly due to the extremely confusing names given to them by the "experts" who have created the DVD-Video specs. The tracks and streams are called with the same word: stream! And you can read absurd things like "A subtitle stream can be made of one or several streams." 1 = 2! It's why I prefer to use the terminology adopted by mpucoder for muxman: "track" for the logical stream presented to the user, and "stream" (or, better, "physical stream") for the real stream muxed in the VOB. The VTSI_MAT table in the IFO defines the tracks, and the PGC table links that tracks to the physical stream in the VOB. The unusual thing with your DVD is that there are tracks defined in the VTSI_MAT table but that are not linked to a physical stream in the PGC. It's extremely rare, extremely confusing, extremely stupid, but not illegal.

r0lZ
31st March 2017, 16:28
When I parse the Audio Stream Control of PGC-Title 3 and I get 0x83 as streamID, what I have to do to know which audio track is used?
The "tracks" (as defined in my previous post) are defined in the VTSI_MAT table, and are normally presented to the user in that order. There is no link to the physical stream in that table.

The PGCs are defined in the VTS_PGCITI table (for the titles) and VTSM_PGCI_UT table (for the menus). Each stream has simply a single value (called by IfoEdit "stream status"). Bits 8-10 contain the stream number. Bit 15 is set to 1 to mean "enabled". For example, if you examine the PGC of Title 1 in IfoEdit, you will see that the two defined streams have values 0x8000 and 0x8200. Their numbers are therefore 0 and 2, and since they are AC3 streams, they have the stream IDs 0x80 and 0x82. The 6 other audio streams are not used and have a status of 0. (The "bad" players or muxers should simply verify if bit 15 is set for a specific stream, and if it's not the case, that mean that it is not used, and it should of course not be presented in the list of available streams or muxed in the final MKV.)

Since there are 4 different display modes for the subtitles, there are also 4 streams, and the status is a 32-bit number. Bit 31 is the "enabled" flag, and the other bits contain that stream numbers for the 4 possible display modes.

Ghitulescu
31st March 2017, 17:21
Like you said, all 3 audios are available/selectable in a player for Title 2 only.
Of course it is, because only this PGC has defined 3 audio tracks.
The other one has only 2 of them because it uses also cells that have only 2 audio streams in their payload and nobody knows what would happen when the player, set to play the third track, reaches one of these cells: mutes, skips, stops, locks down, loops indefinitely looking for an $83 packet that never comes etc etc etc....


The Aliens DVD (and the other 3 disc) have 2 editions of the movie and are seamless branching authored.
Title 1 is the Theatrical edition with 2 Audios(en,de), Title 2 is the Director's Cut and has 3 Audios(en,de,en-comment).


IFOEdit/PgcDemux reads this info from the IFO.
When I parse the Audio Stream Control of PGC-Title 3 and I get 0x83 as streamID, what I have to do to know which audio track is used?

3 people in 2 languages already told you what is the track :) :)

I repeat: why? You want to demux them? If so, then use PGCdemux and live happily ever after... DVDshrink can do it too (stripping one language)

hubblec4
31st March 2017, 18:30
@ r0IZ

Many thanks for your explanations.
Yes this DVD seems very special authored and now I know that mpc-hc is a "bad" player. PgcDemux should not demux the 3. audio(directors comment) for Title 1 but it does.
MKVToolNix(MTX) identify mode recognize all 3 audio tracks and set the correct streamID's.
All 3 audios are in the vobs for all VobID's of Title 1 and 2 available, I expect no muxing errors while appending the vob's in MTX.
It seems to me that audio 3(en-DC'comment) is simple disabled for Title 1 but it exists as real track.
This behavior is implemented in Matroska.



@Ghitulescu
PGCdemux is used for demuxing, right, but without correct track order for audio and subs it will be hard/not possible to create multi-edition-mkv's.
My DVD2mkv editor is not so good like makemkv, I need extern programs and so on, but makemkv will be never able to mux such multi-edition-mkv's.
For Bluray is it much more simple and works already.

Ghitulescu
1st April 2017, 18:55
PgcDemux should not demux the 3. audio(directors comment) for Title 1 but it does.
It never happened to me that PGCdemux would go beyond the PGC it is supposed to demux.
But anyway, should this be the case, just edit the DVD in PGCEdit and remove the offending PGC3. Or blank it in VobBlanker or or or or...

hubblec4
2nd April 2017, 11:19
It never happened to me that PGCdemux would go beyond the PGC it is supposed to demux.
But anyway, should this be the case, just edit the DVD in PGCEdit and remove the offending PGC3. Or blank it in VobBlanker or or or or...

You can't edit stuff on a physical disc!!
To remove/blank something is not the right solution.

The Alien1-4 DVDs are crazy authored and mkvmerge has a bit problems with the sound tracks.
A mux with MTX (direct from dvd), results with asynchronous audio.
For my tests I use makemkv and there are no sound problems, and for the Directors Cut the commentary audio track available only(not for the theatrical version). (really nice)

A demux with Pgcdemux (option: create PGC-vob) have the same sound problems, so I guess such complicated authored DVD's can not correct handled(MTX, PGCdemux...).

r0lZ
2nd April 2017, 12:45
If I understand correctly the problem, you want to keep Title 1 and Title 2 in a multi-edition MKV, and you need the same tracks in the two titles as otherwise you can't combine the two titles in the same MKV. Right?

Try to define the missing audio track in Title 1. That should be easy with PgcEdit. Of course, you have to copy (or decrypt) the DVD to HDD first, but anyway, working on a physical DVD is never easy, and is even impossible if it is encrypted.

Open the DVD in PgcEdit and double-click the PGC in the left pane to open the PGC Editor. In the "Audio Track to Stream Map" section, click the third button (#2, the first button with the label "none"), move the slider to 1 and click Set. OK the PGC Editor. Save the IFOs. That's it.

Now, PGC 1 and 2 have exactly the same number of audio tracks, in the same order. It should be trivial to mux them to the multi-edition MKV, with your usual tools.

Of course, the content of the third audio stream may be bizarre when you play Title 1, but it should be OK when playing the director's cut.

BTW, when you are in PgcEdit, you can also delete Title 3 if it causes other problems (but I don't think it's necessary). If you do it, you can ignore the problems of the broken navigation, since you will never play the edited DVD. You just need the correct PGC structures.

hubblec4
2nd April 2017, 17:52
If I understand correctly the problem, you want to keep Title 1 and Title 2 in a multi-edition MKV, and you need the same tracks in the two titles as otherwise you can't combine the two titles in the same MKV. Right?

Yes, thats right. But I must identify the track order in the vobs to feed MTX with the correct stream info.
PgcDemux and MKVToolNix(MTX) (identify mode) gives me the same stream ID's with the same order. This info's are different to info in the IFO.
For Title 1 and 2 are all 3 audio tracks available while demuxing with PgcDemux or direct muxing with MTX (but with a different order).


My second test with the first Alien DVD is more confusing. The 4. audio track is a dts stream with 0x89 as ID, but I can't found this ID in the Audio Stream Control Table.

In my old DVD2mkv editor I use from the VTSI_MAT table all info for audio and sub tracks (order, codec etc.) But the order don't match for the Alien DVD's and now I will recode it so it will work.



Try to define the missing audio track in Title 1. That should be easy with PgcEdit. Of course, you have to copy (or decrypt) the DVD to HDD first, but anyway, working on a physical DVD is never easy, and is even impossible if it is encrypted.

Open the DVD in PgcEdit and double-click the PGC in the left pane to open the PGC Editor. In the "Audio Track to Stream Map" section, click the third button (#2, the first button with the label "none"), move the slider to 1 and click Set. OK the PGC Editor. Save the IFOs. That's it.

Now, PGC 1 and 2 have exactly the same number of audio tracks, in the same order. It should be trivial to mux them to the multi-edition MKV, with your usual tools.

OK, I could try that, but is this methode suitable for a CLI process?

r0lZ
2nd April 2017, 18:12
I don't understand why you need the streams in a specific order. Anyway, as we have explained above, the tracks are just soft links to the real physical streams, and are what the player should present to the user. In your case, they are: English, Deutsch, English (director's comments, although it's not specified in the IFO).
They map respectively to the physical AC3 streams 0, 2 and 1, in that strange but legit order. Therefore, the English audio has the ID 0x80, Deutsch 0x82 and DC 0x81. If the program you use to demux or remux the tracks gets them directly from the VOB without taking the IFO into account (bad!), chances are that they will be presented in the order EN, DC, DE.
Anyway, if after having created the MKV, you find that the language code or track labels are not correct, it is easy to change them with MkvPropEdit (from MTX).

I'm not sure you need to create the missing track link as explained in my previous post, since apparently all tools find the 3 (or 4?) streams anyway. If you do it, you have to use PgcEdit, and no, it's not a CLI tool. Again, I don't understand why you want to use the CLI for such a simple process. Apparently, you need to make things much more complex than they are. Or is it because you work under Linux? In that case, use Wine HQ. PgcEdit works correctly under Wine (but you may have to change the default fonts, and the preview doesn't work.)

Ghitulescu
2nd April 2017, 18:24
You can't edit stuff on a physical disc!!
To remove/blank something is not the right solution.

Open the DVD in PgcEdit and double-click the PGC in the left pane to open the PGC Editor. In the "Audio Track to Stream Map" section, click the third button (#2, the first button with the label "none"), move the slider to 1 and click Set. OK the PGC Editor. Save the IFOs. That's it.

Now, PGC 1 and 2 have exactly the same number of audio tracks, in the same order. It should be trivial to mux them to the multi-edition MKV, with your usual tools.
OK, I could try that, but is this method suitable for a CLI process?
It won't work because the physical disc cannot be altered :), you said it before.

The Alien disc is not crazy authored. It is authored as any other big projects that have to be flexible for being launched on several incompatible markets in short times one after the other.
That you do not understand the logic is not their fault - remember, the studios check every project for 100% compliance with the DVD specs, some even have various DVD players for an extra check.

Maybe your methods, I am still on serious doubts on what you intend to achieve, are "crazy" because they do not cope with the reality :) :) :)?

PS: some features of the DVDs cannot be replicated or worked by no consumer tools, and some cannot be replicated by any tool except those two used in studio (neither is Scenarist, to prevent any misunderstandings). If any of such discs is worked outside that restrictive world, one has to take a decision on which features have importance, which cannot be done and which can be dropped. Multiangle for instance can only be managed by changing the container as no muxer today can do it properly.

I have no problems with this: I pick up the director's cut when available or the extended cut against theatrical one, and the original movie "angle" (mostly used to display an alternate credits).

Ghitulescu
2nd April 2017, 18:27
Adding a fictitious track to a cell which has not an associated stream may be problematic when played back on some systems. I would delete the dir comments instead and let both PGCs have the same 2 languages.

Never been interested n what the directors have to comment, if their masterwork could not conveyed that message to me they they failed their job...

hubblec4
2nd April 2017, 18:44
That you do not understand the logic is not their fault - remember, the studios check every project for 100% compliance with the DVD specs, some even have various DVD players for an extra check.

Maybe your methods, I am still on serious doubts on what you intend to achieve, are "crazy" because they do not cope with the reality :) :) :)?

You are right, at the moment I'm to stupid to understand the logic, no problem.
I don't use DVD's if the Bluray for a movie is available. This was a feature request and I will try it, maybe it works.



PS: ...Multiangle for instance can only be managed by changing the container as no muxer today can do it properly.
For DVD multi-edition it seems a bit hard to do this(for multi angle I expect no problems), but muxing multi-edition/angle blurays to mkv is an easy task.


I have no problems with this: I pick up the director's cut when available or the extended cut against theatrical one, and the original movie "angle" (mostly used to display an alternate credits).

Often have the Extended Cut's other video scenes inside as the theatrical one. Alien 1 or Total Recall and so on, and I like it to have both version with diffrent contents. (and like I said, for Bluray an easy task)

r0lZ
2nd April 2017, 19:33
It won't work because the physical disc cannot be altered :), you said it before.
It's why I wrote this:
Of course, you have to copy (or decrypt) the DVD to HDD first, but anyway, working on a physical DVD is never easy, and is even impossible if it is encrypted.

The Alien disc is not crazy authored. It is authored as any other big projects that have to be flexible for being launched on several incompatible markets in short times one after the other.
Well, I'm not totally convinced that that DVD has been correctly authored. It is legit, that's right, but adding a studio logo after two long titles is IMO completely stupid. Usually, the studio logos are authored in the VMGM (another bizarre decision), and I wonder why it's not the case here. The result is a strange mix of 4 audio tracks in the whole domain, with several tracks unavailable in most titles. I understand perfectly why Title 1 has no director's comments, but having to define a fourth stream just for the logo is a total nonsense.

That you do not understand the logic is not their fault - remember, the studios check every project for 100% compliance with the DVD specs, some even have various DVD players for an extra check.
Here also, I disagree. Almost all commercial DVDs have big authoring errors or at least severe discrepancies. (And this one is not an exception.) They work usually with the vast majority of the players, but none pass the Philips Verifier tests with full success. (I have to admit that it's almost impossible due to discrepancies in the DVD-Video specs, but they should at least try to minimize the errors, and obviously it's rarely the case.) Furthermore, the fact that the DVD must be easily modified to be sold in other countries is not an excuse to do an approximative job, especially since the DVDs are usually reauthored completely for other regions. (The division by regions is another stupidity BTW, even if in that case it's for commercial reasons.)

Maybe your methods, I am still on serious doubts on what you intend to achieve, are "crazy" because they do not cope with the reality :) :) :)?Here, I fully agree, I haven't been able to understand why the DVD causes so many troubles, and what hubblec4 is trying to do exactly. But it's not a reason for not trying to help him.

r0lZ
2nd April 2017, 19:46
Adding a fictitious track to a cell which has not an associated stream may be problematic when played back on some systems.
I agree, but the modified DVD will never be burned or played. I suggested to "add" the missing track only because it might be easier to use the tools to convert it to multi-story MKV later. And I wrote this (about deleting the studio logo, but the same remark is valid also for the "unhidden" track):
If you do it, you can ignore the problems of the broken navigation, since you will never play the edited DVD. You just need the correct PGC structures.

The fact that the "missing" audio stream is missing in the shortest version of the movie and present in the director's cut means (most probably) that all cells of the short version HAVE that audio stream. My hack consists only in making it visible. And that should work without problem, although, as I said, listening to that track when watching the short version doesn't make much sense.

hubblec4
2nd April 2017, 19:51
I don't understand why you need the streams in a specific order.
My cE is a simple program and I'm not an expert in DVD authoring. I will use less external programs as possible to achieve what I want. I know it will be never 100% perfect but it is Ok for me.
PgcDemux and MKVToolNix (and BDSup2Sub) are the external programs and now I know this are not the best/easy tools for handle DVD material.


Anyway, as we have explained above, the tracks are just soft links to the real physical streams, and are what the player should present to the user. In your case, they are: English, Deutsch, English (director's comments, although it's not specified in the IFO).
They map respectively to the physical AC3 streams 0, 2 and 1, in that strange but legit order. Therefore, the English audio has the ID 0x80, Deutsch 0x82 and DC 0x81. If the program you use to demux or remux the tracks gets them directly from the VOB without taking the IFO into account (bad!), chances are that they will be presented in the order EN, DC, DE.
Anyway, if after having created the MKV, you find that the language code or track labels are not correct, it is easy to change them with MkvPropEdit (from MTX).

I hope I can code an algo for such behaviors. After editing the final mkv is not what I want.



I'm not sure you need to create the missing track link as explained in my previous post, since apparently all tools find the 3 (or 4?) streams anyway. If you do it, you have to use PgcEdit, and no, it's not a CLI tool. Again, I don't understand why you want to use the CLI for such a simple process. Apparently, you need to make things much more complex than they are. Or is it because you work under Linux? In that case, use Wine HQ. PgcEdit works correctly under Wine (but you may have to change the default fonts, and the preview doesn't work.)

All processes (demuxing, editing, muxing) should be automatically in my DVD2mkv editor.
I work with Linux(total noob^^) too, so that cE runs there. But this is another story...

hubblec4
2nd April 2017, 19:53
Adding a fictitious track to a cell which has not an associated stream may be problematic when played back on some systems. I would delete the dir comments instead and let both PGCs have the same 2 languages.

Jupp I agree with you. I will make a warning for such things.

hubblec4
2nd April 2017, 20:03
Here, I fully agree, I haven't been able to understand why the DVD causes so many troubles, and what hubblec4 is trying to do exactly. But it's not a reason for not trying to help him.

Many thanks for this words.

My aim is to create a single mkv with both editions of the movie with "ordered chapters".
Title 1 is fully used and from Title 2 only the VobID's which not inclued in Title 1 will be used (or vise versa).
There is only one other program which can do such job: X1OneGenerator( but only Bluray). It exists no tool for DVD(at the moment).

hubblec4
2nd April 2017, 20:12
The fact that the "missing" audio stream is missing in the shortest version of the movie and present in the director's cut means (most probably) that all cells of the short version HAVE that audio stream.

Exactly. When I demux the vob's by VobID's with PgcDemux then MTX identify all 3 audio track's for all VobID-segments.

hubblec4
2nd April 2017, 22:47
@ r0IZ

Here is an other sample, Alien DVD (http://forum.gleitz.info/attachment.php?attachmentid=99329&d=1491169347)

A german DTS audio with 0x89 as ID are inside, but I can't find this ID in the Audio Stream Control of the titles.

r0lZ
3rd April 2017, 10:16
All processes (demuxing, editing, muxing) should be automatically in my DVD2mkv editor.
Ah, OK, I haven't understood that you want to write your own software. Of course, it's more difficult than using existing tools.

BTW, I wrote a plugin for PgcEdit that converts a single PGC to MKV. It is integrated in PgcEdit and has a GUI, so it is not really useful for you, but if you want, you can try it. I have never released it, but afaik it works correctly. Download it here (http://download.videohelp.com/r0lZ/pgcedit/plugins/pgc2mkv_plugin_0.3.7z), and extract the .tcl file in the plugins folder of PgcEdit. Relaunch PgcEdit. You should see a new Plugins -> PGC2MKV menu.

Note that you need PgcDemux, MkvMerge, BDSup2Sub (java version) or BDSup2Dub++ (not really recommended) or SubtitleCreator, and optionally x264 if you want to re-encode the video. It doesn't handle multi-story titles, and if the PGC has several angles, you must select only one of them. In other words, it is unable to create a multi-edition MKV. Of course, you can select the audio and subtitle tracks you want to include in the final MKV. If you re-encode the video, you can crop and resize it to SAR 1:1 if you wish. Also, like PgcEdit, it doesn't work with an encrypted DVD, so you have to decrypt it to HDD first, or use AnyDVD to decrypt it on the fly.

Although it cannot be integrated directly in your program, it may be a good tool to verify if you present the right streams to the user.

r0lZ
3rd April 2017, 10:23
@ r0IZ

Here is an other sample, Alien DVD (http://forum.gleitz.info/attachment.php?attachmentid=99329&d=1491169347)

A german DTS audio with 0x89 as ID are inside, but I can't find this ID in the Audio Stream Control of the titles.
The stream IDs of DTS audio begin at 0x88. Since the German DTS is the physical stream #1, its ID is 0x88+1 = 0x89.

Here is the list of the ID offsets for all types of subtitle and audio streams available in a DVD-Video:

Subtitles 0x20
AC3 0x80
DTS 0x88
SDDS 0x90
LPCM 0xA0
MPEG 0xC0
MPEG2-ex 0xC8

hubblec4
3rd April 2017, 10:30
Thanks for this info r0IZ.

Bigotti5 helps me in the german forum with detailed info and now I see a bit light.

hubblec4
3rd April 2017, 10:38
Ah, OK, I haven't understood that you want to write your own software. Of course, it's more difficult than using existing tools.

BTW, I wrote a plugin for PgcEdit that converts a single PGC to MKV. It is integrated in PgcEdit and has a GUI, so it is not really useful for you, but if you want, you can try it. I have never released it, but afaik it works correctly. Download it here (http://download.videohelp.com/r0lZ/pgcedit/plugins/pgc2mkv_plugin_0.3.7z), and extract the .tcl file in the plugins folder of PgcEdit. Relaunch PgcEdit. You should see a new Plugins -> PGC2MKV menu.

Note that you need PgcDemux, MkvMerge, BDSup2Sub (java version) or BDSup2Dub++ (not really recommended) or SubtitleCreator, and optionally x264 if you want to re-encode the video. It doesn't handle multi-story titles, and if the PGC has several angles, you must select only one of them. In other words, it is unable to create a multi-edition MKV. Of course, you can select the audio and subtitle tracks you want to include in the final MKV. If you re-encode the video, you can crop and resize it to SAR 1:1 if you wish. Also, like PgcEdit, it doesn't work with an encrypted DVD, so you have to decrypt it to HDD first, or use AnyDVD to decrypt it on the fly.

Although it cannot be integrated directly in your program, it may be a good tool to verify if you present the right streams to the user.

Nice to read that you make an mkv support in PgcEdit.
Yes my DVD2mkv is software written by me and I'm sure with all your help (and all the others) I'm able to code a multi-edition mkv generator for DVD.

hubblec4
3rd April 2017, 10:47
PGCEdit says:

PGC2MKV plugin: This feature requires PgcEdit version 9.4 or greater. .......

But I hav PgcEdit 9.3, where I can find v9.4?

r0lZ
3rd April 2017, 10:59
Oops, I forgot that! v9.4 has not been released yet. I will try to release it very soon...

r0lZ
3rd April 2017, 11:17
OK, I've compiled it, and you can download it here (http://download.videohelp.com/r0lZ/tmp/PgcEdit_winexe_9.4.zip).
It's not the official release yet, but it should be OK, and certainly sufficient to run the PGC2MKV plugin.
It will be released officially soon, and when v9.4 will be officially available, you should download it and replace this version, because I may have fixed some bugs or changed a few things. In the meantime, use the unofficial v9.4 with caution.

hubblec4
3rd April 2017, 22:19
Thanks for this new version.

Ghitulescu
4th April 2017, 09:44
Well, I'm not totally convinced that that DVD has been correctly authored. It is legit, that's right, but adding a studio logo after two long titles is IMO completely stupid.
....
Here also, I disagree. Almost all commercial DVDs have big authoring errors or at least severe discrepancies. (And this one is not an exception.) They work usually with the vast majority of the players, but none pass the Philips Verifier tests with full success. (I have to admit that it's almost impossible due to discrepancies in the DVD-Video specs, but they should at least try to minimize the errors, and obviously it's rarely the case.) Furthermore, the fact that the DVD must be easily modified to be sold in other countries is not an excuse to do an approximative job, especially since the DVDs are usually reauthored completely for other regions. (The division by regions is another stupidity BTW, even if in that case it's for commercial reasons.)
This is what I meant, actually.

My aim is to create a single mkv with both editions of the movie with "ordered chapters".
Title 1 is fully used and from Title 2 only the VobID's which not inclued in Title 1 will be used (or vise versa).
There is only one other program which can do such job: X1OneGenerator( but only Bluray). It exists no tool for DVD(at the moment).
Well, if I would aim at one MKV for storing something (it is irrelevant at this stage "what exactly") I would remove all other things that would make problems to the tools I have.
This I have suggested you many replies ago :)

Usually, the studio logos are authored in the VMGM (another bizarre decision), and I wonder why it's not the case here. The result is a strange mix of 4 audio tracks in the whole domain, with several tracks unavailable in most titles. I understand perfectly why Title 1 has no director's comments, but having to define a fourth stream just for the logo is a total nonsense.
I can't pretend I understand all the reasons why some things are done the way they are - I believe there is a reason why. Maybe the logo is in the VMG because it's part of the system space and can be reached from anywhere on that disc (for instance the logo must be annoyingly run after every single, stupid action, before the menu, after the menu, before the main movie, after the main movie, before and after trailers etc etc etc).

hubblec4
4th April 2017, 22:46
Here is the list of the ID offsets for all types of subtitle and audio streams available in a DVD-Video:

Subtitles 0x20
AC3 0x80
DTS 0x88
SDDS 0x90
LPCM 0xA0
MPEG 0xC0
MPEG2-ex 0xC8

Could you tell me which Coding mode value is used for SDDS?

r0lZ
4th April 2017, 22:58
Could you tell me which Coding mode value is used for SDDS?

0 AC3
2 MPEG
3 MPEG2-ext
4 LPCM
6 DTS
7 SDDS