3 # Author: Martin Matusiak <numerodix@gmail.com>
4 # Licensed under the GNU Public License, version 3.
7 # load constants and functions
8 p
=$
(dirname $
(readlink
-f $0)); .
$p/lib.sh
10 usage
="Usage: ${b}${tool_name} ${r}[${bb}<file(s)>${r} | ${b}--dev ${bb}/dev/dvd${r} | ${b}--dir ${bb}/path${r} | ${b}--iso ${bb}disc.iso${r}]
11 <file(s)> files to read
12 -d --dev dvd device to read from (default is ${bb}/dev/dvd${r})
13 -q --dir dvd directory to read from
14 -i --iso dvd iso image to read from
15 --version show ${suite_name} version"
18 longs
="dev:,dir:,iso:,version"
19 eval $
(get_parsecmd
"$tool_name" "$shorts" "$longs")
23 -d|
--dev ) input_dvd_device
="$2"; shift 2;; # str
24 -q|
--dir ) input_dvd_device
="$2"; shift 2;; # str
25 -i|
--iso ) input_dvd_device
="$2"; shift 2;; # str
26 --version ) print_version
;;
35 if [[ ! "$input_dvd_device" && ! "$@" ]]; then
41 # Build array either of dvd titles or files given as input
44 if [[ "$input_dvd_device" ]]; then
45 titles
=$
(examine_dvd_for_titlecount
"$input_dvd_device")
46 if [[ "$titles" ]]; then
47 for f
in $
($seq 1 $titles); do
52 echo -e "${e}Could not read from ${bb}$input_dvd_device${e} dvd device${r}"
63 display_title_line
"header"
64 for file in "${files[@]}"; do
65 if [[ ! "$input_dvd_device" && ! -e "$file" ]]; then
66 echo -e "${e}File ${bb}$file${e} does not exist"
70 if [[ "$input_dvd_device" ]]; then
73 info
=($
(examine_title
"dvd://$file" "$input_dvd_device"))
75 filename
=$
(basename "$file")
77 filesize
=$
(stat
"$file" |
$grep "Size:" |
$sed "s|.*Size: \([0-9]*\).*|\1|g")
78 filesize
=$
(echo "scale=0; $filesize/1024/1024" |
$bc) # convert to mb
80 info
=($
(examine_title
"$file"))
91 abitrate
=$
( echo "scale=0; ${info[4]}/1024" |
$bc ) # convert to kbps
95 vbitrate
=$
( echo "scale=0; ${info[6]}/1024" |
$bc ) # convert to kbps
96 if [[ "$vbitrate" ]]; then
97 bpp
=$
(compute_bpp
"$width" "$height" "$fps" "$length" "" "$vbitrate")
104 display_title
"$width" "$height" "$fps" "$length" "$bpp" "$passes" "$vbitrate" "$vformat" "$abitrate" "$aformat" "$filesize" "$filename"