Blu-Ray

From Indie IT Wiki
Revision as of 13:33, 21 March 2019 by imported>Plittlefield (→‎Extracting and using the Subtitles in a Blu-Ray or DVD Rip)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UHD Hashed Keys

https://www.makemkv.com/forum/viewtopic.php?f=12&t=16959

HOWTO: Play Blu-ray Movie Using MakeMKV Streaming

  1. Put Blu-ray disc in drive
  2. Start MakeMKV
  3. Scan disc
  4. Press the Stream button in the toolbar
  5. Wait for it to complete and issue the url
  6. Go to http://localhost:51000 in your web browser
  7. Click on /web/titles
  8. Click further until you see a link for stream/title0.m2ts or similar
  9. Right-click and Copy Link Location
  10. Start VLC Media Player
  11. File > Open Network Stream > Paste your link (e.g. http://localhost:51000/stream/title0.m2ts)
  12. You can play this across the network by changing the IP address to your streaming machine (e.g. http://192.168.0.2:51000/stream/title0.m2ts)

HOWTO: MakeMKV: Command Line Automation

When compiling, please compile latest ffmpeg first.

http://www.makemkv.com/forum2/viewtopic.php?f=3&t=224

Starting with version 1.8.6 MakeMKV no longer uses ffmpeg application, but links directly to libavcodec. Please note that most distributions ship a very outdated version of libavcodec (either from ffmpeg or libav projects). You will have to compile a recent ffmpeg (at least 2.0) if you need a FLAC encoder that handles 24-bit audio. Also you will have to enable libfdk-aac support in ffmpeg in order to use AAC encoder.Here are generic instructions for building makemkv-oss with latest ffmpeg:

- download ffmpeg tarball from http://ffmpeg.org/download.html

- configure and build ffmpeg:

./configure --prefix=/tmp/ffmpeg --enable-static --disable-shared --enable-pic --disable-yasm
make install

- configure and build makemkv-oss:

PKG_CONFIG_PATH=/tmp/ffmpeg/lib/pkgconfig ./configure
make
sudo make install

Basic information about the Drive...

makemkvcon -r info

Detailed information about the Disc...

makemkvcon -r info disc:0

This command rips all the movies on the disc which are longer than 3600 seconds (60 minutes). This means that it should skip any special features, etc. but don't forget to create the directory first (in this case ~/DVDs/MovieName/)...

mkdir ~/DVDs/MovieName/
makemkvcon --minlength=3600 mkv disc:0 all ~/DVDs/MovieName/

However, this does not stop the software from particular audio tracks, languages or subtitles, etc.

To do that, you need to use the new Profile and Selection Rules feature of MakeMKV.

Fire up the normal MakeMKV GUI, then go to Preferences, then tick Expert Mode. In the Advanced tab, put this in the Default Selection Rule box:

-sel:all,+sel:audio&(eng),-sel:(havemulti),-sel:mvcvideo,+sel:subtitle&(eng),-sel:special,=100:all,-10:eng

This will...

-sel:all               -> deselect all tracks
+sel:audio&(eng)       -> select all audio tracks in English
-sel:(havemulti)       -> Deselect all mono/stereo tracks which have a multi-channel track in same language
-sel:mvcvideo          -> Deselect 3D multi-view videos
+sel:subtitle&(eng)    -> Select all subtitle tracks in English
-sel:special           -> Deselect all special tracks (director's comments etc.)
=100:all               -> set output weight 100 to all tracks
-10:eng                -> decrement the weight of all tracks in English language by 10 (to make them the first ones in output)

Click Apply, then click OK, then close MakeMKV.

Now, we you run this again on the command line...

makemkvcon --minlength=3600 mkv disc:0 all ~/DVDs/MovieName/

...it should show something similar to this...

MakeMKV v1.8.5 linux(x64-release) started
Using direct disc access mode
Title #1 was added (20 cell(s), 2:02:46)
Title #2 has length of 12 seconds which is less than minimum title length of 3600 seconds and was therefore skipped
Title #3 has length of 12 seconds which is less than minimum title length of 3600 seconds and was therefore skipped
Title #4 has length of 1 seconds which is less than minimum title length of 3600 seconds and was therefore skipped
Operation successfully completed
Saving 1 titles into directory ~/DVDs/MovieName/

...you should end up with just 3 stream in your .mkv video file...

Stream #0.0(eng): Video: mpeg2video (Main), yuv420p, 720x576 [PAR 64:45 DAR 16:9], 7500 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s (default)
Stream #0.2(eng): Subtitle: dvdsub (default)

Thanks to http://www.avsforum.com/t/1417620/has-anyone-figured-out-how-to-automatically-rip-the-main-title-of-a-blu-ray/30

Ripping a Blu-Ray Movie in Linux

Method A

  1. Get Volume and Disk ID Keys : AACKeys
  2. Decrypt and Rip raw files from Blu-ray disc : DumpHD
  3. Examine .m2ts file for aspect ratio and fps : MediaInfo
  4. Extract video and audio tracks from .m2ts file : tsMuxeR
  5. Encode and make a single Matroska movie file : mkvMerge
  6. Play the .mkv movie file : MPlayer

Method B

  1. Decrypt and rip and encode : MakeMKV
  2. Play the .mkv movie file : MPlayer or VLC

Extracting and using the Subtitles in a Blu-Ray or DVD Rip

  • Decrypt and rip and encode, making sure you select the [x] Subtitles English track, in MakeMKV
  • Use mkvmerge and mkvextract from the MKVToolnix package to extract the subtitle track from the .mkv file...
$ sudo aptitude install mkvtoolnix

DVD

$ mkvmerge --identify movie.mkv
    Track ID 1: video (V_MS/VFW/FOURCC, DIV3)
    Track ID 2: audio (A_MPEG/L3)
    Track ID 3: audio (A_VORBIS)
    Track ID 4: subtitles (S_TEXT/UTF8)
    Track ID 5: subtitles (S_TEXT/UTF8)
$ mkvextract tracks movie.mkv 4:movie.srt

VLC can now play .srt files directly with the movie file of the same name...

$ ls
movie.mkv
movie.srt
$ vlc movie.mkv   (press V to toggle subtitles)

BD

Blu-rays take one more step...

$ mkvmerge --identify movie.mkv
    Track ID 1: video (V_MPEG4/ISO/AVC) 
    Track ID 2: audio (A_DTS) 
    Track ID 3: subtitles (S_HDMV/PGS)
$ mkvextract tracks movie.mkv 3:subtitles.sup

Use BDSup2Sub to convert the .sup file to 2 files .idx + .sub

$ java -jar BDSup2Sub.jar -o movie.sub movie.sup

Save the 2 new subtitle files with the same name as the movie and play the MKV in VLC...

$ ls
movie.idx
movie.mkv
movie.sub

$ vlc movie.mkv   (press V to toggle subtitles)

Thanks to http://www.makemkv.com/forum2/viewtopic.php?f=4&t=1416

    • WORK IN PROGRESS **

Convert .sub to .srt

http://virtuallyhyper.com/2013/09/combine-vobsub-subidx-format-subtitles-single-subrip-srt-format-file/

How To Play Blu-Ray Movies In Linux

Yes! At long last...

http://www.jaegertech.net/software/cross-platform-blu-ray-playback

Here is the script...

#!/bin/bash

#
# Cross-Platform Blu-ray Playback Script
# Release 1.0
#
# Depends on having curl, MakeMKV and VLC installed.
#
# Revision History:
#
# 05-OCT-2010:  Initial release.
#

# Is this a Mac?
if [ `uname` == "Darwin" ]; then
       MKVPATH="/Applications/MakeMKV.app/Contents/MacOS/"
       VLCPATH="/Applications/VLC.app/Contents/MacOS/"
else
       MKVPATH=""
       VLCPATH=""
fi

# Make sure we're not already decoding a disc.
killall makemkvcon

# Start streaming the first Blu-ray drive we find.
${MKVPATH}makemkvcon --upnp=1 --cache=128 stream disc:0 &

# Wait for the streaming server to be ready.
RESULT=1
COUNT=0
while [ $RESULT != 0 ]; do
       curl -f http://localhost:51000 -o /dev/null 2> /dev/null
       RESULT=$?
       sleep 1
       # Handle timeouts so we don't leave orphan makemkvcon tasks running.
       (( COUNT=${COUNT} + 1 ))
       if [ ${COUNT} == 60 ]; then
               killall makemkvcon
               exit 1
       fi
done

# Tell VLC to play the first title of the disc.
${VLCPATH}vlc http://localhost:51000/stream/title0.ts

# Shut down MakeMKV after VLC closes.
killall makemkvcon

Stream Blu-Ray Movie

makemkvcon stream disc:0 --cache=128 --minlength=4800

Play Blu-Ray Movie In Mplayer

mplayer -fs -demuxer lavf -vo vdpau:hqscaling=1 -vc ffmpeg12vdpau,ffh264vdpau,ffvc1vdpau,ffwmv3vdpau, \
-vfm ffmpeg, -ao pulse -ac fftruehd,ffdca,ffeac3,ffac3,fflpcm, -afm ffmpeg, -alang en -slang en \
-forcedsubsonly -channels 6 -af volnorm -cache 8192 -dvd-device /dev/dvd1 \
http://localhost:51000/stream/title0.ts