summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcut_by_vtt.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/cut_by_vtt.sh b/cut_by_vtt.sh
index a4576a2..ceb58cb 100755
--- a/cut_by_vtt.sh
+++ b/cut_by_vtt.sh
@@ -5,8 +5,16 @@ set -e
filename=${1:-}
audioname=$(printf "$filename" | sed "s/\(.*\).vtt/\1/")
+outdir=$(dirname "$filename")/utterances
+mkdir -p "$outdir"
+
# given vtt what is original ext?
-ffmpeg_commands=$(grep "\-->" $filename | awk -F " " -v aname="$audioname" '{print "ffmpeg -i "aname" -ss " $1 " -to " $3 " -vn -acodec copy " NR ".ogg"}')
+ffmpeg_commands=$(grep "\-->" $filename | awk -F " " \
+ -v aname="$audioname" \
+ -v outdir="$outdir" \
+ '{print "ffmpeg -i "aname" -ss " $1 " -to " $3 \
+ " -metadata text_source=" aname ".vtt" \
+ " -vn -acodec copy " outdir "/" $1"_"$3 ".ogg"}')
while read cline;
do