Log in

View Full Version : replace some streams, keep menu on Bluray?


Furiousflea
13th February 2009, 12:58
Hi there, I've been dabbling with the great beta of BD Rebuilder to backup some Blurays to BD9 and have had good results with some titles. But I'm really looking to recode some audio tracks like commentry to 96kbps AC3 (Originals being 192kbps) using eac3to and then swapping the streams with TSmuxeR.

I'm doing "The Matrix". With BD Rebuilder in its current state it really isn't able to do the full disc on BD9 at acceptable quality, due to having 4 commentry tracks at 192k and a 5.1 PIP track at 640k.

With eac3to I downmixed the 5.1 640k track to 128k stereo pro logic 2. Then the commentry tracks to 96kbps.

However looking around on here it seems that simply swapping the AC3 streams for ones of a lower bitrate and then swapping the resulting m2ts with the original and encoding won't work. I've read that you need to output a BD structure instead in TSmuxeR and swap some files around, but the information people have linked to do this seems very unclear.

Would someone be so kind as to point me a quick step by step on what I need to do apart from what I have already done so far.

Thanks very much in advance for any help, Rob :)

MadMonkey57
19th February 2009, 19:10
Can u upload the entire BD structure without the M2TS files ?

Guest
19th February 2009, 23:39
No he can't, per forum rules.

MadMonkey57
21st February 2009, 10:54
First let's assume you want:

- to replace an original stream that fits within one/+ M2TS (hence CLPI file(s)) by a re-encoded (either new video or audio or both) stream.
- this stream is referred to by one single MPLS file (IMO it should work when referred to by multiple MPLS files since in your case both the original and the re-encoded streams have the same length, but honestly I never tried).


1/ Re-encode your video and/or audio (I assume you know how to do that)

2/ Use tsmuxer to produce "Blu Ray" content out of the re-encoded video/audio

3/ In your BD structure:
- identify the M2TS file(s) that actually contain(s) the original stream(s)
- identify the related CLPI file(s), same name as M2TS files, different extension
- identify the MPLS file referring to the M2TS file(s) by using either BDEdit or an hex editor

To ease the understanding of the next steps, I'm going to use actual figures:

MPLS: 00007.mpls
CLPI: 00008.clpi and 00009.clpi
M2TS: 00008.m2ts and 00009.m2ts


4/ In tsmuxer's output, there are exactly one MPLS file (00000.mpls), one CLPI file (00001.clpi) and one M2TS file (00001.m2ts). They are the ones we will insert in the original BD structure. For now:
- rename this 00000.mpls as the original MPLS file identified in the previous step, 00007.mpls in our case
- rename this 00001.clpi as the first (maybe only) original clpi file, 00008.clpi in our case
- rename this 00001.m2ts as the first (maybe only) original m2ts file, 00008.m2ts in our case
- open the renamed MPLS (00007.mpls in our case) file with an hex editor, search for 00001M2TS (offset 0x42 if I remember correctly), replace 00001 by the number of the first (maybe only) original m2ts file, 00008 in our case

5/ In the original BD structure, remove the original MPLS, CLPI and M2TS files identified in step 3 and instead copy the MPLS, CLPI and M2TS files from tsmuxer's output, in our case 00007.mpls, 00008.clpi and 00008.m2ts. You have noticed that there are no more 00009.m2ts and 00009.clpi which is indeed as expected.

6/Alter BACKUP dirs accordingly

Furiousflea
26th February 2009, 06:31
Thanks very much for taking the time to write that out. I shall give it a shot :)

Regards, Rob

Capsbackup
28th February 2009, 02:46
@Furiousflea
Thanks very much for taking the time to write that out. I shall give it a shot

Regards, Rob

If you could report back if this works correctly or not, that would be very helpful. Seems like there should be some kind of sector corrections necessary for proper playback. But if this works, that would be a very simple way to manually rebuild a movie and reencode only some selective .m2ts files.

