summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrailFinder <wohilas@gmail.com>2023-02-05 12:53:17 +0300
committerGrailFinder <wohilas@gmail.com>2023-02-05 12:53:17 +0300
commitfaa4e859d23670c5750304418c245004fe59e102 (patch)
treeafbb029ffb45f0e4654023597b1134ce96472414
parent4504c6b802edf6c8abb8fc61becc6fdb3c071eea (diff)
Feat: add outdir; use metadata
-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