From: Calin Burloiu Date: Wed, 9 Feb 2011 12:54:37 +0000 (+0200) Subject: video scripts updated X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=6a2962dbd3c8194bdf37eaca9a983071c8fa7d28;p=video-handling.git video scripts updated --- diff --git a/ffmpeg-mts2avi-custom b/ffmpeg-mts2avi-custom index 26b944d..232471c 100755 --- a/ffmpeg-mts2avi-custom +++ b/ffmpeg-mts2avi-custom @@ -6,14 +6,15 @@ # contains an H.264 video stream and and an MP3 audio stream. # -if test $# -ne 3; then - echo "Usage: $0 mts-file avi-file resolution" +if test $# -ne 4; then + echo "Usage: $0 mts-file avi-file resolution bitrate" exit 1 fi MTS_FILE="$1" AVI_FILE="$2" RESOLUTION="$3" +BITRATE="$4" FFMPEG=/usr/bin/ffmpeg if test ! -f "$MTS_FILE"; then @@ -21,5 +22,5 @@ if test ! -f "$MTS_FILE"; then exit 1 fi -$FFMPEG -i "$MTS_FILE" -f avi -acodec libmp3lame -ab 256k -ar 44100 -ac 2 -vcodec libx264 -vpre normal -b 1400k -r 25 -s $RESOLUTION -threads 0 "$AVI_FILE" +$FFMPEG -i "$MTS_FILE" -f avi -acodec libmp3lame -ab 256k -ar 44100 -ac 2 -vcodec libx264 -vpre normal -b "$BITRATE" -r 25 -s $RESOLUTION -threads 0 "$AVI_FILE" diff --git a/ffmpeg-mts2flv-custom b/ffmpeg-mts2flv-custom new file mode 100755 index 0000000..ee9c2f8 --- /dev/null +++ b/ffmpeg-mts2flv-custom @@ -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 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 flv -acodec libmp3lame -ab 256k -ar 44100 -ac 2 -vcodec libx264 -vpre normal -b 1400k -r 25 -s $RESOLUTION -threads 0 "$AVI_FILE" + diff --git a/ffmpeg-mts2mp4-custom b/ffmpeg-mts2mp4-custom new file mode 100755 index 0000000..4a9f4b6 --- /dev/null +++ b/ffmpeg-mts2mp4-custom @@ -0,0 +1,26 @@ +#!/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 avi-file resolution bitrate" + exit 1 +fi + +MTS_FILE="$1" +AVI_FILE="$2" +RESOLUTION="$3" +BITRATE="$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 mp4 -acodec libmp3lame -ab 256k -ar 44100 -ac 2 -vcodec libx264 -vpre normal -b "$BITRATE" -r 25 -s "$RESOLUTION" -threads 0 "$AVI_FILE" + diff --git a/ffmpeg-mts2ogg-custom b/ffmpeg-mts2ogg-custom index 363d1e6..817d5d5 100755 --- a/ffmpeg-mts2ogg-custom +++ b/ffmpeg-mts2ogg-custom @@ -6,14 +6,15 @@ # contains a V8 video stream and and a Vorbis audio stream. # -if test $# -ne 3; then - echo "Usage: $0 mts-file avi-file resolution" +if test $# -ne 4; then + echo "Usage: $0 mts-file avi-file resolution bitrate" exit 1 fi MTS_FILE="$1" AVI_FILE="$2" RESOLUTION="$3" +BITRATE="$4" FFMPEG=/usr/bin/ffmpeg if test ! -f "$MTS_FILE"; then @@ -21,5 +22,5 @@ if test ! -f "$MTS_FILE"; then exit 1 fi -$FFMPEG -i "$MTS_FILE" -f ogg -acodec libvorbis -ab 256k -ar 44100 -ac 2 -vcodec libtheora -b 1400k -r 25 -s $RESOLUTION -threads 0 "$AVI_FILE" +$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"