Embed ASS Subtitles in MP4 with FFmpeg

This article provides a quick and practical guide on how to embed Advanced SubStation Alpha (ASS) subtitles into an MP4 video container using FFmpeg. You will learn how to either “hardburn” the subtitles directly into the video track to preserve their unique styling and fonts, or “soft-mux” them as a toggleable subtitle track.

Because the MP4 container has limited native support for the advanced styling, fonts, and animations of the ASS format, “hardburning” (or hardsubbing) is the most reliable method. This process draws the subtitles directly onto the video frames. It requires re-encoding the video, meaning the subtitles cannot be turned off, but they will display perfectly on any media player.

To hardburn ASS subtitles, use the following FFmpeg command:

ffmpeg -i input.mp4 -vf "ass=subtitles.ass" -c:a copy output.mp4

Command Breakdown:

Note: If your subtitle file name contains spaces or special characters, wrap the path in escaped quotes, like so: -vf "ass='my subtitles.ass'".


Method 2: Soft-Muxing Subtitles (Lossy Format Conversion)

If you do not want to re-encode your video and prefer “soft” subtitles that can be turned on and off, you must convert the ASS subtitles to mov_text (the standard subtitle format for MP4).

Because mov_text does not support complex ASS styles, positioning, or effects, the subtitles will revert to a basic text style.

To soft-mux the subtitles with format conversion, run:

ffmpeg -i input.mp4 -i subtitles.ass -c:v copy -c:a copy -c:s mov_text output.mp4

Command Breakdown:


Alternative: Keep Soft ASS Styles Using MKV

If you want to keep the subtitles soft (toggleable) and preserve the complex ASS formatting, you should use the Matroska (MKV) container instead of MP4. The MKV container fully supports native ASS subtitle streams.

To merge ASS subtitles into an MKV container without re-encoding the video or audio:

ffmpeg -i input.mp4 -i subtitles.ass -c copy output.mkv

Using -c copy copies all video, audio, and subtitle streams directly into the new container in seconds without losing any quality.