Log in

View Full Version : Split Blu-Ray by chapters


Alcohor
15th September 2009, 18:03
Hi all!

I've got a Blu-Ray of a TV Series and there are 4 episodes merged in one m2ts. I'd like to decrypt and to split them by chapters (like DVDDecrypter) , how I can do that?

Inspector.Gadget
15th September 2009, 18:05
I've been looking for a way to do this for concert Blu-rays forever. Short of remuxing to MKV and then splitting at timecodes that correspond to chapter markers, I'm not sure it can be done.

JohnAStebbins
16th September 2009, 05:03
What platform does said tool need to run on? I've got some BD parsing code I wrote that I can easily enhance to extract sub-ranges of chapters from a BD. It's a cli app and requires that the BD be pre-decrypted.

cRTrn13
16th September 2009, 12:05
What platform does said tool need to run on? I've got some BD parsing code I wrote that I can easily enhance to extract sub-ranges of chapters from a BD. It's a cli app and requires that the BD be pre-decrypted.

I'd be interested in knowing a bit more about the format of how this data is stored on the BD. Where is it stored (you mention that it need to be decrypted first - is this just regular AACS)? Would you be able to provide me with the parsing code that you have or with some pointers on where to start?

laserfan
16th September 2009, 14:55
If HDConcertRipper (http://forum.doom9.org/showthread.php?t=145140) can't do what you want, maybe you can persuade the author to fix it so it saves video with the audio?

Alcohor
16th September 2009, 18:10
Sorry I'm late but here I am :p

If HDConcertRipper can't do what you want, maybe you can persuade the author to fix it so it saves video with the audio?

I didn't know this app, now I'll ask the author

What platform does said tool need to run on? I've got some BD parsing code I wrote that I can easily enhance to extract sub-ranges of chapters from a BD. It's a cli app and requires that the BD be pre-decrypted.

Great, I'd like to have it on Windows.

Sorry for my very crappy English :p

JohnAStebbins
17th September 2009, 01:42
cRTrn13, my source can be found here Source code (http://www.stebbins.biz/source/bdtools-src-1.2.tgz)
Look in the doc directory for a collection of notes I took while reverse engineering things and some sources of information I used.
Also, vlc has added code for parsing BD playlists etc. If you check out the latest vlc from git, look in modules/access/bd.

Alcohor, binaries for windows are here Window binaries (http://www.stebbins.biz/binaries/bdtools-1.2.zip)
There are 3 programs. Running the programs with no parameters will print a help message.

mpls_parse parses playlists and dumps various information contained in them. It's useful for finding which playlist is the main title. For multi-part titles, it can show you the collection of m2ts files and the order they play in.

Examples:
Dump a list of all the titles and their m2ts clips, ignore titles shorter than 2 min, ignore duplicates titles, ignore titles that have multiple duplicate clips

# mpls_dump.exe -fl \path\to\BD

Dump a list of the m2ts clips for a particular title

# mpls_dump.exe -l \path\to\BD\BDMV\PLAYLIST\00001.mpls

Dump a list of the chapter marks for a particular title

# mpls_dump.exe -c \path\to\BD\BDMV\PLAYLIST\00001.mpls



clpi_parse does the same for clipinfo files. The information in clipinfo isn't all the useful to look at, but bdsplice uses this info to properly splice multi-part titles and find chapter boundaries.

Example:
Dump a list of random access points for clip 00001.m2ts

# clpi_dump.exe -i \path\to\BD\BDMV\CLIPINF\00001.clpi


bdsplice takes as input a playlist number and root directory of the BD tree and splices multi-part titles into a singe m2ts. It now takes a chapter range parameter and creates an m2ts with those chapters.

Example:
Create m2ts file from title 00001.mpls and chapter range 1-4

# bdsplice.exe -t 1 -c 1-4 \path\to\BD outfile.m2ts

Inspector.Gadget
17th September 2009, 01:47
Wow, JohnAStebbins, this is great news. How would one use bdsplice to automate dumping each chapter to a separate m2ts or component streams split by chapter? Thanks!

JohnAStebbins
17th September 2009, 03:09
How would one use bdsplice to automate dumping each chapter to a separate m2ts or component streams split by chapter? Thanks!

I can't help with batch scripting. I rarely use windows at all. In bash, I would do something like the following:

#!/bin/bash

while getopts "t:c:" opt; do
case $opt in
t)
title=$OPTARG
;;
c)
chapters=$OPTARG
;;
*)
echo "Invalid option: $opt"
exit
esac
done

