Assorted away-tpope updates
[tpope-extra.git] / bin / nokia-media-converter
1 #!/bin/sh
2 # $Id$
3 # -*- sh -*- vim: ft=sh sw=4 sts=4
4
5 # Converts a media file to a format capable of being played on a supported
6 # mobile phone, such as the Nokia 3650 and 7650.
7
8 # Most software required by this script is fairly standard.  You will need
9 # a copy of RealProducer Basic 8.51 for Linux, which is free-as-in-beer,
10 # although a bit hard to come by.  A version might be available at
11 # <http://www.ezytech.com.cn/real/RealDownload/dlindex.htm>
12
13 [ -z "$TMPDIR" ] && TMPDIR=/tmp
14
15 if [ -z "$2" ]; then
16     echo "Usage: `basename $0` <infile> <outfile>"
17     exit 1
18 fi
19
20 IN="$1"
21 OUT="$2"
22
23 mencoder -oac mp3lame -channels 1 -ovc xvid -xvidencopts bitrate=800:me_quality=6:4mv -ofps 15 -vf scale=176:-2 -sws 2 -o "$TMPDIR/$OUT.avi" "$IN"
24 transcode -y mov -F 'raw ',twos -N 0x1 -P 0 -I 3 -k -z -i "$TMPDIR/$OUT.avi" -o "$TMPDIR/$OUT.mov"
25 rm -f "$TMPDIR/$OUT.avi"
26 realproducer -t 2 -a 1 -r 1 -k 1 -h "Tim Pope" -i "$TMPDIR/$OUT.mov" -o "$OUT" \
27     && rm -f "$TMPDIR/$OUT.mov"