View Full Version : Looking for a DVD backup solution for Ubuntu.
thePM
16th January 2011, 09:15
Hello all,
I am using Ubuntu 10.04.1 LTS and I am looking for a DVD backup solution so I can have a backup copy off all my DVDs on my 2 TB HDD. I can switch to Ubuntu 10.10 if that would make the process easier.
I tried using VLC (there was a guide on the Internet LOL) but I had no luck with that. I have also tried using dvd::rip, AcidRip, and Thoggen.
I got a new system for the holidays and I tried to play a DVD using with VLC and it did not work. I found that odd so I tried playing the DVD with Movie Player and it said that it needed to download something but that it had to update the package (or what not first) and finally said it needed to download "DVD Source" codec or something like that but could not.
Obviously I am missing something here so any help would be appreciated.
Nick
16th January 2011, 12:00
Firstly I've moved this to the Linux and *nix OS's forum, as it is Ubuntu-specific.
I've been using Ubuntu for 3 years now but unfortunately I do feel the FOSS efforts in the field of DVD backup have been somewhat lacking.
Your playback problem is due to the fact that you need at least to defeat CSS - a copy protection mechanism to decrypt the video files on the DVD. The library to do this is of questionable legality in many jurisdictions and so Ubuntu do not provide it in the repositories.
To back up, there are many other, newer copy protection mechanisms in your way and I have not found a native Linux app to consistently defeat these. There is a work in progress that may interest you here
http://forum.doom9.org/showthread.php?t=157519
Otherwise, I found DVDFab HD Decrypter to be the only answer. It is a Windows app but it works well in Wine. The part of it you need simply to copy DVD content to your hard drive is free-gratis, although it is not opensource.
Wine, though, does open up the possibilities with apps like Avisynth, HC-Enc and ImgBurn which are all Windows apps that are well supported by these forums and can be made to work in Linux.
ganymede
16th January 2011, 12:21
There are a lot of DVD backup tools for linux !
To backup my DVDs as iso images (that can be read by mplayer, for instance, but I think VLC should also be able to do that), and decrypt them on the fly, I usually use k3b. I also use k9copy to backup DVD9 (double-layer, 8.5 GB) to DVD5 (simple layer, 4.7 GB) ; this tool is able to create iso images or rip DVD content to a directory, and it can also be used to decrypt and copy the DVD without resizing.
If you want to backup as a compressed H.264 video, you can use the excellent h264enc, for instance.
There are plenty other tools, BTW, but these are the ones I can advise you to use.
thePM
16th January 2011, 12:22
@Nick Thanks! I will look into it. Isn't VLC suppose to be able to play DVDs or is that only on Windows/Mac?
nm
16th January 2011, 14:50
Isn't VLC suppose to be able to play DVDs or is that only on Windows/Mac?
On Ubuntu and most other Linux distributions, VLC uses system-wide libraries just like all the other media players. This should get you going:
sudo apt-get install ubuntu-restricted-extras libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh
Carpo
16th January 2011, 23:24
This is why i keep a little partition to dual boot on, may take a while to get to the level of backup apps that windows has, but FOSS will get there in the end :-)
iago
19th January 2011, 18:56
Of course, native Linux applications can both playback and decrypt DVDs as long as you've installed the required packages and medibuntu repositories (ubuntu-restricted-extras, libdvdnav4, libdvdcss2, etc.).
I've been using "k3b" for years without any problems as a DVD (to ISO) backup solution, and "vlc" for the playback of both encrypted and non-encrypted DVDs without the slightest problem.
Linux is definitely more capable of doing many things than you probably imagine, mate...
Regards,
iago
setarip_old
20th January 2011, 03:15
@thePM
Hi!
For "movie-only" backup, try (presently freeware) MakeMKV (Yes, it works with Linux)...
boykillsworld
22nd January 2011, 21:09
Here's my one click backup script. It downloads the biggest title blu-ray or DVD then compresses it with handbrake. I set it to use high profile mkv as this reduces space but it does take quite a bit of precessor to do this. The blu-ray strips audio and subititles compresses the video with handbrake and muxes it back in. Older versions of handbrake would sometimes freak out when they saw the subtitles but this step may be unnecessary now. I have it set to only keep the english audo and subtitles. The resulting files only play with subtitle support in XBMC or mplayer. It take 8-12 hours for a blu-ray rip with a quad core. I rig it so I launch this by remote control and let it run overnight. Feel free to clean this up as it is one of my first scripts. Do not launch with sh as it will not deal with the arrays. Use ./script.
Requirements
makemkv
handbrakecli
mkvtoolnix (blu-ray only)
#!/bin/bash
# Exit Codes
# 1 : vobcopy failed
# 2 : encoding failed
# 3 : lock file present
# 4 : DVD not mounted
# 5 : VIDEO_TS not present - probably not a video DVD
TMP_DIR="/media/video/tmp" # Location to store vobs
DVD_DRIVE="disc:0" # Mount location of dvd
DVD_DEV="/dev/dvd" # DVD Device
ENC_DIR="/media/video/Movies" # Location to place encoded videos
DVD_DIR="/media/cdrom0" # Mount location of dvd
LOCK_FILE="/tmp/ripdvd.lock" # Lock File
mount | grep "${DVD_DIR}" || mount "${DVD_DEV}" "${DVD_DIR}"
if [ $? -ne 0 ]; then
# dvd not mounted
echo "*** DVD not mounted"
rm "${LOCK_FILE}"
exit 4
fi
sleep 30;
if [ -d "${DVD_DIR}/VIDEO_TS" ]; then
# Only run if not already running
if [ -f "${LOCK_FILE}" ]; then
echo "*** Lock file present"
exit 3
fi
touch "${LOCK_FILE}"
makemkvcon info -r ${DVD_DRIVE} > ${TMP_DIR}/DVDinfo.log
DVD_NAME="$(grep CINFO:2 ${TMP_DIR}/DVDinfo.log| sed -e 's/CINFO:2,0,//' | sed -e 's/"//g')"
DVDtitle="$(grep TINFO:.,11 ${TMP_DIR}/DVDinfo.log| sed -e 's/"//g' -e 's/,0,/\n/g' -e 's/TINFO://g' -e 's/,11//g')"
DVDarraytitle=(${DVDtitle})
echo "DVD Name ${DVD_NAME}"
MAIN_TITLE=${DVDarraytitle[0]}
MAIN_TITLE_SIZE=${DVDarraytitle[1]}
for (( c=2; c<${#DVDarraytitle }; c+2 ))
do
if [ ${DVDarraytitle[c+1]} -gt ${MAIN_TITLE_SIZE} ] ; then
MAIN_TITLE=${DVDarraytitle[c]}
MAIN_TITLE_SIZE=${DVDarraytitle[c+1]}
fi
c=$c+2
done
echo "Main Title ${MAIN_TITLE}"
if [ ! -d /"${TMP_DIR}/${DVD_NAME}/" ]; then
mkdir /"${TMP_DIR}/${DVD_NAME}/"
makemkvcon mkv ${DVD_DRIVE} ${MAIN_TITLE} /"${TMP_DIR}/${DVD_NAME}/"
fi
MKV_NAME="${DVD_NAME}"
INC=""
while [ -f "${ENC_DIR}/${MKV_NAME}${INC}.mkv" ]; do ((INC=INC+1)); done;
if [ -n "${INC}" ]; then MKV_NAME="${MKV_NAME}${INC}"; fi
RIP_PATH="$(find "${TMP_DIR}/${DVD_NAME}" -name "*.mkv")"
nice -n 19 HandBrakeCLI -C 3 -i "${RIP_PATH}" -o "${ENC_DIR}/${MKV_NAME}.mkv" -f mkv --preset "High Profile"
if [ $? -ne 0 ]; then
# encoding failed
echo "*** Error during encoding"
rm -rf "${TMP_DIR}/${DVD_NAME}"
rm "${ENC_DIR}/${MKV_NAME}.mkv"
rm "${LOCK_FILE}"
exit 2
fi
rm -rf "${TMP_DIR}/${DVD_NAME}"
umount "${DVD_DIR}" && eject "${DVD_DEV}"
umount "${DVD_DIR}" && eject "${DVD_DEV}"
rm "${LOCK_FILE}"
echo -e "\n\nRip of ${DVD_NAME} completed.\nEncoded to ${ENC_DIR}/${MKV_NAME}.mkv"
fi
if [ -d "${DVD_DIR}/BDMV" ]; then
# Only run if not already running
if [ -f "${LOCK_FILE}" ]; then
echo "*** Lock file present"
exit 3
fi
touch "${LOCK_FILE}"
makemkvcon info -r ${DVD_DRIVE} > ${TMP_DIR}/BDinfo.log
BD_NAME="$(grep CINFO:2 ${TMP_DIR}/BDinfo.log| sed -e 's/CINFO:2,0,//' | sed -e 's/"//g')"
BDtitle="$(grep TINFO:.,11 ${TMP_DIR}/BDinfo.log| sed -e 's/"//g' -e 's/,0,/\n/g' -e 's/TINFO://g' -e 's/,11//g')"
BDarraytitle=(${BDtitle})
echo ${BD_NAME}
BD_MAIN_TITLE=${BDarraytitle[0]}
BD_MAIN_TITLE_SIZE=${BDarraytitle[1]}
for (( c=2; c<${#BDarraytitle }; c+2 ))
do
if [ ${BDarraytitle[c+1]} -gt ${BD_MAIN_TITLE_SIZE} ] ; then
BD_MAIN_TITLE=${BDarraytitle[c]}
BD_MAIN_TITLE_SIZE=${BDarraytitle[c+1]}
fi
c=$c+2
done
echo "Main Title ${BD_MAIN_TITLE}"
if [ ! -d /"${TMP_DIR}/${BD_NAME}/" ]; then
mkdir /"${TMP_DIR}/${BD_NAME}/"
makemkvcon mkv ${DVD_DRIVE} ${BD_MAIN_TITLE} /"${TMP_DIR}/${BD_NAME}/"
fi
RIP_PATH="$(find "${TMP_DIR}/${BD_NAME}/" -name "*.mkv")"
nice -n 19 mkvmerge -o "${TMP_DIR}/${BD_NAME}video.mkv" -A -S --no-chapters "${RIP_PATH}"
INC=""
while [ -f "{TMP_DIR}/${BD_NAME}video${INC}.mkv" ]; do ((INC=INC+1)); done;
if [ -n "${INC}" ]; then BD_NAME="${BD_NAME}${INC}"; fi
nice -n 19 HandBrakeCLI -C 3 -i "${TMP_DIR}/${BD_NAME}video.mkv" -o "${TMP_DIR}/${BD_NAME}videohand.mkv" -a "none" -f mkv --preset "High Profile"
if [ $? -ne 0 ]; then
# encoding failed
echo "*** Error during encoding"
rm -rf "${TMP_DIR}/${BD_NAME}videohand.mkv"
rm "${LOCK_FILE}"
exit 2
fi
BDINFO="$(mkvinfo "${TMP_DIR}/${BD_NAME}/${TITLE}.mkv" | egrep '+ Language:|+ Track UID:|Track type:|+ Name:' | sed -e 's/|//g' -e 's/+ Track UID: //g' -e 's/+ Language: //g' -e 's/+ Track type: //g' -e 's/+ Name: //g')"
BDINFOVIDEO="$(mkvinfo "${TMP_DIR}/${BD_NAME}videohand.mkv" | egrep '+ Language:|+ Track UID:|Track type:|Pixel' | sed -e 's/|//g' -e 's/+ Track UID: //g' -e 's/+ Track type: //g' -e 's/+ Pixel height: //g' -e 's/+ Pixel width: //g')"
echo ${BDINFO}
BDarray=(${BDINFO})
BDarrayvideo=(${BDINFOVIDEO})
if [ ${#BDarrayvideo } -gt 4 ] ; then
echo "more than one video file present"
exit
fi
videomm="--language 1:eng --default-track 1:yes --forced-track 1:no --display-dimensions 1:${BDarrayvideo[2]}x${BDarrayvideo[3]} -d 1 -A -S -T --no-global-tags --no-chapters "
echo ${BDINFOVIDEO}
x=0
firstaudio=true
audiomm=""
audiotrack=""
firstsubtitle=true
subtitlemm=""
subtitletack=""
while [ $x -lt ${#BDarray } ] ; do
if [ "${BDarray[$x+1]}" = "video" ]; then
x=$(( $x + 2 ))
elif [ "${BDarray[$x+1]}" = "audio" ]; then
if [ "${BDarray[$x+2]}" = "eng" ]; then
if $firstaudio ; then
firstaudio=false
if [ "${BDarray[$x+3]}" = "HD" ]; then
audiomm="--language ${BDarray[$x]}:eng --track-name ${BDarray[$x]}:"${BDarray[$x+3]} ${BDarray[$x+4]}" --default-track ${BDarray[$x]}:yes --forced-track ${BDarray[$x]}:no "
else
audiomm="--language ${BDarray[$x]}:eng --track-name ${BDarray[$x]}:${BDarray[$x+3]} --default-track ${BDarray[$x]}:yes --forced-track ${BDarray[$x]}:no "
fi
audiotrack="${audiotrack}${BDarray[$x]}"
else
if [ "${BDarray[$x+3]}" = "HD" ]; then
audiomm="${audiomm}--language ${BDarray[$x]}:eng --track-name ${BDarray[$x]}:"${BDarray[$x+3]}_${BDarray[$x+4]}" --default-track ${BDarray[$x]}:no --forced-track ${BDarray[$x]}:no "
else
audiomm="${audiomm}--language ${BDarray[$x]}:eng --track-name ${BDarray[$x]}:${BDarray[$x+3]} --default-track ${BDarray[$x]}:no --forced-track ${BDarray[$x]}:no "
fi
audiotrack="${audiotrack},${BDarray[$x]}"
fi
fi
if [ "${BDarray[$x+3]}" = "HD" ]; then
x=$(( $x + 5 ))
else
x=$(( $x + 4 ))
fi
elif [ "${BDarray[$x+1]}" = "subtitles" ]; then
if [ "${BDarray[$x+2]}" = "eng" ]; then
if $firstsubtitle ; then
firstsubtitle=false
subtitlemm="${subtitlemm}--language ${BDarray[$x]}:eng --default-track ${BDarray[$x]}:yes --forced-track ${BDarray[$x]}:no "
subtitletrack="${subtitletrack}${BDarray[$x]}"
else
subtitlemm="${subtitlemm}--language ${BDarray[$x]}:eng --default-track ${BDarray[$x]}:no --forced-track ${BDarray[$x]}:no "
subtitletrack="${subtitletrack},${BDarray[$x]}"
fi
fi
x=$(( $x + 3 ))
else
echo error undefined media stream
echo $x
echo ${BDarray[$x+1]}
exit
fi
done
echo "mkvmerge -o "${ENC_DIR}/${BD_NAME}.mkv" ${videomm} "${TMP_DIR}/${BD_NAME}videohand.mkv" ${audiomm} ${subtitlemm} -a ${audiotrack} -s ${subtitletrack} -D -T --no-global-tags "${TMP_DIR}/${BD_NAME}/${TITLE}.mkv""
nice -n 19 mkvmerge -o "${ENC_DIR}/${BD_NAME}.mkv" ${videomm} "${TMP_DIR}/${BD_NAME}videohand.mkv" ${audiomm} ${subtitlemm} -a ${audiotrack} -s ${subtitletrack} -D -T --no-global-tags "${TMP_DIR}/${BD_NAME}/${TITLE}.mkv"
rm "${LOCK_FILE}"
rm -rf /"${TMP_DIR}/${BD_NAME}/"
rm ${TMP_DIR}/${BD_NAME}videohand.mkv
rm ${TMP_DIR}/${BD_NAME}video.mkv
umount "${DVD_DIR}" && eject "${DVD_DEV}"
echo -e "\n\nRip of ${BD_NAME} completed.\nEncoded to ${ENC_DIR}/${BD_NAME}.mkv"
fi
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.