subtitles
Draw subtitles on top of input video using the libass library.
To enable compilation of this filter you need to configure FFmpeg with --enable-libass
. This filter also requires a build with libavcodec and libavformat to convert the passed subtitles file to ASS (Advanced Substation Alpha) subtitles format.
The filter accepts the following options:
- 'filename, f'
-
Set the filename of the subtitle file to read. It must be specified.
- 'original_size'
-
Specify the size of the original video, the video for which the ASS file was composed. For the syntax of this option, check the (ffmpeg-utils)"Video size" section in the ffmpeg-utils manual. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to correctly scale the fonts if the aspect ratio has been changed.
- 'fontsdir'
-
Set a directory path containing fonts that can be used by the filter. These fonts will be used in addition to whatever the font provider uses.
- 'alpha'
-
Process alpha channel, by default alpha channel is untouched.
- 'charenc'
-
Set subtitles input character encoding.
subtitles
filter only. Only useful if not UTF-8. - 'stream_index, si'
-
Set subtitles stream index.
subtitles
filter only. - 'force_style'
-
Override default style or script info parameters of the subtitles. It accepts a string containing ASS style format
KEY=VALUE
couples separated by ",".
If the first key is not specified, it is assumed that the first value specifies the 'filename'.
For example, to render the file 'sub.srt' on top of the input video, use the command:
subtitles=sub.srt
which is equivalent to:
subtitles=filename=sub.srt
To render the default subtitles stream from file 'video.mkv', use:
subtitles=video.mkv
To render the second subtitles stream from that file, use:
subtitles=video.mkv:si=1
To make the subtitles stream from 'sub.srt' appear in 80% transparent blue DejaVu Serif
, use:
subtitles=sub.srt:force_style='FontName=DejaVu Serif,PrimaryColour=&HCCFF0000'
Related
- How to Add Font size in subtitles in ffmpeg video filter
- How to embed subtitles to .mp4 movie using ffmpeg
- Viewing HTML5 video with captions offline
- Redux: how to add subtitles to mp4 using ffmpeg?
- ffmpeg with ass: How can I set the effect on subtitle?
- Merge subtitle to mkv with ffmpeg cause error
- How to add subtitles to the encoded video using ffmpeg?
- How to set default streams with ffmpeg
- Is it possible to extract SubRip (SRT) subtitles from an MP4 video with ffmpeg?
- Can't change video subtitles codec using ffmpeg
- Adding some kind of subtitle to an mp4 with ffmpeg
- Adding multiple subtitle streams to MP4 with FFMPEG
- FFmpeg : how to burn any kinds of subtitle into videos