RED 2

Please post here for issues related to Blu-ray discs
scottlindner
Posts: 7
Joined: Sun Mar 09, 2014 12:24 am

Re: RED 2

Post by scottlindner » Sun Mar 09, 2014 10:40 pm

I want to thank everyone for the work you put into this. I was fortunate enough to Google my way out of the problem rather quickly thanks to you all. ;)

ixion
Posts: 11
Joined: Tue Dec 08, 2009 3:54 am

Re: RED 2

Post by ixion » Wed Mar 12, 2014 4:34 pm

I just want to add that I've now used this script on several movies (Red2, Hunger Games, Hunger Games Catching Fire, etc), and the script works every time. I've added a descriptive "usage" header to the script. Thanks again.

Code: Select all

# /usr/bin/perl find-playlist.perl <bluray root dir>
#
# This script will find the playlist that has matching mpls and clipinfo segments.
# The one with the longest number of segments is typically the correct main movie file.
#
# Example:
#
# Create a movie directory (e.g. RED2) and copy BDMV/CLIPINF and BDMV/PLAYLIST to it.
# You should now have a structure like this:
#
#    RED2/BDMV/CLIPINF
#    RED2/BDMV/PLAYLIST
#
# Then execute the script:
#
# /usr/bin/perl find-playlist.perl RED2
#
#

my $path = shift;

my $clips     = read_m2ts("$path/BDMV/CLIPINF", ".clpi");
my $playlists = read_m2ts("$path/BDMV/PLAYLIST", ".mpls");

foreach my $list (sort {$a <=> $b} keys %{$playlists}) {
  my @clp = @{$playlists->{$list}};

  my @playlist = ();

  my $next = $clp[0];
  push(@playlist, $next);
  my $last = $next;
  $next = ${$clips->{$last}}[0];

  if($next && $next != $last) {
    while ($next && $next != $last) {
      push(@playlist, $next);
      $last = $next;
      $next = ${$clips->{$last}}[0];
    }
  }

  my $mpls = join(",",@clp);
  my $cliplist = join(",",@playlist);

  if( $mpls eq $cliplist ) {
    printf("$list :\n");
    printf("  mpls     -> $mpls\n");
    printf("  clipinfo -> $cliplist\n");
  }

}

sub read_m2ts {

  my $dir = shift;
  my $ext = shift;

  my $out = {};

  opendir(DIR, "$dir") || die "can't open $dir";
  my @dir = readdir(DIR);
  closedir DIR;

  foreach my $file ( grep{ /$ext$/ } @dir ) {

    open(XIN, "<$dir/$file");
    my @infile = <XIN>;
    chomp @infile;


    my $tmp = join(" ", @infile);
    my @stuff = $tmp=~m/\d\d\d\d\dM2TS/g;
    my @streams = ();
    foreach my $strm (@stuff) {
      my $a = $strm;
      $a =~s/^0*//;
      $a =~s/M2TS$//;
      push(@streams, $a);
    }

    my $fnum = $file;
    $fnum =~s/$ext$//;
    $fnum =~s/^0*//;
    $out->{$fnum}=[@streams];

  }

  return $out;

}

jbuszkie
Posts: 3
Joined: Tue Jan 14, 2014 2:59 pm

Re: RED 2

Post by jbuszkie » Sun May 18, 2014 3:35 am

FYI.. The script did not work for me for catching fire... The correct playlist fails this test.. The two that do pass play the movie out of order.

Bahndit
Posts: 9
Joined: Sun Jun 01, 2014 4:34 am

Re: RED 2

Post by Bahndit » Fri Aug 29, 2014 2:16 am

I have used this script but I am not exactly sure what I should be doing with the output. Does anyone have any pointers on what I should be looking for when using this script? Thanks for your help in advance.

Leonoportman
Posts: 8
Joined: Sat Jul 05, 2014 3:42 am

Re: RED 2

Post by Leonoportman » Sun Aug 31, 2014 7:39 pm

