embed-subtitles.sh 272 B

12345678910
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. for x in "${@:2}";do
  4. if [ "$#" -ge 2 ];then
  5. ffmpeg -i "$1" -f srt -i "$x" -c:v copy -c:a copy -c:s mov_text /tmp/t.mp4 -y
  6. else
  7. echo Usage: "$0" '[video] [subtitle-file/s (.str)]'
  8. fi
  9. done