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 > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th March 2007, 14:30   #1  |  Link
zgx
Registered User
 
Join Date: Feb 2007
Posts: 94
Guide: Blu-ray MKV remux

Guide: Blu-ray MKV remux v1.0
Last updated 2007-03-29

Feedback and improvements are most welcome.


Download and install the needed software
Muxing/demuxing software
Haali Media Splitter (make sure you get the latest version)
http://haali.cs.msu.ru/mkv/

MKVtoolnix pre-builds
http://www.bunkus.org/videotools/mkvtoolnix/win32/pre/

Xport Transport Stream Demuxer
http://www.w6rz.net/


To compress LPCM tracks to FLAC
flac 1.1.4
http://flac.sourceforge.net/download.html

Wavewizard 0.45b
http://www.rarewares.org/wavewiz/wavewizardv0.54b.zip


Instructions
When you install Haali Media Splitter click "Enable MPEG-PS support".



Blu-ray with MPEG2 and AC3/DTS

Step 1a: Making the MKV - if lucky
If you are lucky gdsmux will find all the streams that you want and you can complete the remux with just a few clicks.

Start gdsmux.exe (found under your Haali Media Splitter installation).
- Add the m2ts file containing your movie.
- If you find all your streams you want select them, put in an output filename and press "Start".




Step 1b: Making the MKV - if less lucky
Sometimes gdsmux will not find the audio tracks that you want and you have to use an alternative way. In the example below we did not find the DTS track that we wanted:



1. Demux the audio track:

Try the following commands:
xport -h 00000.m2ts 1 3 1
xport -h 00000.m2ts 1 3 2
xport -h 00000.m2ts 1 3 3
...
...

For each command you will see information about the audio tracks. For example:
Audio Bitrate = 448000, Audio Sampling Rate = 48000
Audio Mode = 3/2, bsid = 6, bsmod = 0


This information helps you find the track you want. Break with ctrl-break if you find a audio track you don't want.

What I have seen is that no information is given for certain DTS tracks. Instead you will just see:
ts rate = unspecified

To make sure you get the track you want break after a few seconds and then play the track you got. It's named "bits0001.mpa". You can also drag and drop the track into mkvmerge and it will display what kind of track you got. See example below:



After you find the audio track you want let the xport command run so you get the complete track.


2. Create the MKV
Chances are good that gdsmux will not recognize the audio track you just demuxed so you will have to use mkvmerge instead.

- Drag and drop the m2ts file and the audio track to mkvmerge.
- Select a name for your new MKV file.
- You may also want to name the movie under "Global" and then "File/Segment title" and make some other smaller adjustments to your MKV.
- Press "Start Muxing"





Blu-ray with H.264/AVC
I have not done that much testing with H.264/AVC but I know that I had some problems when I tried it out a month ago. Lately I have been successful using gdsmux that comes with Haali Media Splitter (the latest version from 2007-03-28). I don't have the CPU to play the H.264/AVC video to verify that it works but it seams ok. I don't know how well mkvmerge handle these files yet.



Saving your DTS-HD track for future use
If your Blu-ray features a DTS-HD track that you muxed into an MKV above you did only get a 1.5 Mbps "DTS core" of the DTS-HD. At the moment we cannot mux nor decode the entire DTS-HD track but we can save it for future use. If you have not already done so use xport to demux the DTS-HD track and save it for future use.



Blu-ray with FLAC (LPCM)
Step 1: Create you FLAC track

1. Extract the LPCM stream from Blu-ray
xport -h 00000.m2ts 1 3 2


2. Prepare file for WaveWizard
The channels in the LPCM file are mapped "L,R,C,BL,BR,LFE" as opposed to "L,R,C,LFE,BL,BR". This is corrected with Wavewizard but the program won't recognize it (perhaps because it's raw with big endian or something). Let’s convert it to a better format. There is probably an easy way to do this but I have not really found it so I use FLAC for the conversion.

flac -0 --force-raw-format --endian=big --channels=6 --bps=16 --sample-rate=48000 --sign=signed -o "temp.flac" - < bits0001.mpa
flac -d temp.flac -o temp.wav


3. Map channels
Start Wavewizard

- Enter Channel mapping (F2) and create a new mapping "0 1 2 5 3 4".
- Select your new channel mapping.
- Enter Preferences (F4) and make sure you enable channel mapping and make sure you set ouput to "Raw samples".
- Click "Convert" and create a new wave file.










4. Encode your FLAC
flac -8 --force-raw-format --endian=little --channels=6 --bps=16 --sample-rate=48000 --sign=signed -o "final.flac" - < temp.raw


Step2: Create your MKV
Start MKVmerge.
- Drag and drop the m2ts file and the audio track to mkvmerge.
- Select a name for your new MKV file.
- You may also want to name the movie under "Global" and then "File/Segment title" and make some other smaller adjustments to your MKV.
- Press "Start Muxing"


Last edited by zgx; 29th March 2007 at 14:42.
zgx is offline   Reply With Quote
Old 30th March 2007, 17:13   #2  |  Link
Rectal Prolapse
Registered User
 
Join Date: Mar 2005
Posts: 433
Thanks zgx.