MadMonkey57
7th March 2009, 12:18
Apart from FuriousFlea, anybody else willing to report ?

For info, I've done this 76 times(!) so far to create BDs with episodes:
- First, create a nice menu with my favorite BD authoring tool. For each scene, I use a dummy video.
- Second, encode the real video/audio streams with x264, eac3to, aften, ...
- Third, use tsmuxer to generate Blu Ray output out of these real streams
- Fourth, apply the above procedure to insert the real movies into the BD structure

Capsbackup
7th March 2009, 15:57
@MadMonkey57,
This method sounds very interesting, a way to do a "manual" complete backup of a full movie, menus and all, if I am following this correctly. Reminds me of how I first began backing up DVD's using jdobbs tool "IfoUpdate" years ago before he created DVD Rebuilder. If, however, one were to strip some audio tracks and subtitle tracks from the movie portion of a BD, and try to insert it back into the original movies menus and structure, would there not be some problems with alignment to the menu buttons? So have you been able to do a successful back up this way, or have you been creating a new menu to work with your rencoded files?

MadMonkey57
7th March 2009, 18:52
Well, I have never tried a full backup the way you mean it. Every replacement I made was based on my own BD menus and my own reencoded files. I believe it should work as well with an original (commercial) BD structure.

I have never used ifoupdate, so I can't compare this method with it. These replacements are similar to PgcEdit's "Replace VTST Tiltes".

I have never encountered misalignment problems with this method (neither with PgcEdit).

Within a BD structure, a playlist is referred to by a number. What I do is simply generating a new playlist / clip / stream and assign the appropriate numbers... For what I remember, this was explained by kaid in one his threads somewhere in the forum.

turbojet
14th March 2009, 07:14
I've tried replacing m2ts files with blank ones in a retail BD but they didn't play well with powerdvd.
I will try replacing the clpi and mpls files too and see what happens. But I don't have a BD recorder and I don't have access to any player that plays full backups on BD5/BD9 so it won't be a very good test but better then nothing.

turbojet
15th March 2009, 10:24
It worked ok for me on powerdvd 8 to strip streams and blank extras. However with seamlesss branching or 'play all' type extras it won't work without editing the original mpls, replacing the mpls won't work.

What I did for blanking extras is fed this avisynth to x264 for step 1: BlankClip(10,1920,1080,"YV12",23.976)
Then I muxed just the blank video with TSmuxer in step 2, no audio/subs.

Maybe this is a first step to doing complete BD25 without encoding and blanking extras. But someone with a Sony player would have to confirm, jdobbs or anyone else willing to try?

MadMonkey57
15th March 2009, 13:07
...However with seamlesss branching or 'play all' type extras it won't work without editing the original mpls, replacing the mpls won't work...

You're right. For those who are aiming at BD full backup, it's probably better not to replace the original MPLS files but edit them to "point" to the appropriate CLPI/M2TS files (if numbering is different from the original). However, for those are wondering, replacing both CLPI and M2TS is mandatory.

Just like you, I can't do much testing... (no BD burner, SAP is a BD35).

schlaufer
16th March 2009, 13:50
I did my first test this weekend on Harry Potter II Chamber of Secrets with removing some of the unwanted audio tracks.

Replacing only M2TS failed (of course), replacing all three M2TS, CLPI and MPLS ended up with a working disk but (of course) no title menu.

All tests were done with PowerDVD.

I'll do another test with only replacing M2TS and CLPI and post the results here.

MadMonkey57
16th March 2009, 19:23
...replacing all three M2TS, CLPI and MPLS ended up with a working disk but (of course) no title menu....

I must be missing something here... What do you mean no title menu ? This should have nothing to do with your menu... Could you please give some details about you actually did ?

turbojet
16th March 2009, 21:56
It could be that it looks at movie m2ts before going to the menu, many DVD's do this for some reason.

MadMonkey57
16th March 2009, 22:12
Then what's the point with the replacement ? :confused::confused::confused:

