FFmpeg 字幕

来自艺搜天下
跳到导航 跳到搜索

two filters: subtitles or ass.

--enable-libass #ASS (Advanced SSA), SSA (SubStation Alpha) subtitle

ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi
ffmpeg -i video.avi -vf "ass=subtitle.ass" out.avi  #需要先转换为ass:ffmpeg -i subtitle.srt subtitle.ass

list all the subtitle codecs that FFmpeg supports:

ffmpeg -codecs | grep "^...S"
ffmpeg -i video.mkv -vf subtitles=video.mkv out.avi# 如果字幕在video.mkv中

基于图片的字幕

dvdsub is a type of picture-based overlay subtitles

ffmpeg -i input.mkv -filter_complex "[0:v][0:s]overlay[v]" -map "[v]" -map 0:a <output options> output.mkv

参考

http://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo