-
Convert SubRip to drawtext (source code included)
I haven’t had much luck with burning in subtitles using ffmpeg’s subtitles filter, so I wrote this tiny Windows CLI app that I would like to share with anyone interested.
The app’s name is ‘srtdrawtext’ and it takes SubRip subtitles (*.srt) as input and outputs a text file containing drawtext commands which ffmpeg (or ffplay) can read via the sendcmd filter. The generated text file basically tells ffmpeg what text to draw and when to draw it. While this method may seem ‘desperate’, this may also prove to be the easiest way to burn-in subtitles.
srtdrawtext (~300 kb) is absolutely free and includes the manual and the source code (210 lines, *.au3) which you can modify/distribute (due credit would be nice). Instructions on how to use the generated text file will be written on the file itself. An example:
ffplay -vf “sendcmd=filename=’C\:\\srtdrawtext_output.txt’, drawtext=fontfile=’C\:\\Windows\\Fonts\\tahoma.ttf’: fontcolor=yellow: fontsize=18: box=1: boxcolor=0x000000@0xA5: x=(w-text_w)*0.5: y=(h-text_h-line_h)*1: text=”” -autoexit -framedrop “C:\Movies\Tinimbang_ka_ngunit_kulang_(1974).avi”
download link:
https://www.mediafire.com/download/epxnpnq39v413hv/srtdrawtext.zip