Recognizes if input is ogg or not.
[xiph/unicode.git] / ffmpeg2theora / kino_export / ffmpeg2theora.sh
blob6e99a989c3ae3160922f4c3ba8c26cfa0cbc9ea2
1 #!/bin/sh
2 # written by jan gerber <j@v2v.cc>
3 # profiles added by Dan Dennedy
5 usage()
7 # Title
8 echo "Title: Ogg Theora Export (ffmpeg2theora)"
10 # Usable?
11 which ffmpeg2theora > /dev/null
12 [ $? -eq 0 ] && echo Status: Active || echo Status: Inactive
14 # Type
15 echo Flags: single-pass file-producer
17 # Profiles
18 echo "Profile: High Quality (640x480)"
19 echo "Profile: Medium Quality (320x240)"
20 echo "Profile: Broadband Quality (320x240)"
21 echo "Profile: Low Quality (160x128)"
24 execute()
26 # Arguments
27 normalisation="$1"
28 length="$2"
29 profile="$3"
30 file="$4"
31 [ "x$file" = "x" ] && file="kino_export_"`date +%Y-%m-%d_%H.%M.%S`
33 # Determine info arguments
34 size=`[ "$normalisation" = "pal" ] && echo 352x288 || echo 352x240`
35 video_bitrate=1152
36 audio_bitrate=224
38 # Run the command
39 case "$profile" in
40 "0" ) ffmpeg2theora -f dv -x 640 -y 480 -d -v 7 -a 3 -H 48000 -o "$file".ogv - ;;
41 "1" ) ffmpeg2theora -f dv -x 320 -y 240 -d -v 7 -a 3 -H 48000 -o "$file".ogv - ;;
42 "2" ) ffmpeg2theora -f dv -x 320 -y 240 -d -v 5 -a 0 -H 44100 -o "$file".ogv - ;;
43 "3" ) ffmpeg2theora -f dv -x 160 -y 128 -d -v 3 -a 0 -H 22000 -o "$file".ogv - ;;
44 esac
47 [ "$1" = "--usage" ] || [ -z "$1" ] && usage "$@" || execute "$@"