if [ "x$title" == "x" ]; then
echo "Title required"
exit
fi

if [ "x$chapters" == "x" ]; then
echo "Chapter count required"
exit
fi

shift $((OPTIND-1))
bdroot=$1

for (( x = 1; x <= $chapters; x++ )); do
bdsplice -t $title -c $x $bdroot $x.m2ts
done

Inspector.Gadget
17th September 2009, 03:10
OK, that's a start, thanks!

Alcohor
19th September 2009, 09:28
Great tool, thanks!

banzemanga
19th October 2009, 07:00
@JohnAStebbins, can you upload the tools again? For some reason your old links doesn't work. Thanks.

setarip_old
19th October 2009, 07:12
@Alcohor

If all you need is a list of chapter times, once you've ripped your BluRay, just drop the proper "Playlist" into "tsMuxeR" - and then click on the "BluRay" tab at the top...

PatlaborForce
19th October 2009, 17:55
@Alcohor

If all you need is a list of chapter times, once you've ripped your BluRay, just drop the proper "Playlist" into "tsMuxeR" - and then click on the "BluRay" tab at the top...

He doesn't just want the chapter times, as the title says he wanted to split on chapter points.

JohnAStebbins
19th October 2009, 18:41
Updated files:
windows binaries: http://www.stebbins.biz/binaries/bdtools-1.4.zip
source: http://www.stebbins.biz/source/bdtools-1.4.tgz

Note that http://www.stebbins.biz/source and http://www.stebbins.biz/binaries are browsable. So when I update the files to a new version, you can always browse the directory for them.

banzemanga
20th October 2009, 02:18
How do i specify the outputs of the dump files? I mean i have the actual mpls and clpi files on a cd (can't write on them) and i don't want to copy those files to the harddrive due to the fact i don't have enough space left.

JohnAStebbins
20th October 2009, 23:26
I'm not really sure what you're asking. But I'll throw something out there and see if any of it helps. For starters, the clpi and mpls files are all very small. 10s of KB for the largest ones. As for dump files, mpls_dump and clpi_dump just print summaries of mpls/clpi files to stdout. You can redirect that to a file if you wish with file redirection. bdsplice will splice together the assorted parts of a title and it's output is specified as the last parameter. Help for all three utilities can be gotten by running them with no parameters.

banzemanga
21st October 2009, 01:00
I see. I thought hat each dump actually would write a dump file which contains information for the bdslice. Let me try this right away.

JohnAStebbins
21st October 2009, 18:44
heh, after re-reading my earlier post that describes the tools, I can see how you might think that. Sorry about the confusion.

hamletiii
1st November 2009, 04:47
I'm trying to use bdsplice to get chapter 1-17 from a BD, here is the command I used:
bdsplice -t 1 -c 1-17 "L:" "G:\GSG\o.m2ts"

Now instead of getting only chapter 1-17, bdsplic copies the entire m2ts as is... The original m2ts on the disc is 44GB, has 37 chapters divided pretty evenly, so I'm expecting to get somewhere about half the size. Not sure what I'm doing wrong. Need some help, thx.

JohnAStebbins
2nd November 2009, 04:14
Ugh. I introduced a bug in chapter marker parsing recently. Here's an update that fixes this problem.

http://www.stebbins.biz/binaries/bdtools-1.5.zip

IdentDee
28th November 2009, 11:51
Ugh. I introduced a bug in chapter marker parsing recently. Here's an update that fixes this problem.

http://www.stebbins.biz/binaries/bdtools-1.5.zip

Could you please update the sourcecode too? Or post a diff?

I am on Mac OS X and would like to compile your code without the chapter bug.

Greetings,

IdentDee

update: just found the incorrect bit_skip. :)

