Batch Convert SRT to WebVTT Without Overwriting Existing Captions

Batch conversion helps when a project has many caption files. Write each .vtt beside its source to preserve folder and language names, and refuse to overwrite any caption a reviewer has already edited.

Worked example

Test an existing file and repeated filenames

captions/en/lesson 1.srt
captions/es/lesson 1.srt
captions/en/lesson 1.vtt [already reviewed]
Expected: the English VTT stays unchanged and the Spanish VTT is created next to its source.

Local FFmpeg batch command

find captions -type f -name "*.srt" -exec sh -c '
  for source do
    ffmpeg -loglevel error -nostdin -n -i "$source" -c:s webvtt "${source%.srt}.vtt"
  done
' sh {} +

Steps

  1. Make a test directory named captions with two or more language folders. Use a copy of the source files for your first run.
  2. Run the command from the parent directory. It searches the whole captions tree, handles spaces in filenames and refuses to replace existing outputs.
  3. Review any file-level errors in the command output. Check the first and last cue for a sample from each language folder before repeating on the rest.

What to check

  • Check warnings even when the command completes. An existing output stays unchanged and may need separate review.
  • Preview any styling or formatting tags in the destination player.

Explore subtitle tools

References