Determining correct title on BD with MULTIPLE titles

Everything related to MakeMKV
itry2hide
Posts: 2
Joined: Sat Jul 04, 2015 12:44 am

Re: Determining correct title on BD with MULTIPLE titles

Post by itry2hide »

zeroepoch wrote:For anyone else looking to extract track information in a text format for easier processing try:

Code: Select all

makemkvcon -r info dev:/dev/sr0
Then you can grep the output using the runtime to get the matching tracks and then the segment maps from the matching tracks. You're now back to watching the segments and piecing them together.
I tried this command, and I keep getting an error message - Failed to open disc

Any ideas?
itry2hide
Posts: 2
Joined: Sat Jul 04, 2015 12:44 am

Re: Determining correct title on BD with MULTIPLE titles

Post by itry2hide »

rjbell4 wrote:I tried the command "makemkvcon -r info dev:/dev/sr0", and while it "works", I don't see runtimes (except for those skipped due to being too short) or segment lists in the output. Am I missing something? Is there a way to get that in the output?

And when I tried it, I get this output...

Code: Select all

bash-3.2# makemkvcon -r info dev:/dev/sr0
MSG:1005,0,1,"MakeMKV v1.9.10 darwin(x86-release) started","%1 started","MakeMKV v1.9.10 darwin(x86-release)"
MSG:1009,0,1,"Profile parsing error: default profile missing, using builtin default","Profile parsing error: %1","default profile missing, using builtin default"
MSG:2010,0,1,"Optical drive \"BD-RE HL-DT-ST BD-RE  WH16NS40 1.00d\" opened in OS access mode.","Optical drive \"%1\" opened in OS access mode.","BD-RE HL-DT-ST BD-RE  WH16NS40 1.00d"
DRV:0,2,999,12,"BD-RE HL-DT-ST BD-RE  WH16NS40 1.00","SICARIO","/dev/rdisk4"
DRV:1,256,999,0,"","",""
DRV:2,256,999,0,"","",""
DRV:3,256,999,0,"","",""
DRV:4,256,999,0,"","",""
DRV:5,256,999,0,"","",""
DRV:6,256,999,0,"","",""
DRV:7,256,999,0,"","",""
DRV:8,256,999,0,"","",""
DRV:9,256,999,0,"","",""
DRV:10,256,999,0,"","",""
DRV:11,256,999,0,"","",""
DRV:12,256,999,0,"","",""
DRV:13,256,999,0,"","",""
DRV:14,256,999,0,"","",""
DRV:15,256,999,0,"","",""
MSG:5010,0,0,"Failed to open disc","Failed to open disc"
TCOUNT:0
Woodstock
Posts: 10327
Joined: Sun Jul 24, 2011 11:21 pm

Re: Determining correct title on BD with MULTIPLE titles

Post by Woodstock »

What do you get when you try to open the disk in the graphic user interface? It is possible that there IS an error in reading the disk.
unkilbeeg
Posts: 4
Joined: Wed May 18, 2016 3:45 pm

Re: Determining correct title on BD with MULTIPLE titles

Post by unkilbeeg »

This is years late, but I wrote a bash script that will pull out the segment information for the likely candidates:

Code: Select all

#!/bin/bash

# Default device for Bluray drive
DEVICE="/dev/sr1"

SOURCE=$1
MOVIE=$2
DURATION=$3

if [  -z "$SOURCE"  -o  "$SOURCE" = "disc"  ]
then
        echo "Reading from default disc"
        echo "else specify file:dirname"
        SOURCE="dev:$DEVICE"
fi


if [ -z "$MOVIE" ]
then
        echo "Enter one word name :"
        read MOVIE
fi

FAIL=$( makemkvcon -r info $SOURCE | tee  $MOVIE.dump | grep Failed )
if [ $FAIL ]
then
        echo "Unable to read source"
        exit
fi

echo "Showing durations for $MOVIE.dump"
cat $MOVIE.dump | grep "TINFO:[0-9]*,9,"

if [ -z "$DURATION" ]
then
        echo "Enter duration as nn:nn:nn :"
        read DURATION
fi

makemkvcon -r info $SOURCE | grep -A 9 $DURATION | grep TINFO:[0-9][0-9]*,[12]6 | paste - - -d",\n"  | sed -e 's/TINFO:[0-9,]*"//g' | sed -e 's/"//g' | sort  > $MOVIE-candidates.csv
This will create a csv file that includes the mpls file, followed by all the segments for every mpls of the proper duration. It will ask you for the (one word) name for the dump files and the duration of the valid feature. I specify one word because I'm lazy and don't want to deal with spaces in names. I create a dump file with *everything* in it for backup and the csv with just the mpls files of interest.

Example line:

Code: Select all

00898.mpls,519,502,508,520,510,506,509,512,504,513,517,501,514,516,511,518,515,505,507,503
To zero in on the correct mpls, I play the segment file in the first position until I find the one that correctly begins the movie. I then filter for just the candidates that match that, e.g.,

Code: Select all

grep 519 GODS-candidate.csv
00898.mpls,519,502,508,520,510,506,509,512,504,513,517,501,514,516,511,518,515,505,507,503

Then I look play each of the segment files listed in the second position until I find one that is the continuation of that first one. Filter the candidates by the first two correct segments:

Code: Select all

grep 519,502 GODS-candidate.csv
00898.mpls,519,502,508,520,510,506,509,512,504,513,517,501,514,516,511,518,515,505,507,503

And so on until I'm down to just one candidate. With "Gods of Egypt" it took around 4 segments before I was down to one candidate from 300.

Edit: I've modified the script to fix a bug and it will now also display a list of all durations to allow you to choose if you don't already know which one to use. You'll still have to type it in. If your optical device is different from mine, you should edit the script and set DEVICE to your device, probably /dev/sr0. I have a DVD drive at sr0, my BluRay is at sr1.
dcoke22
Posts: 3092
Joined: Wed Jul 22, 2020 11:25 pm

Re: Determining correct title on BD with MULTIPLE titles

Post by dcoke22 »

I was messing with this on my Mac (running Mojave). It wasn't working initially until I figured out that the paste syntax is a bit different. On my Mac, paste needs the -d list before the input files. As written, the paste command is:

Code: Select all

paste - - -d",\n"
When I changed it to this:

Code: Select all

paste -d ",\n" - -
then it worked. I don't have a linux box handy to know if this altered syntax also works there too.
Post Reply