www.makemkv.com

MakeMKV support forum
It is currently Mon Jul 23, 2018 12:23 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Feb 18, 2018 7:47 am 
Offline

Joined: Sun Feb 18, 2018 7:42 am
Posts: 4
Location: /usa/utah
Here's a script I wrote and use to rip all my stuff regardless of where it's at -- a device file, a directory, or an ISO I've already made, and will use the proper makemkvcon arguments.

Some example usages:

Code:
dvd_makemkv /dev/sr0
dvd_makemkv bluray.iso
dvd_makemkv /mnt/bluray


Here you go, hope this helps someone :)

Code:
#!/bin/bash

function is_dvd {

        device="$(realpath $1)"
        test "$device" == "/dev/sr0" || return 1

}

function is_image {

        device="$(realpath $1)"
        test -d "$device" && return 1
        test "${device: -3}" == "iso" || return 1

}

function is_directory {

        device="$(realpath $1)"
        test "${device: -3}" == "iso" || return 1
        test -d "$device" || return 1

}

device="$1"
test -z "$device" && device="/dev/sr0"
test -e "$device" || return 1
track="all"
test -z "$2" || track="`expr $2 - 1`"
output_dir="."
if [[ "${device: -3}" == "iso" ]]; then output_dir="${device:: -3}mux"; if ! -d "$output_dir"; then mkdir "$output_dir"; fi; fi
if [[ "${device: -4}" == "iso/" ]]; then output_dir="${device:: -4}mux"; if [[ ! -d "$output_dir" ]]; then mkdir "$output_dir"; fi; fi

device="$(realpath $device)"

makemkv_arg=
is_dvd "$device" && makemkv_arg="dev:${device}"
is_image "$device" && makemkv_arg="iso:${device}"
is_directory "$device" && makemkv_arg="file:${device}/VIDEO_TS"

test -z "$makemkv_arg" && exit 1

makemkvcon --minlength=0 mkv "$makemkv_arg" $track "$output_dir"


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group