-
Notifications
You must be signed in to change notification settings - Fork 1
/
dvd2psp
executable file
·38 lines (26 loc) · 853 Bytes
/
dvd2psp
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
#!/bin/bash
[ "$#" -lt 1 ] && exec echo -e "usage: $0 <filmname.mp4> [input device|input iso|input dir] [title] [chapter]\n\texample: $0 myfilm.mp4 /dev/dvd"
[ "$#" -ge 2 ] && DEV="$2"
[ "$#" -ge 3 ] && DVDTITLE="$3"
[ "$#" -ge 4 ] && CHAPTER="$4"
. mp4tools
X264OPTS='partitions=all:direct=auto:ref=6:me=umh:subq=7:mixed_refs:trellis=1:level_idc=13'
TWIDTH=480
THEIGHT=272
VQ=24
analyse "dvd://$DVDTITLE"
scaleres $WIDTH $HEIGHT $TWIDTH $THEIGHT
dvdrip /tmp/dvd.$$.avi || clean_tmp
if [ $HAS_AUDIO ]
then
audiorip /tmp/dvd.$$.avi /tmp/audio.$$.wav lavcresample=44100 || clean_tmp
normalize /tmp/audio.$$.wav || clean_tmp
aacenc /tmp/audio.$$.wav /tmp/audio.$$.aac || clean_tmp
rm -f /tmp/audio.$$.wav
fi
if [ $HAS_VIDEO ]
then
h264enc /tmp/dvd.$$.avi /tmp/video.$$.264 $X264OPTS $VQ || clean_tmp
fi
avmux "$1" || clean_tmp
clean_tmp 0