How to Add Font size in subtitles in ffmpeg video filter

前端 未结 3 1295
感情败类
感情败类 2020-12-07 21:58

I\'m using this command to crop,scale, and then add subtitles as overlay

ffmpeg -i input.avi  -vf \"[in]crop=in_w:in_h-20:0:0 [crop]; [crop]scale=320:240 [sc         


        
3条回答
  •  渐次进展
    2020-12-07 22:29

    From the documentation you can use a srt subtitle file and change the size of the font by putting ASS style format KEY=VALUE pairs separated by ,. So,

    ffmpeg -i input.mp4 -vf subtitles=sub.srt:force_style='FontName=DejaVu Serif,FontSize=24' -vcodec libx264 -acodec copy -q:v 0 -q:a 0 output.mp4

    will put the subtitles with DejaVu font and size 24 while keeps the quality of the video. I've tried myself and it worked.

提交回复
热议问题