add MTS to MPEG-TS conversion script
authorRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 3 Jan 2011 20:06:33 +0000 (22:06 +0200)
committerRazvan Deaconescu <razvan.deaconescu@cs.pub.ro>
Mon, 3 Jan 2011 20:06:33 +0000 (22:06 +0200)
ffmpeg-mts2ts-custom [new file with mode: 0755]

diff --git a/ffmpeg-mts2ts-custom b/ffmpeg-mts2ts-custom
new file mode 100755 (executable)
index 0000000..34e8361
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Calin-Andrei Burloiu, 2010, calin.burloiu@gmail.com
+#
+# This script converts an MTS file into an AVI file, which 
+# contains an H.264 video stream and and an MP3 audio stream.
+#
+
+if test $# -ne 4; then
+    echo "Usage: $0 mts-file ts-file bitrate resolution"
+    exit 1
+fi
+
+MTS_FILE="$1"
+TS_FILE="$2"
+BITRATE="$3"
+RESOLUTION="$4"
+FFMPEG=/usr/bin/ffmpeg
+
+if test ! -f "$MTS_FILE"; then
+    echo "Error: No such: file $MTS_FILE"
+    exit 1
+fi
+
+$FFMPEG -i "$MTS_FILE" -f mpegts -acodec libmp3lame -ab 128k -ar 44100 -ac 2 -vcodec libx264 -vpre normal -b "$BITRATE" -r 25 -s $RESOLUTION -threads 0 "$TS_FILE"