To merge an SRT subtitle file into an MKV video on Fedora Linux using a CLI tool, you can use MKVToolNix, which provides the mkvmerge
utility. Follow these steps:
Step 1: Install MKVToolNix
If it’s not already installed, you can install it using dnf
:
sudo dnf install mkvtoolnix
Step 2: Merge the Subtitle File with the Video
Use the mkvmerge
command to add the SRT file to the MKV video:
mkvmerge -o output.mkv input.mkv --language 0:eng subtitles.srt
Explanation of the Options:
-o output.mkv
: Specifies the name of the output file.input.mkv
: The original MKV video file.--language 0:eng
: Sets the language of the subtitle track to English. Replaceeng
with the appropriate language code if needed.subtitles.srt
: The SRT subtitle file to be added.
Step 3: Verify the Output
After the process completes, play the output.mkv
file in a media player like VLC to ensure the subtitles are correctly embedded.
This approach works quickly and efficiently for most use cases. Let me know if you encounter any issues!