flights_of_fantasy
10th December 2009, 11:40
Заказ и вызов такси. Митино, Тушино, Строгино (СЗАО)

Компания «Новое Такси» предлагает Вам возможность быстро и комфортабельно добраться до нужного Вам места. На наших такси, парк которых полностью состоит из иномарок, оборудованных кондиционерами, работают опытные водители. Наши диспетчеры вежливы и внимательны, они уведомят Вас о стоимости поездки и сообщат о прибытии вызванного автомобиля, а наши цены Вас приятно удивят.

Для постоянных клиентов «Новое Такси» предоставляет скидки

Возьмите промокод у нашего водителя и получите скидку при заказе через мобильное приложение!
Также действует скидка для пенсионеров. Если Вы вызываете такси в Митино, то Вам повезло вдвойне — скидка на маршрут туда-обратно — 50%! Полный перечень скидок смотрите здесь.

Самые выгодные поездки от компании «Новое Такси» - в СЗАО: Строгино, Митино, Тушино, Сходненская, Красногорск, Куркино.

Территория, которую мы обслуживаем, не ограничена столицей. Мы доставим Вас не только в близлежащие Химки, Сходню или Красногорск — такси по области обойдется Вам даже дешевле, чем в пределах МКАД.

Ваш друг прилетает в аэропорт Шереметьево, а Вы живете на Теплом Стане и не хотите оплачивать проезд через всю Москву и обратно? Для Вас будет выгоднее заказать машину в «Новом Такси». Водитель с табличкой встретит пребывающего в Шереметьево, и такси быстро домчит его до нужного места.
Кроме традиционного такси мы предлагаем такие услуги как перевозка животных, курьерская доставка, услуга "Трезвый водитель", буксировка транспорта, аренда авто.

У «Нового Такси Митино» имеются программы обслуживания корпоративных клиентов и система скидок.

Компания "Новое Такси" выбрала для работы один из самых привлекательных и живописных для проживания округов Москвы - Северо-Западный. Мы обслуживаем все восемь районов СЗАО - Куркино, Митино, Покровское-Стрешнево, Северное Тушино, Строгино, Хорошево-Мневники, Южное Тушино и Щукино. Площадь СЗАО составляет одну десятую часть столицы. Всего в СЗАО проживает более 800 тысяч человек. Мы с радостью довезем каждого жителя и гостя округа!
В СЗАО расположены такие станции метро как Строгино, Митино, Щукинская, Тушинская, Сходненская. Один из двух округов Москвы, где метро вышло за пределы МКАД - СЗАО, а именно - район Митино. Экологическое богатство СЗАО - Москва-река, Строгинская пойма, Серебряный Бор, парк Покровское-Стрешнево, Химкинское водохранилище, река Сходня в Куркино. Эти места являются любимыми местами отдыха москвичей. В жаркие дни сюда устремляется множество жаждущих искупаться или погулять в тени деревьев. "Новое Такси" доставит Вас в место отдыха и обратно! Аэродром на Тушинском поле - популярная площадка для авиашоу и праздничных мероприятий, фестивалей, концертов.

В Щукино расположился всемирно известный Курчатовский институт и ряд других НИИ.
Известный еще с 90-х годов по всей столице и области радиорынок в Митино до сих предлагает широкий выбор радиотехники.
В Сходню переехал любимый антикварами и просто зеваками блошиный рынок из Лианозова.
Через дорогу, за МКАД, на территории Красногорска расположился современнейший международный выставочный центр Крокус-Экспо. Также в Красногорске сооружен ряд других достопримечательных сооружений, например, Всесезонный крытый горнолыжный спортивный комплекс, где вы можете в любое время года покататься на горных лыжах. Как видите, в СЗАО и окрестностях есть куда съездить. А если ехать - то на "Новом Такси"! http://taxi-mitino-krasnogorsk.ru/

foxyshadis
10th December 2009, 21:03
Blu-Ray ðóëèò ëó÷øå åãî íå âèäàë ïîêà

