-
Notifications
You must be signed in to change notification settings - Fork 0
/
ripdvd0
executable file
·44 lines (35 loc) · 1.29 KB
/
ripdvd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
DRIVE_NUM="0"
OUTPUT_DIR="/mine/RIP"
SOURCE_DIR="/media/cdrom$DRIVE_NUM/VIDEO_TS"
SOURCE_DRIVE="/dev/sr$DRIVE_NUM"
HANDBRAKE_PRESET="Normal"
EXTENSION="m4v"
function rip_dvd() {
# Grab the DVD title
DVD_TITLE=$(blkid -o value -s LABEL $SOURCE_DRIVE)
# Replace spaces with underscores
DVD_TITLE=${DVD_TITLE// /_}
# Backup the DVD to out hard drive
#dvdbackup -i $SOURCE_DRIVE -o $OUTPUT_DIR -M -n $DVD_TITLE
# grep for the HandBrakeCLI process and get the PID
#HANDBRAKE_PID=`ps aux|grep H\[a\]ndBrakeCLI`
#set -- $HANDBRAKE_PID
#HANDBRAKE_PID=$2
# Wait until our previous Handbrake job is done
#if [ -n "$HANDBRAKE_PID" ]
#then
# while [ -e /proc/$HANDBRAKE_PID ]; do sleep 1; done
#fi
# HandBrake isn't ripping anything so we can pop out the disc
#eject $SOURCE_DRIVE
# And now we can start encoding
#HandBrakeCLI -i $OUTPUT_DIR/$DVD_TITLE -o $OUTPUT_DIR/$DVD_TITLE.$EXTENSION --preset=$HANDBRAKE_PRESET
echo $SOURCE_DIR
echo $OUTPUT_DIR
echo $DVD_TITLE.$EXTENSION
HandBrakeCLI -i $SOURCE_DIR -o $OUTPUT_DIR/$DVD_TITLE.$EXTENSION --preset=$HANDBRAKE_PRESET
# Clean up
#rm -R $OUTPUT_DIR/$DVD_TITLE
}
rip_dvd