Any word on how to demux the subtitle tracks from a bluray disc, and then OCR them into SRT files?
Rectal Prolapse is offline   Reply With Quote
Old 30th March 2007, 22:04   #3  |  Link
tomos
Registered User
 
Join Date: Feb 2002
Location: UK
Posts: 534
just tried it now. dies on step 2 with flac.

i get the error -
Quote:
(No runtime statistics possible; please wait for encoding to finish...)
-: ERROR: got partial sample
and the resulting file is just over a gig - against the originals 3 gigs.
tomos is offline   Reply With Quote
Old 30th March 2007, 22:34   #4  |  Link
zgx
Registered User
 
Join Date: Feb 2007
Posts: 94
Quote:
Originally Posted by tomos View Post
just tried it now. dies on step 2 with flac.

i get the error -

and the resulting file is just over a gig - against the originals 3 gigs.
Hmm ok thats wierd. Are you sure you are using the exact same syntax (for example --endian=big)?
zgx is offline   Reply With Quote
Old 30th March 2007, 22:39   #5  |  Link
zgx
Registered User
 
Join Date: Feb 2007
Posts: 94
I also remember that on some of the step the process aborted when I connected to another computer over remote desktop from the computer I was "ripping" on.. really strange.. it happened every time I did it. Could perhaps be the error you had Tomos?
zgx is offline   Reply With Quote
Old 30th March 2007, 22:39   #6  |  Link
tomos
Registered User
 
Join Date: Feb 2002
Location: UK
Posts: 534
deffo. copied and pasted the line in as is. filename was the same

re: remote desktop. dont use it.
tomos is offline   Reply With Quote
Old 30th March 2007, 23:41   #7  |  Link
zgx
Registered User
 
Join Date: Feb 2007
Posts: 94
Quote:
Originally Posted by tomos View Post
deffo. copied and pasted the line in as is. filename was the same

re: remote desktop. dont use it.
When you used xport to demux the audio track did you get information that it was a LPCM track? It's not a DTS-HD track or something that you have?
zgx is offline   Reply With Quote
Old 31st March 2007, 00:31   #8  |  Link
tomos
Registered User
 
Join Date: Feb 2002
Location: UK
Posts: 534
it's casino royale and that has PCM audio, not DTS-HD

the 'sox' commands that i tried 1st (not your guide, the one mixed into the evob thread)

Quote:
sox -B -r48000 -t .raw -c 6 -2 -s bits0001.mpa file.wav
that gives me a wav file i can play fine but cant do anything with after (wavewizard wont accept it). the commands used in your guide also dont work for me

---

just redid everything and still the same. the flac method craps out. the sox method works upto the point of making a wav that can be played with sonics audio decoder only.

Last edited by tomos; 31st March 2007 at 00:58.
tomos is offline   Reply With Quote
Old 31st March 2007, 04:28   #9  |  Link
toxik
Registered User
 
Join Date: Jul 2006
Posts: 12
I can't seem to be able to demux Casino Royale's avc video stream properly. Can someone help me with how they did it. I tried both gdsmux and xport, both with no success. What command line should I use with xport?
toxik is offline   Reply With Quote
Old 31st March 2007, 04:50   #10  |  Link
tomos
Registered User
 
Join Date: Feb 2002
Location: UK
Posts: 534
xport -h "x:\whatever.m2ts" 1 1 1

the last one should be a 2 ( 1 1 2 ) if you want the LPCM track. the first digit is the (afaik) program stream. the 2nd is the video stream and the 3rd is the audio stream.
tomos is offline   Reply With Quote
Old 31st March 2007, 05:04   #11  |  Link
toxik
Registered User
 
Join Date: Jul 2006
Posts: 12
Quote:
Originally Posted by tomos View Post
xport -h "x:\whatever.m2ts" 1 1 1

the last one should be a 2 ( 1 1 2 ) if you want the LPCM track. the first digit is the (afaik) program stream. the 2nd is the video stream and the 3rd is the audio stream.
that's what i used, the file I got was only 13GB though, where is the original m2ts is 35gbs. Surely, the audio can't make up the rest of the 20gbs right?
toxik is offline   Reply With Quote
Old 31st March 2007, 06:58   #12  |  Link
zgx
Registered User
 
Join Date: Feb 2007
Posts: 94
Quote:
Originally Posted by tomos View Post
just redid everything and still the same. the flac method craps out. the sox method works upto the point of making a wav that can be played with sonics audio decoder only.
Ok if you use the sox method so you have a WAV you can play. You can compress that WAV in MediaCoder to FLAC and then decompress it to WAV again and it will be readable in Wavewizard.
zgx is offline   Reply With Quote
Old 31st March 2007, 14:33   #13  |  Link
Darth Pinous
Registered User
 
Darth Pinous's Avatar
 
Join Date: Feb 2007
Location: In a galaxy far, far away
Posts: 51
Quote:
Originally Posted by toxik View Post
that's what i used, the file I got was only 13GB though, where is the original m2ts is 35gbs. Surely, the audio can't make up the rest of the 20gbs right?
I had the same problem, even if I only demuxed the LPCM soundtrack, so maybe it's because of the source...

