summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/TODO11
-rwxr-xr-xtools/audio_channels_diff8
-rw-r--r--tools/audio_extract1
-rwxr-xr-xtools/audio_split4
-rwxr-xr-xtools/audio_stats5
-rw-r--r--tools/merge_audio_stereo_track18
-rw-r--r--tools/process-video8
-rw-r--r--tools/split_audio24
8 files changed, 51 insertions, 28 deletions
diff --git a/tools/TODO b/tools/TODO
index 0ccb9b7..3641b46 100644
--- a/tools/TODO
+++ b/tools/TODO
@@ -8,3 +8,14 @@ TODO
* Oppsett av dvswitch i fra cvs-fil
* Full støtte for dv- og hdv-video i alle scripts
* Automatisere alt av manuell postprod. ;)
+
+./audio_spectrogram 20100112-munin.wav
+ * Generating spectrogram...sox spectrogram: only 1 channel is
+ * supported
+mv: cannot stat `spectrogram.png': No such file or directory
+OK!
+
+
+må lage et script som sjekker antall channels, så putte det i
+spectrogram scriptet.
+
diff --git a/tools/audio_channels_diff b/tools/audio_channels_diff
index aba08cc..076bf74 100755
--- a/tools/audio_channels_diff
+++ b/tools/audio_channels_diff
@@ -18,10 +18,10 @@ if [ -z "$1" ]; then
exit 1
fi
-echo "Checking $1 audio channels..."
+echo " * Checking $1 for different audio channels:"
if [ ! -f "$NAME.$FORMAT" ]; then
- echo "File $NAME.$FORMAT does not exists."
+ echo " * File $NAME.$FORMAT does not exists:"
./audio_extract $1 0 60 # øke til feks 2?
fi
@@ -34,11 +34,11 @@ LEFT=`grep Mean $NAME-left.stat | md5sum`
RIGHT=`grep Mean $NAME-right.stat | md5sum`
if [ "$LEFT" == "$RIGHT" ]; then
- echo "Audio channels is equal."
+ echo " * Audio channels is equal!"
rm $NAME.$FORMAT $NAME-left* $NAME-right*
exit
else
- echo "Audio channels is not equal."
+ echo " * Audio channels is not equal!"
rm $NAME.$FORMAT $NAME-left* $NAME-right*
exit 3
fi
diff --git a/tools/audio_extract b/tools/audio_extract
index e13c601..2c040ea 100644
--- a/tools/audio_extract
+++ b/tools/audio_extract
@@ -15,6 +15,7 @@ if [ -z "$1" ]; then
exit 1
fi
+./require ffmpeg
#if [ "$FORMAT" == "pcm_s16le" ]; then
# FORMAT="wav"
#fi
diff --git a/tools/audio_split b/tools/audio_split
index 48d3065..8ccd089 100755
--- a/tools/audio_split
+++ b/tools/audio_split
@@ -14,9 +14,11 @@ if [ -z "$1" ]; then
exit 1
fi
+./require sox
# sox FAIL formats: can't open output file `1-left.mp2': SoX was compiled without MP3 encoding support
# kan ikke encode til mp{2,3}...
-echo "Splitting up audio to a left- and right-file..."
+echo -n " * Splitting up audio to a left- and right-file..."
sox $1 -c 1 $NAME-left.wav mixer -l 2> /dev/null
sox $1 -c 1 $NAME-right.wav mixer -r 2> /dev/null
+echo -e "OK!"
diff --git a/tools/audio_stats b/tools/audio_stats
index 4560004..f6e9ccc 100755
--- a/tools/audio_stats
+++ b/tools/audio_stats
@@ -11,5 +11,8 @@ if [ -z "$1" ]; then
exit 1
fi
-echo "Generating audio statistics for $1..."
+./require sox
+
+echo -n " * Generating audio statistics for $1..."
sox $1 -n stat
+echo -e "OK!"
diff --git a/tools/merge_audio_stereo_track b/tools/merge_audio_stereo_track
index 2cf5f64..ccdf871 100644
--- a/tools/merge_audio_stereo_track
+++ b/tools/merge_audio_stereo_track
@@ -15,19 +15,9 @@ if [ -z "$1" ]; then
exit 1
fi
-echo "Processing $1:"
-
-echo -n " * Extracting audio..."
-./extract_audio $1
-echo -e "OK"
-
-echo -n " * Splitting up audio..."
+./audio_extract $1
./split_audio $NAME.$AFORMAT
-echo -e "OK"
-
-echo -n " * Merging new audio with video..."
-./merge_av $NAME-new.$AFORMAT $1
-echo -e "OK"
+#./merge_av $NAME-new.$AFORMAT $1
-rm $1 $NAME.$AFORMAT $NAME-new.$AFORMAT
-mv $NAME-new.$EXT $1
+#rm $1 $NAME.$AFORMAT $NAME-new.$AFORMAT
+#mv $NAME-new.$EXT $1
diff --git a/tools/process-video b/tools/process-video
index c80c4f7..150fbf7 100644
--- a/tools/process-video
+++ b/tools/process-video
@@ -22,11 +22,11 @@ if [ "${?}" == "1" ] ; then
exit 1
fi
-##./audio_channels_diff $1
-##if [ "${?}" == "3" ] ; then
-## echo "should run ./merge_audio_stereo_track $1...neh.."
+./audio_channels_diff $1
+if [ "${?}" == "3" ] ; then
+# echo "should run ./merge_audio_stereo_track $1...neh.."
# #./merge_audio_stereo_track $1
-##fi
+fi
## ./audio_check_silence
diff --git a/tools/split_audio b/tools/split_audio
index e615a50..0835870 100644
--- a/tools/split_audio
+++ b/tools/split_audio
@@ -19,7 +19,23 @@ fi
#sox $1 -c 1 left.wav mixer -l 2> /dev/null
#sox $1 -c 1 right.wav mixer -r 2> /dev/null
./audio_split $1
-sox -m $NAME-left.wav $NAME-right.wav mono.wav 2> /dev/null
-sox mono.wav -c 2 stereo.wav 2> /dev/null
-ffmpeg -i stereo.wav -acodec $EXT -ab "$BITRATE"k $NAME-new.$EXT 2> /dev/null
-rm $NAME-left.wav $NAME-right.wav mono.wav stereo.wav
+
+echo -n " * Merging channels to mono..."
+sox -m $NAME-left.wav $NAME-right.wav $NAME-mono.wav
+# 2> /dev/null
+echo -e "OK!"
+
+echo -n " * Creating two-channel-stereo from mono..."
+sox $NAME-mono.wav -c 2 $NAME-stereo.wav
+# 2> /dev/null
+echo -e "OK!"
+
+echo -n " * Encoding to format: $EXT with bitrate $BITRATE
+k)..."
+ffmpeg -i $NAME-stereo.wav -acodec $EXT -ab "$BITRATE"k $NAME-new.$EXT
+#2> /dev/null
+echo -e "OK!"
+
+echo -n " * Removing temp. sound files..."
+#rm $NAME-left.wav $NAME-right.wav $NAME-mono.wav $NAME-stereo.wav
+echo -e "OK!"