diff options
author | GrailFinder <wohilas@gmail.com> | 2023-02-05 12:53:17 +0300 |
---|---|---|
committer | GrailFinder <wohilas@gmail.com> | 2023-02-05 12:53:17 +0300 |
commit | faa4e859d23670c5750304418c245004fe59e102 (patch) | |
tree | afbb029ffb45f0e4654023597b1134ce96472414 | |
parent | 4504c6b802edf6c8abb8fc61becc6fdb3c071eea (diff) |
Feat: add outdir; use metadata
-rwxr-xr-x | cut_by_vtt.sh | 10 |
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 |