Created
March 14, 2020 17:50
-
-
Save thepoppingone/b53eb7a5919b9f889f9b242f4901cb21 to your computer and use it in GitHub Desktop.
Add srt file to mp4 file and flatten to a mp4 with hardcoded subs
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
#!/bin/sh | |
# Author : Wang Poh Peng | |
# Description : Use FFMPEG to hardcode subs into videos into mkv or mp4 format | |
RED='\033[1;31m' | |
NC='\033[0m' # No Color | |
GREEN='\033[0;32m' | |
CYAN='\033[0;36m' | |
ls | grep '.mp4\|srt' | |
echo "${GREEN}Please enter .mp4 file full name to add subtitles below:${NC}" | |
read MP4FILE | |
echo "${GREEN}Please enter .srt file full name below:${NC}" | |
read SRTFILE | |
echo "${GREEN}Please enter the final output mp4 file e.g. test.mp4:${NC}" | |
read OUTPUTFILE | |
ffmpeg -i $MP4FILE -filter_complex "subtitles=$SRTFILE" -c:a copy $OUTPUTFILE | |
echo "${CYAN}The video file is saved at $PWD/$OUTPUTFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment