From fa4e4f649958bebc4aa7c8d9ab2c9459cb71c611 Mon Sep 17 00:00:00 2001 From: Calin Burloiu Date: Tue, 14 Dec 2010 12:01:09 +0200 Subject: [PATCH] new output formats added for conversion, video cut script added, updates --- ffmpeg-cut-mts | 26 ++++++++++++++++++++++++++ ffmpeg-mts2avi | 8 ++++---- ffmpeg-mts2ogg | 24 ++++++++++++++++++++++++ ffmpeg-mts2ogg-custom | 25 +++++++++++++++++++++++++ ffmpeg-mts2webm | 24 ++++++++++++++++++++++++ 5 files changed, 103 insertions(+), 4 deletions(-) create mode 100755 ffmpeg-cut-mts create mode 100755 ffmpeg-mts2ogg create mode 100755 ffmpeg-mts2ogg-custom create mode 100755 ffmpeg-mts2webm diff --git a/ffmpeg-cut-mts b/ffmpeg-cut-mts new file mode 100755 index 0000000..834242e --- /dev/null +++ b/ffmpeg-cut-mts @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Calin-Andrei Burloiu, 2010, calin.burloiu@gmail.com +# +# This script cuts .mts video file starting from a seek point +# with a desired duration. Seek point and duration are expressed in +# seconds or in the hh:mm:ss[.xx] format. +# + +if test $# -ne 4; then + echo "Usage: $0 mts-input-file mts-output-file seek-point duration" + exit 1 +fi + +MTS_IN="$1" +MTS_OUT="$2" +SEEK_POINT="$3" +DURATION="$4" +FFMPEG=/usr/bin/ffmpeg + +if test ! -f "$MTS_IN"; then + echo "Error: No such file $MTS_IN" + exit 1 +fi + +"$FFMPEG" -ss "$SEEK_POINT" -t "$DURATION" -i "$MTS_IN" -f mpegts -acodec copy -vcodec copy "$MTS_OUT" diff --git a/ffmpeg-mts2avi b/ffmpeg-mts2avi index bcd63f0..d130ce8 100755 --- a/ffmpeg-mts2avi +++ b/ffmpeg-mts2avi @@ -11,12 +11,12 @@ if test $# -ne 2; then exit 1 fi -MTS_FILE=$1 -AVI_FILE=$2 +MTS_FILE="$1" +AVI_FILE="$2" FFMPEG=/usr/bin/ffmpeg -if test ! -f $MTS_FILE; then - echo "Error: No such file $MTS_FILE" +if test ! -f "$MTS_FILE"; then + echo "Error: No such: file $MTS_FILE" exit 1 fi diff --git a/ffmpeg-mts2ogg b/ffmpeg-mts2ogg new file mode 100755 index 0000000..b2bb637 --- /dev/null +++ b/ffmpeg-mts2ogg @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Calin-Andrei Burloiu, 2010, calin.burloiu@gmail.com +# +# This script converts an MTS file into an WebM file, which +# contains a V8 video stream and and a Vorbis audio stream. +# + +if test $# -ne 2; then + echo "Usage: $0 mts-file avi-file" + exit 1 +fi + +MTS_FILE="$1" +AVI_FILE="$2" +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 ogg -acodec libvorbis -ab 256k -ar 44100 -ac 2 -vcodec libtheora -b 1400k -r 30 -threads 0 "$AVI_FILE" + diff --git a/ffmpeg-mts2ogg-custom b/ffmpeg-mts2ogg-custom new file mode 100755 index 0000000..fe48cf6 --- /dev/null +++ b/ffmpeg-mts2ogg-custom @@ -0,0 +1,25 @@ +#!/bin/bash +# +# Calin-Andrei Burloiu, 2010, calin.burloiu@gmail.com +# +# This script converts an MTS file into an WebM file, which +# contains a V8 video stream and and a Vorbis audio stream. +# + +if test $# -ne 3; then + echo "Usage: $0 mts-file avi-file resolution" + exit 1 +fi + +MTS_FILE="$1" +AVI_FILE="$2" +RESOLUTION="$3" +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 ogg -acodec libvorbis -ab 256k -ar 44100 -ac 2 -vcodec libtheora -b 1400k -r 30 -s $RESOLUTION -threads 0 "$AVI_FILE" + diff --git a/ffmpeg-mts2webm b/ffmpeg-mts2webm new file mode 100755 index 0000000..b232f9e --- /dev/null +++ b/ffmpeg-mts2webm @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Calin-Andrei Burloiu, 2010, calin.burloiu@gmail.com +# +# This script converts an MTS file into an WebM file, which +# contains a V8 video stream and and a Vorbis audio stream. +# + +if test $# -ne 2; then + echo "Usage: $0 mts-file avi-file" + exit 1 +fi + +MTS_FILE="$1" +AVI_FILE="$2" +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 webm -acodec libvorbis -ab 256k -ar 44100 -ac 2 -vcodec libvpx -b 1400k -r 30 -threads 0 "$AVI_FILE" + -- 2.20.1