I bought myself a Playstation to watch Bluray movies. But every once in a while I thought it would be nice to be able to make backups and put them in the MythVideo library just like DVDs.
Due to AACS present on Bluray discs this was a bit complicated. However I found a solution that seems reasonable for me and works very well.
The following is needed:
- Windows XP or Vista License
- VMware server
- Slysoft AnyDVD HD
- a samba share on Linux with lots of free space
The procedure is simple: Install VMware Server on your Linux host and have it access the drive – in my case /dev/scd0 directly.
Windows will see the inserted disc just like a regular Windows machine. By having Windows accessing the drive directly, AnyDVD can read all sectors as its supposed to. Set up AnyDVD to rip to a samba share you’ve set up previously. That way your virtual disk is not going wild.
After the actual ripping process you can use various programs to re-encode the rip to get it down to a more manageable size. I usually set my films to end up as a 720p 4.5GB h.264 video using ripbot264. RipBot is a small Delphi program that bundles all necessary tools – quite a few – with a nice GUI.
If you use very recent releases of mencoder, mplayer, gpac, mkvtoolnix and x264 you may also use Linux directly for the encoding process which may result in a performance increase compared to using a virtual machine such as vmware.
HyRax has posted a small bash script on his blog that will do the encoding for you. You’ll need to install the required packages first:
The packages in your distro may not be recent enough in which case you may wanto to compile a cvs snapshot from source.
#! /bin/bash
# =====================================================================
# Blu-ray encoding script by HyRax February 2009 http://www.serenux.com
# =====================================================================
# Make sure the user has specified what to work on.
if [ -z „$1“ ]; then
echo „\nBlu-ray movie encoding script\n—————————–“
echo „Written by HyRax February 2009\nhttp://www.serenux.com“
echo „\nUsage: $0 <m2ts file without extension>“
echo „\nExample: If your movie file is called TheDarkKnight.m2ts then\nyour usage will be: $0 TheDarkKnight\n“
exit
fi
# The crf=21 option controls encoding quality, and indirectly the final
# filesize. The higher the value, the more compression and thus smaller
# file size. Reduce the value and file size will go up. A value of 21
# should produce a file of approximately 4GB in size for a typical movie.
# Encode the video using x264, ignore the audio for now.
mencoder $1.m2ts \
-ovc x264 -x264encopts crf=21:frameref=3:bframes=3:b_pyramid:direct_pred=auto:weight_b:partitions=all:8x8dct:me=umh:mixed_refs:trellis=1:nopsnr:nossim:subq=6:level_idc=41:threads=4 \
-nosound \
-of rawvideo \
-o $1.×264
# Dump the first original audio track (should be the English track) but
# don’t re-encode it. Ignore the video.
mplayer $1.m2ts -dumpaudio -dumpfile $1.ac3
# Copy the raw x264 encoded video into an MP4 container so we can set
# the correct framerate (generally 23.976 – adjust it if MPlayer or
# MEncoder report something different)
MP4Box -add $1.×264 $1.mp4 -fps 23.976
# Finally, merge everything into a single MKV file
mkvmerge -o $1.mkv $1.mp4 –track-name 0:Eng $1.ac3
# Remove the hash in front of the next command to have the script delete
# your working files when encoding is complete.
# rm $1.m2ts $1.×264 $1.ac3
# Tell the user we’re done.
echo „All done! Your final movie file is called $1.mkv – enjoy!“
Simply copy the script to the directory containing the main m2ts file and run it with
leaving out the m2ts extension from maintitle.m2ts when calling the script. Videos encoded using the VC-1 codec result in errors so far. Your mileage may vary.
Keep in mind that it may not be legal in your country to employ tools to get rid of copy protection on digital media.
Comments 1
Pingback: Homeserver Recap | osiris