2016年8月13日 星期六

ffmpeg subtitles

burning subtitle into a video is very easy via ffmpeg.

If the subtitle is a separate file called subtitle.srt, you can use this command:
ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi
If the subtitle is embedded in the container video.mkv, you can do this:
ffmpeg -i video.mkv -vf subtitles=video.mkv out.avi
To make the subtitles stream from sub.srt appear in transparent green DejaVu Serif, use:

subtitles=sub.srt:force_style='FontName=DejaVu Serif,PrimaryColour=&HAA00FF00'
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 ",".

REF: https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo
http://ffmpeg.org/ffmpeg-filters.html#subtitles-1
http://blog.xuite.net/allenyin/blog/62389124-%E5%AD%97%E5%B9%95%E8%A3%BD%E4%BD%9C%EF%BC%9ASSA%E5%AD%97%E5%B9%95%E8%A3%BD%E4%BD%9C%E7%95%A5%E8%BF%B0

沒有留言:

張貼留言