ffmpeg:subtitles:add_subtitles_from_a_srt_file
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ffmpeg:subtitles:add_subtitles_from_a_srt_file [2024/12/30 19:55] – created peter | ffmpeg:subtitles:add_subtitles_from_a_srt_file [2024/12/30 22:10] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ffmpeg - Subtitles - Add subtitles from a SRT file ====== | ====== ffmpeg - Subtitles - Add subtitles from a SRT file ====== | ||
+ | |||
+ | ===== Adding Soft Subtitles ===== | ||
+ | |||
+ | <code bash> | ||
+ | ffmpeg -i input.mp4 -i subtitle.srt -c copy -c:s mov_text -metadata: | ||
+ | |||
+ | ffmpeg -i input.mp4 -i subtitle.srt -c copy -c:s srt -metadata: | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE:** Different syntax is used for MP4 and MKV. | ||
+ | |||
+ | * **-c** copy specifies that the video is not to be re-encoded. | ||
+ | * **-c:s mov_text** sets the SRT file to MOV_TEXT format. | ||
+ | * **-c:s srt** sets the SRT 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> | <code bash> | ||
Line 12: | Line 36: | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Adding Soft Subtitles with additional formatting ===== | ||
+ | |||
+ | Use a SRT subtitle file and change the size of the font by putting ASS style format **KEY=VALUE** pairs separated by a comma. | ||
+ | |||
+ | <code bash> | ||
+ | ffmpeg -i input.mp4 -vf subtitles=sub.srt: | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | https:// | ||
ffmpeg/subtitles/add_subtitles_from_a_srt_file.1735588521.txt.gz · Last modified: 2024/12/30 19:55 by peter