Imgix APIsVideo APISubtitlesCaption Horizontal Margin

Caption Horizontal Margin

video-caption-margin-x

Sets the horizontal inset and maximum wrap width for burn-in captions.

video-caption-margin-x accepts an integer in pixels. This value controls two things simultaneously:

  1. Inset from horizontal edges — captions are pushed inward from the left and right edges of the frame by this amount.
  2. Text wrap width — caption lines wrap before reaching the opposite edge, with the wrap column determined by the frame width minus twice the margin.

Increasing video-caption-margin-x keeps captions away from the frame edges and prevents them from overlapping letterbox bars or UI elements in the player.

Use video-caption-margin-y to control the vertical inset.