I am confused here are we saying that this code change is required and I must upload Pearl to correctly RIP this File on Hand Brake or are we saying that this is answer to someone specific code Problem. I've incurred no uses making my MKV folders but when I load them into Hand Break I have like a 100 Different options to convert. At most I find 2 or 3 usally an extended version or and Alternate ending but in this Case I have 171 options of the Film I have started to convert all of them that are 1:55:48 (This includes 19, 79, 107, 151) but without ripping all 171 of these and burning up my processors to find out which one is correct I want to know if anyone knows which one is the correct one, I have seen this in several movies where the security is a such that it Blast with multiple versions of the movie and for the most part the movie is correct but there is spots where it swaps small 20 sec segment (Like Expendables 2) for another screen in the movie or it skips back 20 seconds making the movie have the record effect were the needle jumps back and forward. In this Case RED2_RENTAL this is what I have gotten. I can confirm 19 is one that jumps around I guess 170 to go unless anyone has any suggestions. mine doesn't go up to 577 so that out.

midnighwatcher
Posts: 31
Joined: Mon Mar 28, 2016 3:57 am

Re: RED 2

Post by midnighwatcher » Mon Mar 28, 2016 4:01 am

bottleneck70 wrote:UPC 77421200502...
Name: RED 2
Source file name: 00674.mpls(1)
Duration: 1:55:48
Chapters count: 17
Size: 31.5 GB
Segment count: 15
Segment map: 505,502,509,507,513,501,510,512,506,508,504,74,515,511,503
I'm in Canada with the Eone Blu-ray, UPC 774212929649. The 00674.mpls(1) source file on this disc matches everything exactly as shown above, including the segment map. Is this also correct for the Eone disc? Can anyone confirm?

Myrtledog
Posts: 18
Joined: Sun Nov 08, 2015 6:16 am

Re: RED 2

Post by Myrtledog » Sat Apr 02, 2016 1:47 am

Anyone have the segment order for a NetFlix rental disc?

swampdaddy
Posts: 74
Joined: Tue Aug 14, 2018 5:19 am

Re: RED 2

Post by swampdaddy » Mon Sep 02, 2019 5:51 am

I was not able to get this script to run on a High Sierra Mac... Ideas?

=========================
TopSecretMac:~ robert$ perl /Users/robert/Dropbox/Perl\ Scripts/RED_2.pl /Volumes/RED_2_RENTAL
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 8, near "$b\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 8, near "$playlists\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 8, near ") \"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 9, near "->\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 9, near "$list\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 9, near "}\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 16, near "->\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 16, near "$last\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 16, near "}\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 18, near ") \"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 19, near ") \"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 22, near "->\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 22, near "$last\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 22, near "}\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 23, near "}\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 24, near "}\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 29, near ") \"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 33, near "}\"
(Missing operator before \?)
Backslash found where operator expected at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 35, near "}\"
(Missing operator before \?)
Can't modify single ref constructor in scalar assignment at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 3, near "shift;"
syntax error at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 8, near "foreach "
Can't use global %\ in "my" at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 9, near "= @\"
syntax error at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 16, near "->\"
syntax error at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 18, near "if"
syntax error at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 22, near "->\"
syntax error at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 23, near "\}"
syntax error at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 29, near "if"
syntax error at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 33, near "\}"
Illegal declaration of subroutine main::read_m2ts at /Users/robert/Dropbox/Perl Scripts/RED_2.pl line 37.

=========================

Thanks,

R

oddeyeball
Posts: 33
Joined: Wed Sep 18, 2019 8:20 am

Re: RED 2

Post by oddeyeball » Tue Apr 14, 2020 12:16 am

00679.mpls seems to be correct for the US Amazon retail copy as well

therapy80301
Posts: 8
Joined: Wed Apr 01, 2020 9:11 pm

Re: RED 2

Post by therapy80301 » Mon May 25, 2020 11:12 am

New version...

Title information
Name: RED 2
Source file name: 00577.mpls
Duration: 1:55:48
Chapters count: 18
Size: 20.7 GB
Segment count: 15
Segment map: 507,504,501,517,502,511,514,513,519,508,503,512,518,516,510

SpaceElf
Posts: 1
Joined: Sun May 31, 2020 7:45 pm

Re: RED 2

Post by SpaceElf » Sun May 31, 2020 7:55 pm

therapy80301 wrote:
Mon May 25, 2020 11:12 am
New version...

Title information
Name: RED 2
Source file name: 00577.mpls
Duration: 1:55:48
Chapters count: 18
Size: 20.7 GB
Segment count: 15
Segment map: 507,504,501,517,502,511,514,513,519,508,503,512,518,516,510
DVDFab confirmed this is the correct playlist for Netflix disc.

Post Reply