Anyway, it works if you use graphedit with filesource(async) -> sonic HD demuxer -> Sonic Video Decoder, so if you want to reencode, it's still possible. (same goes for the LPCM soundtrack).
Darth Pinous is offline   Reply With Quote
Old 31st March 2007, 21:50   #14  |  Link
tomos
Registered User
 
Join Date: Feb 2002
Location: UK
Posts: 534
Quote:
Originally Posted by toxik View Post
that's what i used, the file I got was only 13GB though, where is the original m2ts is 35gbs. Surely, the audio can't make up the rest of the 20gbs right?

Quote:
Originally Posted by Darth Pinous View Post
Anyway, it works if you use graphedit with filesource(async) -> sonic HD demuxer -> Sonic Video Decoder, so if you want to reencode, it's still possible. (same goes for the LPCM soundtrack).
good thing i checked. mine was short too. something freaky with the m2ts source - has to be. dumping with graphedit/hd pump have me a 24.6 GB h264 file that's ok.
tomos is offline   Reply With Quote
Old 1st April 2007, 09:28   #15  |  Link
Darth Pinous
Registered User
 
Darth Pinous's Avatar
 
Join Date: Feb 2007
Location: In a galaxy far, far away
Posts: 51
Quote:
flac -0 --force-raw-format --endian=big --channels=6 --bps=16 --sample-rate=48000 --sign=signed -o "temp.flac" - < bits0001.mpa
Strange, when I use this line, FLAC stops the encode as soon as the FLAC output reaches 2GB... I tested with sign=signed and sign=unsigned, but no difference... 2 GB is the limit for me... Where could it come from ? I used FLAC 1.1.4 from the link you post.
Darth Pinous is offline   Reply With Quote
Old 1st April 2007, 09:44   #16  |  Link
klona
Registered User
 
Join Date: May 2002
Location: Frogland
Posts: 520
Quote:
Originally Posted by Darth Pinous View Post
... 2 GB is the limit for me...
Sure there isn't any 2GB FAT32 limitation on your system ? Perhaps you already know but NTFS is needed for more than 2GB files.
klona is offline   Reply With Quote
Old 1st April 2007, 13:37   #17  |  Link
zgx
Registered User
 
Join Date: Feb 2007
Posts: 94
Quote:
Originally Posted by Darth Pinous View Post
Strange, when I use this line, FLAC stops the encode as soon as the FLAC output reaches 2GB... I tested with sign=signed and sign=unsigned, but no difference... 2 GB is the limit for me... Where could it come from ? I used FLAC 1.1.4 from the link you post.
2 GB FLAC ouput .. sounds like a huge LPCM file hmm. Dumb question but are you sure it's a LPCM track you are trying to encode and not something else like a DTS track? You could also try to increase the compression with -8 instead of -0 but 1.1.4 should support larger files then 2 GB.
zgx is offline   Reply With Quote
Old 1st April 2007, 19:34   #18  |  Link
Chumbo
Registered User
 
Chumbo's Avatar
 
Join Date: Feb 2005
Posts: 585
Quick question regarding Casino Royale. I dumped the lpcm track via Graphedt which gave me a 4.6Gig track. I'm able to convert it via sox, but then I get a wav that's only 19min 55sec in length. I can convert the wav just fine to a 5.1 ac3 but it's still 19:55 in length. Anyone else experience the same problem?

My graphedt chain is simple:
file source (async) -> sonic hd demuxer -> dvb hdtv dump

I made sure to select the right stream under the demuxer filter properties before proceeding. I also tried sticking the audio decoder between the demuxer and dump plus several variations of having ac3filter too. Always with the same result.

I was able to dump the main 5.1 track just fine.
__________________
Chumbo
Chumbo is offline   Reply With Quote
Old 1st April 2007, 20:07   #19  |  Link
tomos
Registered User
 
Join Date: Feb 2002
Location: UK
Posts: 534
Quote:
Originally Posted by zgx View Post
2 GB FLAC ouput .. sounds like a huge LPCM file hmm. Dumb question but are you sure it's a LPCM track you are trying to encode and not something else like a DTS track? You could also try to increase the compression with -8 instead of -0 but 1.1.4 should support larger files then 2 GB.
redownloaded FLAC again, deffo v1.1.4

stalls on 2GB files. gives an error saying the disk is full (as a guess) but there's 70 gigs left on the drive so that's not the issue

Quote:
flac 1.1.4, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
welcome to redistribute it under certain conditions. Type `flac' for details.

(No runtime statistics possible; please wait for encoding to finish...)

-: ERROR during encoding
state = FLAC__STREAM_ENCODER_CLIENT_ERROR

An error occurred while writing; the most common cause is that the disk is full.
tomos is offline   Reply With Quote
Old 2nd April 2007, 04:35   #20  |  Link
Rectal Prolapse
Registered User
 
Join Date: Mar 2005
Posts: 433
FLAC command-line program is known to have a limit of 2GB output.

MediaCoder 0.5 might do what you want - it gets around the limitation somehow (using named pipes?).
Rectal Prolapse is offline   Reply With Quote
Reply

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 07:46.


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