Skip to content

Soft Subtitles vs. Hard Subtitles: One FFmpeg Guide to Rule Them All!

When using video translation software like pyVideoTrans, you'll face the choice of "embedding soft subtitles" or "embedding hard subtitles." What are the differences between these two methods? What are their respective advantages and disadvantages? And how can you use FFmpeg to implement them?

Choosing subtitle embedding method in video translation software

Don't worry, this guide will help you understand everything in the simplest way possible!

Two Subtitle Embedding Methods: Soft vs. Hard

Imagine subtitles as "text clothing" for your video. This clothing can be worn in two ways:

  1. Soft Subtitles: Like a jacket that can be put on or taken off at any time. The subtitle data and video frames are stored separately but packaged in the same video file (e.g., MP4 or MKV file). Viewers can freely choose whether to display subtitles when playing the video. If the video contains subtitles in multiple languages, they can even switch between different languages.
  2. Hard Subtitles: Also known as "burned-in subtitles." This is like printing a text pattern directly onto the clothes, making it an integral part of the clothing. The pixel information of the subtitles is directly "drawn" onto each frame of the video, becoming part of the video image. Once created, the subtitles are always displayed and cannot be turned off or changed.

FFmpeg Command Practice: Let's Do It!

FFmpeg is a powerful open-source multimedia processing tool that we can use to add both types of subtitles to videos. Below are two specific command examples, assuming we have a video file 1.mp4 and a subtitle file (SRT or ASS format).

If you want viewers to be able to control the subtitle display themselves, or if you provide subtitles in multiple languages for selection, then soft subtitles are your first choice.

FFmpeg Command:

bash
ffmpeg -i 1.mp4 -i 1.srt -c:v copy -c:s mov_text -metadata:s:s:0 language=chn -movflags +faststart out_soft_subs.mp4

Command Interpretation, Understand Each Sentence:

  • ffmpeg: The boss appears, telling the computer that we are going to use FFmpeg to work.
  • -i 1.mp4: The first input file is our original video.
  • -i 1.srt: The second input file is our SRT format subtitle file. (SRT is a common plain text subtitle format)
  • -c:v copy: -c:v refers to the video encoder (codec for video). copy means "direct copy," without re-encoding the video. The advantage of doing this is that it's super fast and there is no loss of video quality!
  • -c:s mov_text: -c:s refers to the subtitle encoder (codec for subtitles). mov_text is a text subtitle format supported by MP4 files. We convert the SRT subtitles into this format and embed them into the MP4.
  • -metadata:s:s:0 language=chn: This sentence adds an "ID card" to the subtitle.
    • -metadata: Set metadata.
    • :s:s:0: s stands for stream, the first s represents the subtitle stream, and 0 represents the first subtitle stream (if multiple are embedded, there will be 1, 2...).
    • language=chn: Tell the player that this subtitle is in Chinese ("chn" is the international standard code for Chinese). This way, the player can correctly display "Chinese" in the subtitle selection list.
  • -movflags +faststart: This is a small optimization for MP4 files. It puts some important "index information" of the video at the beginning of the file, so that the video can start playing faster on the network, improving the user experience.
  • out_soft_subs.mp4: The output file name. Our processed video with soft subtitles will be named this.

What Does This Command Do?

It takes the video frames of 1.mp4 as they are, and then converts the 1.srt subtitle file into mov_text format, and inserts it into the final out_soft_subs.mp4 file as an independent subtitle track.

Summary of Soft Subtitle Features:

  • Advantages:
    • Viewers can freely choose to show/hide subtitles, or switch between different language subtitles.
    • Fast production speed, lossless video quality (because the video is copyed).
    • Convenient file management, video and subtitles are packaged in one file.
  • Disadvantages:
    • Compatibility Issues: Although most modern players (such as VLC, PotPlayer, mobile phone players) support it well, subtitles may not be displayed on some older devices or in certain specific playback environments (especially when using the <video> tag to play directly in a web browser), or users may need to set it manually.
    • Limited Styles: SRT subtitles themselves have simple styles, and the final display effect depends more on the player's own rendering capabilities.

If you want the subtitles to be displayed no matter what, or if your subtitle file (such as ASS format) contains many cool styles (fonts, colors, positions, animations, etc.) and you don't want these styles to be lost, then hard subtitles are your choice.

FFmpeg Command:

bash
ffmpeg -i 1.mp4 -c:v libx264 -vf subtitles=1.ass -movflags +faststart out_hard_subs.mp4

