Last active
August 20, 2020 07:10
-
-
Save josuecau/16a9303d747d9db7f9da10c7c358e1c0 to your computer and use it in GitHub Desktop.
Using ffmpeg in Docker to add srt subtitle files to mp4 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Using ffmpeg in Docker to add srt subtitle files to mp4 files | |
# | |
# https://mutsinzi.com/add-srt-subtitles-to-quicktime/ | |
# https://hub.docker.com/r/jrottenberg/ffmpeg | |
# Given the following directory structure: | |
# . | |
# ├── in | |
# │ ├── Subs | |
# │ │ └── French.fre.srt | |
# │ └── video.mp4 | |
# └── out | |
docker run --rm \ | |
-v "$(pwd)/in:/tmp/workdir/in" \ | |
-v "$(pwd)/out:/tmp/workdir/out" \ | |
jrottenberg/ffmpeg \ | |
-i in/video.mp4 -i in/Subs/French.fre.srt -c:v copy -c:a copy \ | |
-c:s mov_text -metadata:s:s:0 language=fre out/video.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment