wiki:

HowToBurnSubtitlesIntoVideo


Version 10 (modified by rogerdpack, 5 years ago) (diff)

and a third way

You can burn text subtitles with one of two filters: subtitles or ass.

subtitles filter

As of Nov 29, 2012 you can also simply use the subtitles filter:

ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi

This filter requires ffmpeg to be compiled with --enable-libass (if you are building FFmpeg yourself, look for the libass-dev package on Debian-like distributions).

ass filter

Using FFmpeg's ass video filter (see Wikipedia for Advanced SubStation Alpha), we can draw text of the subtitles into the movie, like this:

ffmpeg -i video.avi -vf "ass=subtitle.ass" out.avi

As with the subtitles filter, this filter requires ffmpeg to be compiled with --enable-libass.

If your subtitle is in SubRip, MicroDVD or any other supported text subtitles, you have to convert it to ASS before using the filter:

ffmpeg -i subtitle.srt subtitle.ass

For Windows users this link may be useful, as you have to setup font paths just right to get libass to work

picture based subtitles

You can burn "picture based" subtitles into a movie as well (for instance, dvdsub is a type of picture based overlay subtitles), by using the overlay filter to overlay the images. See the official documentation search for "hardcode".