ffmpeg:subtitles:add_subtitles_from_an_ass_file
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ffmpeg:subtitles:add_subtitles_from_an_ass_file [2024/12/30 21:07] – created peter | ffmpeg:subtitles:add_subtitles_from_an_ass_file [2024/12/30 22:08] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ffmpeg - Subtitles - Add subtitles from an ASS file ====== | ====== ffmpeg - Subtitles - Add subtitles from an ASS file ====== | ||
+ | |||
+ | An ASS (Advanced SubStation Alpha) file is a subtitle format that supports text styling, animation, and karaoke-like graphics. | ||
+ | |||
+ | * ASS is a text-based subtitle format. | ||
+ | * Any text editor can open .ass files. | ||
+ | |||
+ | ASS is a more advanced subtitle format than SRT since ASS allows for more advanced display features such as text positioning, | ||
+ | |||
+ | * SRT is more popular than ASS. | ||
+ | |||
+ | ASS files have INI-style sections. | ||
+ | |||
+ | * Each section is preceded by a line containing the sections name, in square brackets. | ||
+ | * Aside from this, each line is generally composed of: a line descriptor, which tells about what the line is about; a colon; and the line data itself. | ||
+ | * Any whitespace between these parts are allowed. | ||
+ | * Blank lines are also allowed. | ||
+ | * Hard comment lines are preceded by either a semicolon or !: (with " | ||
+ | * Unrecognized and incorrect line formats are ignored. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Adding Soft Subtitles ===== | ||
+ | |||
+ | <code bash> | ||
+ | ffmpeg -i input.mp4 -i subtitle.ass -c copy -c:s mov_text -metadata: | ||
+ | |||
+ | ffmpeg -i input.mp4 -i subtitle.ass -c copy -c:s srt -metadata: | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * **-c** copy specifies that the video is not to be re-encoded. | ||
+ | * **-c:s mov_text** sets the ASS file to MOV_TEXT format for MP4. | ||
+ | * **-c:s srt** sets the ASS file to SRT format for MKV. | ||
+ | * **-metadata: | ||
+ | * **language=eng** sets the subtitle language to English. | ||
+ | * The value for this option uses the [[https:// | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Adding Hard Subtitles ===== | ||
+ | |||
+ | <code bash> | ||
+ | ffmpeg -i input.mp4 -vf ass=subtitle.ass output.mp4 | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * **-vf** is an alias for **-filter: | ||
+ | * **ass=subtitle.ass** is the name of the filter followed by the name of the ASS subtitle file. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | https:// | ||
ffmpeg/subtitles/add_subtitles_from_an_ass_file.1735592855.txt.gz · Last modified: 2024/12/30 21:07 by peter