diff options
author | Ole Kristian Lien <ole.k.lien@gmail.com> | 2009-12-01 06:42:04 +0000 |
---|---|---|
committer | Ole Kristian Lien <ole.k.lien@gmail.com> | 2009-12-01 06:42:04 +0000 |
commit | 0118f00cfc3d3f46fce44584fc0b2079c27db360 (patch) | |
tree | 1977ab8208d5ef9b5e684d9c981f470cfdd6c11e | |
parent | 4326a42534d68f2dc62ce4d2a19c5df1dd902758 (diff) |
added some more scripts
-rw-r--r-- | tools/audio_spectrogram | 18 | ||||
-rw-r--r-- | tools/cut_video | 24 | ||||
-rw-r--r-- | tools/join_video | 2 |
3 files changed, 43 insertions, 1 deletions
diff --git a/tools/audio_spectrogram b/tools/audio_spectrogram new file mode 100644 index 0000000..de0685a --- /dev/null +++ b/tools/audio_spectrogram @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Date: 2009-11-30 +# Author: Ole Kristian Lien +# License: GNU General Public License +# +# Creates a audio spectrogram + +EXT=`echo "$1"|awk -F . '{print $NF}'` +NAME=`basename $1 .$EXT` + +if [ -z "$1" ]; then + echo "Usage: $0 <audio-file>" + exit 1 +fi + +sox $1 -n spectrogram +mv spectrogram.png $NAME.png diff --git a/tools/cut_video b/tools/cut_video new file mode 100644 index 0000000..2e12be9 --- /dev/null +++ b/tools/cut_video @@ -0,0 +1,24 @@ +#!/bin/bash +# +# Date: 2009-11-30 +# Author: Ole Kristian Lien +# License: GNU General Public License +# +# Cut video from x to y (seconds or hh:mm:ss). +# Default duration, is the rest of the video. + +EXT=`echo "$1"|awk -F . '{print $NF}'` +NAME=`basename $1 .$EXT` + +if [ -z "$3" ]; then + echo "Usage: $0 <video-file> <new-video-file> <start-pos> [<duration>]" + exit 1 +fi + +if [ -z "$4" ]; then + DURATION=`./duration $1` + ffmpeg -i $1 -ss $3 -t $DURATION -vcodec copy -acodec copy $NAME-new.$EXT + +else + ffmpeg -i $1 -ss $3 -t $4 -vcodec copy -acodec copy $NAME-new.$EXT +fi diff --git a/tools/join_video b/tools/join_video index 6053948..b50ae07 100644 --- a/tools/join_video +++ b/tools/join_video @@ -7,7 +7,7 @@ # Joins together two or more video-files if [ -z "$3" ]; then - echo "Usage: $0 <new-file> <video-file> <video-file> [<video-file>]" + echo "Usage: $0 <new-file> <video-file> <video-file> [...]" exit 1 fi |