Command Interpretation:

  • ffmpeg -i 1.mp4: Same as above, specify the input video.
  • -c:v libx264: -c:v is still the video encoder. But this time we are using libx264. This is a very popular, high-quality H.264 video encoder. Note: This is no longer copy, which means the video will be re-encoded!
  • -vf subtitles=1.ass: This is the core!
    • -vf: Indicates that we want to use a video filter.
    • subtitles=1.ass: subtitles is the name of the filter we want to use. It will read the 1.ass subtitle file (ASS format supports rich styles) and then "draw" the subtitle content onto each frame of the video.
  • -movflags +faststart: Also for network playback optimization.
  • out_hard_subs.mp4: The output video file name with hard subtitles.

What Does This Command Do?

It will first read the video of 1.mp4, then call the subtitles filter to render the content (including all styles) of the 1.ass subtitle file and overlay it on the video screen. Finally, the libx264 encoder is used to re-encode this new video stream with subtitles and save it as out_hard_subs.mp4.

Summary of Hard Subtitle Features:

  • Advantages:
    • Excellent Compatibility: As long as the player can play this video, the subtitles will definitely be displayed. No need to worry about whether the player supports the subtitle function. Especially suitable for playing directly on web pages or on some devices with simple functions.
    • Perfect Style Preservation: If you are using an advanced subtitle format like ASS, hard subtitles can perfectly preserve all fonts, colors, positions, dynamic effects, etc. What you see is what you get!
  • Disadvantages:
    • Subtitles Cannot Be Turned Off or Changed: The subtitles have become part of the screen, and the audience cannot turn them off.
    • Video Needs to Be Re-encoded: This means:
      • Slower Processing Speed: Re-encoding takes more time than direct copying.
      • Picture Quality May Be Lost: Re-encoding will always lose some picture quality more or less, unless you set a very high bit rate (which will also lead to a larger file).
    • Difficult to Modify: Once burned in, it is very troublesome to change the subtitle content or style, basically requiring re-production.

Soft Subtitles vs. Hard Subtitles: How to Choose?

Understanding their differences and advantages and disadvantages makes the choice clear:

  • Pursue flexibility and lossless picture quality, and the target audience uses relatively modern players? -> Choose soft subtitles.

    • For example: making instructional videos and wanting users to be able to choose to turn on or off Chinese/English subtitles; sharing movies with friends who can watch them with VLC and other players.
    • pyvideotrans operates similarly to the first command when the user chooses to embed "soft subtitles."
  • Pursue ultimate compatibility, hoping that subtitles can be displayed in any situation, or subtitle styles are very important and complex? -> Choose hard subtitles.

    • For example: producing promotional videos that need to be played on various devices (including old TVs and projectors); video subtitles have special typesetting and animation effects; or you just want to ensure that everyone can see the subtitles when they open the video, regardless of whether they know how to set up the player.
    • pyvideotrans operates similarly to the second command when the user chooses to embed "hard subtitles."

A Small Supplement: About External Subtitles

In fact, there is another common form of subtitles called External Subtitles. That is, the subtitle file (such as movie.srt) and the video file (such as movie.mp4) are two independent files and placed in the same folder. The player will automatically load or allow users to manually load.

  • Advantages: It is super convenient to edit subtitles (you can directly modify SRT with Notepad), and the compatibility is also very good.
  • Disadvantages: It is easy to miss the subtitle file when sharing, or the file name does not match, causing it to fail to load. It is also more troublesome to manage multiple subtitle files.

The "embedded soft subtitles" we discussed today are to solve the problem of inconvenient distribution of external subtitles by packaging the subtitles into the video file.

Conclusion

Through this guide, I believe you have a clearer understanding of the principles and methods of FFmpeg for processing soft subtitles and hard subtitles:

FeatureEmbedded Soft SubtitlesHard Subtitles / Burned-in
Core of Production Command-c:v copy (video not re-encoded), -c:s mov_text (embedded)-c:v libx264 (video re-encoded), -vf subtitles (burned-in)
Viewer ControllabilityCan be turned on/off, can be switchedCannot be turned on/off, fixed display
Video QualityLossless (due to copy)Potentially lossy (due to re-encoding)
Processing SpeedFastSlow
Style PreservationDepends on the player, simple stylesPerfect preservation (especially with ASS)
CompatibilityGood, but some environments may not support itExcellent, subtitles can be viewed as long as the video can be played

In tools like pyvideotrans, understanding the difference between these two types of subtitles can help you make the best choice based on your needs and present your video work to the audience in the most appropriate way.