labunix's blog




$ ffmpeg -i target.mp4 -vf "'FontSize=20,Alignment=6'" output3.mp4



 debian stretch+ffmpegで字幕ファイルsrt/assをなるべく簡単に作成してみる。


$ w3m -dump | \
    grep -A 23 "Line alignment (legacy)"
Line alignment (legacy)


Specify the alignment of the line using legacy alignment codes from SubStation
Alpha. This tag is supported but considered deprecated; you should usually use
\an in new scripts instead, as it is more intuitive.

The exception is that \a6 should be used for lazy sign translating, because if
you're going to be lazy you should do it right and save the extra character.

Calculate pos as follows: Use 1 for left-alignment, 2 for center alignment and
3 for right-alignment. If you want sub-titles you're done. To get top-titles,
add 4 to the number, to get mid-titles add 8 to the number:

  • 1: Bottom left
  • 2: Bottom center
  • 3: Bottom right
  • 5: Top left
  • 6: Top center
  • 7: Top right
  • 9: Middle left
  • 10: Middle center
  • 11: Middle right