Skip to content

Instantly share code, notes, and snippets.

@coolaj86
Last active July 3, 2024 03:20
Show Gist options
  • Save coolaj86/4167539 to your computer and use it in GitHub Desktop.
Save coolaj86/4167539 to your computer and use it in GitHub Desktop.
Play Blu-Rays on Linux and OS X (free)
#!/bin/bash
#
# Original Source: http://whatnotlinux.blogspot.com/2011/12/launch-blu-ray-with-makemkv-and-vlc-in.html
#
# 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="/usr/bin/"
VLCPATH="/usr/bin/"
fi
if [ ! -e "${MKVPATH}makemkvcon" ]
then
echo 'Install MakeMKV first:'
echo 'http://makemkv.com/download/'
exit 1
fi
if [ ! -e "${VLCPATH}vlc" ]
then
echo 'Install VLC first:'
echo 'http://videolan.org'
exit 1
fi
# Make sure we're not already decoding a disc.
killall makemkvcon
# Start streaming the first Blu-ray drive we find.
# Assume the main title (chapter 1) must be at least 3 minutes (180s) long
${MKVPATH}makemkvcon --upnp=1 --cache=128 --minlength=180 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.
# Wait at least 5 minutes (300s) for the right title to be found
(( COUNT=${COUNT} + 1 ))
if [ ${COUNT} == 300 ]; 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
#!/bin/bash
set -x
if [ `uname` == "Linux" ]
then
curl -L -s https://gist.githubusercontent.com/coolaj86/4167539/raw/makemkv.bash | bash
fi
mkdir -p /usr/local/bin
curl -L -s https://gist.githubusercontent.com/coolaj86/4167539/raw/blu-play.bash -o /usr/local/bin/blu-play
chmod a+x /usr/local/bin/blu-play
# For Linux only
echo "You're on Linux. Yay! However, this compile will take a while..."
MKV_VERSION="1.8.13"
sudo apt-get install -y \
curl \
wget \
vlc \
build-essential \
libc6-dev \
libssl-dev \
libexpat1-dev \
libgl1-mesa-dev \
libqt4-dev
mkdir -p /tmp/makemkv
pushd /tmp/makemkv
wget -c http://www.makemkv.com/download/makemkv-bin-${MKV_VERSION}.tar.gz
tar xvf makemkv-bin-${MKV_VERSION}.tar.gz
pushd makemkv-bin-${MKV_VERSION}/
mkdir -p tmp
touch tmp/eula_accepted
make -f makefile.linux
sudo make -f makefile.linux install
popd
wget -c http://www.makemkv.com/download/makemkv-oss-${MKV_VERSION}.tar.gz
tar xvf makemkv-oss-${MKV_VERSION}.tar.gz
pushd makemkv-bin-${MKV_VERSION}/
mkdir -p tmp
touch tmp/eula_accepted
make -f makefile.linux
sudo make -f makefile.linux install
popd
popd
Copyright (C) 2007-2012 GuinpinSoft inc
IMPORTANT NOTE
The Software, as defined below, is protected by copyright, which is vested in GuinpinSoft inc.
The Software may only be used in accordance with the terms and conditions set out in this document.
If you do not read and agree to be bound by the terms and conditions defined in this document, you are not permitted to keep or use the Software in any way whatsoever and must destroy or return all copies of these items which are in your possession.
END USER LICENSE AGREEMENT
DEFINITIONS
The following definitions apply to the terms and conditions included in this Agreement.
MakeMKV
means a computer program, developed by GuinpinSoft inc, for converting audio/video clips between different formats.
Open-source Software
means certain files included into MakeMKV software package that are licensed under various open-source licenses. The full list of such files is specified in Appendix A. The full text of corresponding open-source licenses can be found in Appendix B.
Software
means MakeMKV, all program and information files and other documentation which are part of the MakeMKV Software package but excluding Open-source Software.
Individual
means a particular person.
TERMS OF AGREEMENT
This is a legal agreement between you, the users, and GuinpinSoft inc. By installing or using this Software, you agree to be bound by the terms of this agreement. If you do not agree to these terms, you may not use or install the Software.
You are entitled to use the Software on all personal computers (laptops/desktops). "Use" means loaded in temporary memory or permanent storage on the computer.
You may not use the Software for any unlawful activity. Specifically, you may not use the Software to commit copyright infringement, you may only use the Software to make copies of works where you either hold the copyright or have obtained permission to copy from the copyright owner or where you allowed to make a copy by applicable law. If you violate the law you may be subject to claims for damages and/or criminal penalties.
The Software contains cryptographic functionality. The use of cryptographic software without a permit may be illegal in some jurisdictions. By the nature of audio/video format conversion the Software may bypass certain copy protection mechanisms to access audio/video data. You, the user, must check your local laws and regulations before using the Software to ensure that both activities are allowed in your jurisdiction.
You may not sell, rent, lease or sublicense the Software, without the explicit written consent of GuinpinSoft inc.
The Software is protected by copyright laws and international treaties.
All intellectual property rights such as but not limited to patents, trademarks, copyrights or trade secret rights related to the Software are the property of and remains vested in GuinpinSoft inc.
You shall not modify, translate, reverse engineer, decompile or disassemble the Software or any part thereof or otherwise attempt to derive source code, create or use derivative works therefrom.
You are not allowed to remove, alter or destroy any proprietary, trademark or copyright markings or notices placed upon or contained with the Software.
You are allowed to redistribute the Software in it original unmodified form. In addition, as a special exception, you may extract and repackage Linux-specific part of the Software for the purpose of creating a distribution-specific package, as long as program files and this license remain unchanged.
YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT USE OF THE SOFTWARE IS AT YOUR OWN RISK AND THAT THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES OR CONDITIONS WHATSOEVER. GUINPINSOFT INC DOES NOT WARRANT THAT THE FUNCTIONS OF THE SOFTWARE WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR FREE. YOU ASSUME RESPONSIBILITY FOR SELECTING THE SOFTWARE TO ACHIEVE YOUR INTENDED RESULTS, AND FOR THE USE AND THE RESULTS OBTAINED FROM THE SOFTWARE.
GUINPINSOFT INC DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES RELATED TO: NON-INFRINGEMENT, LACK OF VIRUSES, ACCURACY OR COMPLETENESS OF RESPONSES OR RESULTS, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL GUINPINSOFT INC BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR FOR ANY DAMAGES WHATSOEVER (INCLUDING BUT NOT LIMITED TO DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, PERSONAL INJURY, LOSS OF PRIVACY OR OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
REGARDLESS OF THE FORM OF ACTION, GUINPINSOFT INC AGGREGATE LIABILITY ARISING OUT OF OR RELATED TO THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT PAYABLE BY YOU UNDER THIS AGREEMENT. THE FOREGOING LIMITATIONS, EXCLUSIONS AND DISCLAIMERS SHALL APPLY TO THE MAXIMUM EXTENT ALLOWED BY APPLICABLE LAW.
The Software may be subject to export or import regulations, and the user agrees to comply strictly with all such laws and regulations. The user agrees not to export or re-export the Software or any part thereof or information pertaining thereto to any country for which a U.S. government agency requires an export license or other governmental approval without first obtaining such license or approval.
Any variation to the terms of this Agreement shall only be valid if made in writing by GuinpinSoft inc.
Appendix A
This installation package does not contain any Open-source Software components.
Appendix B
There are no open-source licenses applicable to this package.
( press 'q' to close this screen )
@BobJackson
Copy link

IINA, it may be the best one.
https://iina.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment