-
Notifications
You must be signed in to change notification settings - Fork 1
/
dvd23gp
executable file
·40 lines (28 loc) · 857 Bytes
/
dvd23gp
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
#!/bin/bash
[ "$#" -lt 1 ] && exec echo -e "usage: $0 <filmname.3gp> [input device|input iso|input dir] [title] [chapter]\n\texample: $0 myfilm.3gp /dev/dvd"
[ "$#" -ge 2 ] && DEV="$2"
[ "$#" -ge 3 ] && DVDTITLE="$3"
[ "$#" -ge 4 ] && CHAPTER="$4"
. mp4tools
XVIDOPTS='profile=sp2:chroma_opt:lumi_mask'
TWIDTH=176
THEIGHT=144
VB=80
analyse "dvd://$DVDTITLE"
scaleres $WIDTH $HEIGHT $TWIDTH $THEIGHT exact
dvdrip /tmp/dvd.$$.avi || clean_tmp
if [ $HAS_AUDIO ]
then
audiorip /tmp/dvd.$$.avi /tmp/audio.$$.wav pan=1:0.5:0.5,lavcresample=8000 || clean_tmp
normalize /tmp/audio.$$.wav || clean_tmp
amrencode /tmp/audio.$$.wav /tmp/audio.$$.amr || clean_tmp
rm -f /tmp/audio.$$.wav
fi
if [ $HAS_VIDEO ]
then
OFPS=12.5
xvidenc /tmp/dvd.$$.avi /tmp/video.$$.m4v $XVIDOPTS $VB || clean_tmp
fi
MP4BOX_OPTS='-3gp'
avmux "$1" || clean_tmp
clean_tmp 0