FFmpeg Prerequisites: Do You Have These?
40sShows a quick checklist that many beginners overlook, making it relatable and useful.
▶ Play ClipThis tutorial demonstrates how to add subtitles to a video using FFmpeg. It covers the prerequisites, the process for embedding soft subtitles into MP4 and MKV files, and explains the key commands involved.
You need FFmpeg installed, a video file (e.g., my_video.mp4), and a subtitle file in SRT format.
An SRT file starts with a number, then timing (e.g., 0:00:01,000 --> 0:00:04,000), then the subtitle text. Save as .srt.
Command: `ffmpeg -i video.mp4 -i subtitles.srt -c copy -c:s mov_text output.mp4`. This copies video/audio without re-encoding and embeds subtitles as a track.
Command: `ffmpeg -i video.mp4 -i subtitles.srt -c copy -c:s srt output.mkv`. Similar to MP4 but uses 'srt' codec for MKV container.
By following these steps, you can easily add soft subtitles to any video using FFmpeg, preserving original quality and allowing subtitles to be toggled on/off.
"The title accurately describes the tutorial content, which delivers exactly what it promises."
What are the three prerequisites for adding subtitles with FFmpeg?
FFmpeg installed, a video file, and an SRT subtitle file.
0:26
What is the format of an SRT file?
A number, then timing in HH:MM:SS,mmm --> HH:MM:SS,mmm, then the subtitle text.
1:28
What does the '-c copy' flag do in FFmpeg?
It copies video and audio streams without re-encoding, preserving quality.
2:40
What codec is used for soft subtitles in MP4 files?
mov_text
2:50
What codec is used for soft subtitles in MKV files?
srt
4:28
Soft subtitles command for MP4
Provides the exact FFmpeg command to embed subtitles without re-encoding, a key technique for video editors.
2:08Soft subtitles command for MKV
Shows the slight variation needed for MKV containers, demonstrating FFmpeg's flexibility.
3:44Copy flag preserves quality
Explains the importance of '-c copy' to avoid quality loss, a crucial principle for video processing.
2:40[00:00] Welcome to full course online.
[00:02] In this tutorial, you will learn how to
[00:04] add subtitles to a video using FFmpeg.
[00:08] Before we begin, if you want to know how
[00:11] to configure and install FFmpeg, watch
[00:14] another video in this playlist.
[00:16] That video will guide you step by step
[00:19] through the installation.
[00:21] Now, let's continue.
[00:26] You need three things before adding
[00:28] subtitles.
[00:30] ffmpeg installed on your computer. Open
[00:34] command prompt and type ffmpeg.
[00:40] If you see output like this, then ffmpeg
[00:43] is configured on your PC. If not, then
[00:46] watch this video. Second thing you need
[00:49] is a video file. For example, my
[00:51] video.mpp4.
[00:54] In our case, the file is stored in D
[00:56] drive. Let me play the video.
[01:00] >> Hello everyone. Welcome to full course
[01:02] on
[01:03] >> As you can hear the voice of a female.
[01:06] Let me check the subtitle. And as you
[01:08] can see, there is no subtitle available.
[01:12] The third thing you need is a subtitle
[01:14] file in SRT format. For example, my
[01:17] video. SRT.
[01:19] If you don't already have a subtitle
[01:21] file, you can create one with a text
[01:24] editor. Here is a simple example.
[01:28] Line one starts with a number. Then
[01:31] comes the timing.
[01:33] For example, 0 hours, 0 minutes,
[01:38] 1 second
[01:40] to 0 hours,
[01:44] 0 minutes for seconds.
[01:47] Then write the subtitle text.
[01:51] Save the file as my video. SRT.
[01:58] There are also many transcribe tools
[02:00] available which can convert audio file
[02:03] to SRT.
[02:08] Now let's add subtitles in a soft
[02:11] format.
[02:12] This means the subtitles are inside the
[02:14] video but can be turned on or off. The
[02:18] command is given on the screen. Here's
[02:21] how this command works.
[02:23] The first dash I gives the input video
[02:26] file which is my video.mpp4
[02:28] located in the D drive. The second dash
[02:32] I gives the subtitle file which is my
[02:34] video. SRT located in the SRT folder
[02:38] inside the D drive.
[02:40] - Copy means copy the video and audio
[02:43] streams without re-encoding. So there is
[02:45] no loss in quality. - C col sRT tells
[02:50] FFmpeg to take the subtitle file and
[02:53] save it as an SRT track inside the
[02:55] output container.
[02:57] Finally, we name the output file as
[03:00] output MKV.
[03:02] Mention correct path of both video file
[03:04] and SRT file. The output file name is
[03:08] output and will be stored on D drive.
[03:11] This keeps the video quality the same
[03:13] and only adds the subtitle track.
[03:21] Let us test it. Open the output file in
[03:24] VC media player.
[03:26] >> Hello everyone. Welcome to full course
[03:28] online.
[03:29] >> As you can see now we can turn on
[03:31] subtitles
[03:34] >> in the search box. A list of websites l
[03:38] >> you can see the subtitles on the screen.
[03:40] Now,
[03:44] if you prefer MKV format, the command is
[03:47] slightly different. The command can be
[03:50] seen on the screen. Here's how this
[03:53] command works. The first dash I tells
[03:56] ffmpeg the input video file. In this
[04:00] case, it is my video.mpp4 stored in the
[04:03] D drive. The second dash I tells FFmpeg
[04:07] the input subtitle file. Here we are
[04:10] using my video. SRT stored inside the
[04:13] SRT folder on the D drive. - Copy means
[04:18] copy the video and audio streams exactly
[04:20] as they are without re-encoding.
[04:24] This makes the process fast and keeps
[04:26] the original quality.
[04:28] - CSRT
[04:30] tells FFmpeg to copy the subtitle file
[04:33] and embed it as an SRT track in the new
[04:36] container.
[04:37] And finally we give the output file name
[04:40] as output.m MKV which will be saved in
[04:43] the D drive. This way the MKV file
[04:46] includes the subtitles as a separate
[04:49] track.
[04:59] That's it. Now you know how to add
[05:01] subtitles to any video using FFmpeg.
[05:05] Subscribe this channel for more such
[05:07] videos.
[05:09] Thanks for watching.
⚡ Saved you 0h 05m reading this? Transcribe any YouTube video for free — no signup needed.