Right. What language is that supposed to be?

~Revolution~
10th December 2009, 23:56
Blu-Ray ðóëèò ëó÷øå åãî íå âèäàë ïîêà

:rolleyes:

titou10
6th January 2010, 02:10
Ugh. I introduced a bug in chapter marker parsing recently. Here's an update that fixes this problem.

http://www.stebbins.biz/binaries/bdtools-1.5.zip

@JohnAStebbins, thanks a lot for those tools.

I'm using bdsplice quite a lot to merge m2ts files and use my WDTV-LIve toy (and mpls_dump too)

Two things:
- As request by someone else, could you upload the sources for v1.5 (100% fedora user here). Big thanks!
- I think I've found a bug in mpls_dump. The duration seconds are always "00". e.g, for the latest harry poter, the main PL length is 02:33:30 (153m 30s) but mpls_dump report it as 153mn 00s and all the other PL have also their "seconds" set to "00"

Also I was about to write a GUI in front of your tools before I discovered the hdcookbook site with a lot of intresting info about BD: https://hdcookbook.dev.java.net/

I don't know If you know that site, but they provide the java source to taylor BD_J app and some tools to create/display mpls, clpi, bdmv,index and the whole BD structure etc...

So I'm now writing a Java version of a tool with the goal to be multi-os (Thanks Java) and display all the avialable infos on mpls, clpi, stream etc... (somewhat like BDInfo but with more information)

If someone is interested, I may post it somewhere when I'll have a beta version.

AMED
14th January 2010, 06:36
@JohnAStebbins

Thank you for this tool, i have just been trying to backup Fringe and when i rip it with dvdfab all 4 episodes show up as a single 3 hour item.

http://img85.imageshack.us/img85/8799/dvdfab.th.png (http://img85.imageshack.us/i/dvdfab.png/)

Using your tool allowed me to split it up perfectly.

EDIT: Ok maybe not so perfect
eac3to v3.17
command line: "C:\Program Files (x86)\megui\tools\eac3to\eac3to.exe" "F:\MainMovie\FRINGE_SEASON_1_DISC_1\Fringe - S01xE01 - Pilot.mts" 1:"F:\MainMovie\FRINGE_SEASON_1_DISC_1\T1_Video - .mkv" 2:"F:\MainMovie\FRINGE_SEASON_1_DISC_1\T2_Audio - 5.1 channels.ac3" 3:"F:\MainMovie\FRINGE_SEASON_1_DISC_1\T3_Subtitle - 3: Subtitle (PGS).sup" -progressnumbers
------------------------------------------------------------------------------
M2TS, 1 video track, 1 audio track, 1 subtitle track, 1:21:39, 24p /1.001
1: VC-1, 1080p24 /1.001 (16:9)
2: AC3, 5.1 channels, 640kbps, 48khz, dialnorm: -27dB
3: Subtitle (PGS)
[v01] Extracting video track number 1...
[s03] Extracting subtitle track number 3...
[a02] Extracting audio track number 2...
[a02] Removing AC3 dialog normalization...
[v01] Muxing video to Matroska...
[a02] Creating file "F:\MainMovie\FRINGE_SEASON_1_DISC_1\T2_Audio - 5.1 channels.ac3"...
[s03] Creating file "F:\MainMovie\FRINGE_SEASON_1_DISC_1\T3_Subtitle - 3 Subtitle (PGS).sup"...
[v01] [1:21:39] The source file seems to be damaged (discontinuity). <WARNING>
[a02] [1:21:40] The source file seems to be damaged (discontinuity). <WARNING>
[v01] [1:21:39] Detected PTS break, increasing PTS by 41.7ms... <WARNING>
[a02] [1:21:40] Detected PTS break, increasing PTS by 32.0ms... <WARNING>
Added fps value (24 /1.001) to MKV header.
Video track 1 contains 117479 frames.
Subtitle track 3 contains 902 captions.
eac3to processing took 8 minutes, 42 seconds.
Done.

@titou10
If you do make a JAVA version of this tool, please post it here.