turbojet
16th March 2009, 22:14
Replacement of?

He might be able to get by replacing clpi/m2ts only but it's never worked right for me in powerdvd.

MadMonkey57
16th March 2009, 23:27
Replacement of?

He might be able to get by replacing clpi/m2ts only but it's never worked right for me in powerdvd.

...Replacement of MPLS / CLPI / M2TS !

...replacing all three M2TS, CLPI and MPLS ended up with a working disk but (of course) no title menu....

Please schlaufer post as many details as you can i.e about the initial BD structure (menu or no menu ?), list of renamed or edited files, final BD structure, symptoms when playing with regards to what is expected...

schlaufer
17th March 2009, 13:26
Maybe I'm using still too much DVD terminology, so a few more details:

The (original) BD has two menus, one to choose extras and main movie (button called Top Menu in PowerDVD) and another one to select audio streams, subtitles and chapters of the main feature (button called Popup Menu in PowerDVD). I was referring to the latter one when writing about "Title menu" previously.

My goal was to remove unwanted audio streams from the backup (English PCM, German PCM and quite a few DD tracks in languages, that I will never learn), reducing the size of the backup from 38GB to 24GB.

So I used tsmuxer to create a new BD from the main movie stream with the unwanted streams de-selected. I then replaced:

M2TS - PowerDVD hangs when I try to play the main movie
M2TS and CLPI - PowerDVD hangs when I try to play the main movie
M2TS, CLPI and MPLS - PowerDVD plays the movie fine and I can select the main menu (aka Top Menu) w/o any problems, to switch to any extras. However, the title menu (aka Popup Menu) remains disabled, so I can't change the language, subtitles or chapters with a menu. I still can use the buttons for next language, subtitle or chapter to do so.

I fear, I have to wait until jdobbs integrates stream remapping and blanking into BD Rebuilder to do a more compact backup of this disk. :(

deank
17th March 2009, 14:28
It's normal for this to happen, because the original mpls file for the "movie-only" m2ts file contains path to popup-menu m2ts, which you broke when replacing it with tsmuxer's one.

schlaufer
17th March 2009, 14:41
Tbh, I did not really expect this to work, but I wanted to give it a try until I know more about BD structures. ;)

The question is: how can I re-use the original MPLS after removal of some of the streams? I guess I need to either re-map the removed streams or add the "path to the pop up menu" you've mentioned, maybe with a tool like BDEdit - but I can't figure out how (yet).

deank
17th March 2009, 14:50
No, you can't do it with BDedit. At this point there is no easy way, because tsmuxer changes PTS and you need to put those new timestamps in the original mpls if you want to keep the link to the popup m2ts.

G_M_C
17th March 2009, 15:03
The most usefull thing i can think of for wanting a feature like replacing streams is reducing the main-movie/extra size, while keeping everything else intact. But isn't this allmost exactly what jdobbs "full backup mode" will do/or allready does ?

