aschmelyun / subvert

Generate subtitles, summaries, and chapters from videos in seconds
https://subvert.dev
MIT License
805 stars 57 forks source link

[Bug] VTT subtitles aren't spaced #26

Open Superpaul209 opened 1 year ago

Superpaul209 commented 1 year ago

Hello,

I have noticed a bug with the generation of the VTT file, it creates a VTT file but the format is wrong and unusable in a video player.

Output example : image

Should be : image

With a blank espace between each subtitle. I have seen that the webVTT format also contains number to each subtitle but its not required.

Thank you

kuubus commented 1 year ago

Here is a temporary solution

repair-subvert-subs.sh

#!/bin/bash

if [ $# -eq 0 ]; then
  echo "Es wurde keine Quelldatei angegeben."
  exit 1
fi

source_file="$1"
target_file="$2"
rm "$2"
counter=1

while read -r line1; do
  read -r line2

  echo "$counter" >> "$target_file"
  echo "$line1" >> "$target_file"
  echo "$line2" >> "$target_file"
  echo "" >> "$target_file"

  ((counter++))
done < "$source_file"

echo "Das Skript wurde erfolgreich ausgeführt."

Usage:

chmod a+x ./repair-subvert-subs.sh

./repair-subvert-subs.sh <source-file> <target-file>