This project provides a batch script to automatically embed subtitles into videos using FFmpeg on Windows.
- Download FFmpeg from the official website.
- Extract the downloaded ZIP file. You should now have a folder like
ffmpeg-4.x.x-win64-static. - Rename the folder to simply
ffmpegfor easier access. - Move this
ffmpegfolder toC:\. So, it should beC:\ffmpeg\. - Add
C:\ffmpeg\binto your system's PATH:- Right-click on the
Startbutton and selectSystem. - Click on
Advanced system settings. - Click the
Environment Variablesbutton. - Under
System Variables, locate thePathvariable and clickEdit. - Click
Newand add the pathC:\ffmpeg\bin. - Press
OKto save your changes.
- Right-click on the
- Download the project by clicking "Code" (Green button) and then "Download Zip"
- Unzip the files into a folder
- Place your video and .srt files in the folder named "input" (created when you unzipped the project). Remove the files there, they are just a sample. You should have an mp4 file and an srt file named the same.
-
Open Command Prompt (
cmd) as administrator. -
Navigate to the folder you created:
cd path\to\folder
Replace
path\to\SubtitleProjectwith your actual path. -
Run the script:
addsubtitles.bat (or sh addsubtitles.sh in Mac) -
The script will process each video in the
inputfolder. If a corresponding.srtsubtitle file is present, it will embed the subtitles into the video. The output video will have_subtitledadded to its name (e.g.,video1_subtitled.mp4). -
The script will notify you about its progress in the Command Prompt, such as when it's processing a video or if a subtitle file isn't found for a particular video.
-
Once completed, it will display "All videos processed."
- Check the
inputfolder in your porject. - You'll see the original videos, subtitle files, and the new videos with the embedded subtitles.
- Play one of the subtitled videos to ensure the subtitles are correctly embedded.