i.e. reencoding video-streams, and leaving out unwanted audio,- and subtitlestreams (while keeping menu's), like DVD-Rebuilder does voor DVD's ?

turbojet
17th March 2009, 15:07
Almost but BD-RB encodes even if it fits the media. If it didn't then I don't see it required from an external app.

I think blanking extras would be more of a requirement of an external app while the ability to remove audio/video as a plus. Something like VOBblanker for instance.

deank
17th March 2009, 15:09
The most usefull thing i can think of for wanting a feature like replacing streams is reducing the main-movie/extra size, while keeping everything else intact. But isn't this allmost exactly what jdobbs "full backup mode" will do/or allready does ?

Yes and few understand the hard work and the hundreds of hours he put into a thing that to most people sounds so simple as 'replacing/removing streams, but keeping all other stuff intact'.

schlaufer
17th March 2009, 15:09
@G_M_C:
BD Rebuilder always does a re-encode of the video - which is exactly what I want to avoid. :(

laserfan
17th March 2009, 15:15
No, you can't do it with BDedit. At this point there is no easy way, because tsmuxer changes PTS and you need to put those new timestamps in the original mpls if you want to keep the link to the popup m2ts.Are you certain deank that this is always the case (tsmuxer changes PTS)? Or perhaps I should ask if the PTS that tsMuxeR makes aren't "close enough" to those in the original mpls that it will still work?

schlaufer
17th March 2009, 15:16
Yes and few understand the hard work and the hundreds of hours he put into a thing that to most people sounds so simple as 'replacing/removing streams, but keeping all other stuff intact'.

No one said, it's easy. ;)
I remember the "hard old days" before DVD RB when we used VOBEdit and IFOEdit to tweak our DVD menus. Not talking of the even harder days before these tools were available, when all we had were hex editors.

deank
17th March 2009, 15:22
Are you certain deank that this is always the case (tsmuxer changes PTS)? Or perhaps I should ask if the PTS that tsMuxeR makes aren't "close enough" to those in the original mpls that it will still work?

I think it was discussed in some other thread and the problem is not just PTS but SPNs (I think) when removing/changing tracks. It has to be. jdobbs should be able to explain as he knows about this stuff, not me.

turbojet
17th March 2009, 15:25
Well good news is BD-RB already has the ability to strip streams so at least one person knows some code to do it.

For blanking extras I think it might be just a short blank m2ts (http://www.sendspace.com/file/zaznql) (just like DVD editors) while updating clpi and mpls in the same manner as you do when stripping streams.

Editing the menu buttons is something else entirely though.

turbojet
19th March 2009, 16:59
Is anyone with a BD player and BD-R burnability or Sony BD player able to try this out for blanking unwanted extras?

kooibosmania
21st March 2009, 21:35
It's normal for this to happen, because the original mpls file for the "movie-only" m2ts file contains path to popup-menu m2ts, which you broke when replacing it with tsmuxer's one.

yes Deank right on the money

if you want to keep the orriginal structure u need to edit the mpls file the clpi and m2ts can be copied
u need to change several things in the mpls file such as intime outtime the stn table and al counters and startbits:sly:

also change the playmark starttimes according to the starttime of the tsmuxer mpls.

kooibosmania
21st March 2009, 21:43
Well good news is BD-RB already has the ability to strip streams so at least one person knows some code to do it.

For blanking extras I think it might be just a short blank m2ts (http://www.sendspace.com/file/zaznql) (just like DVD editors) while updating clpi and mpls in the same manner as you do when stripping streams.

Editing the menu buttons is something else entirely though.


yup your correct its indeed possible to replace the empty m2ts files for a short one i use 2 sec
the problem however is the multi playitem playlists.

i am in the works with an app that does this but there are so many diferent blu-ray structures its not an easy task. been in the testing fase for some time now the single m2ts movies i have under control but u have to scroll manually through the files, for i see no way to identify the fbi warnings and brain shit, not in mpls and not in clpi maybe someone can point me in the right direction.;)

as for menu buttons: someone ought to find out how to demux the m2ts menu files maybe smlabs ?

mini me
19th April 2009, 12:11
I've been using MadMonkey57's method (http://forum.doom9.org/showpost.php?p=1252686&postcount=4) to manually strip out unwanted audio and subtitle steams and it works mostly fine. I have found a problem with stripping subtitles though.

For example, if I have English + French subs, I want to strip out the French subs. When I play the disc in PowerDVD, I select French subs even though they don't exist.

When I manually strip out the French subs, PowerDVD won't show any subs. When I use BD-Rebuilder to strip French subs, PowerDVD shows the English subs. I prefer to reproduce BD-Rebuilder's way of showing English subs no matter which language I select, rather than showing no subs at all.

Where can I find which subtitle stream each language is mapped to? I tried BDEdit, tsmuxer and Clipinf Editor but none of them show this info.