add MTS to MPEG-TS conversion script
[video-handling.git] / ffmpeg-mts2avi
1 #!/bin/bash
2 #
3 # Calin-Andrei Burloiu, 2010, calin.burloiu@gmail.com
4 #
5 # This script converts an MTS file into an AVI file, which 
6 # contains an H.264 video stream and and an MP3 audio stream.
7 #
8
9 if test $# -ne 2; then
10     echo "Usage: $0 mts-file avi-file"
11     exit 1
12 fi
13
14 MTS_FILE="$1"
15 AVI_FILE="$2"
16 FFMPEG=/usr/bin/ffmpeg
17
18 if test ! -f "$MTS_FILE"; then
19     echo "Error: No such: file $MTS_FILE"
20     exit 1
21 fi
22
23 $FFMPEG -i "$MTS_FILE" -f avi -acodec libmp3lame -ab 256k -ar 44100 -ac 2 -vcodec libx264 -vpre normal -b 1400k -r 25 -threads 0 "$AVI_FILE"
24