video scripts updated
[video-handling.git] / ffmpeg-mts2ogg-custom
1 #!/bin/bash
2 #
3 # Calin-Andrei Burloiu, 2010, calin.burloiu@gmail.com
4 #
5 # This script converts an MTS file into an WebM file, which 
6 # contains a V8 video stream and and a Vorbis audio stream.
7 #
8
9 if test $# -ne 4; then
10     echo "Usage: $0 mts-file avi-file resolution bitrate"
11     exit 1
12 fi
13
14 MTS_FILE="$1"
15 AVI_FILE="$2"
16 RESOLUTION="$3"
17 BITRATE="$4"
18 FFMPEG=/usr/bin/ffmpeg
19
20 if test ! -f "$MTS_FILE"; then
21     echo "Error: No such file $MTS_FILE"
22     exit 1
23 fi
24
25 $FFMPEG -i "$MTS_FILE" -f ogg -acodec libvorbis -ab 256k -ar 44100 -ac 2 -vcodec libtheora -b "$BITRATE" -r 25 -s $RESOLUTION -threads 0 "$AVI_FILE"
26