[FFmpeg-devel] [PATCH] RFC: Set reasonable subtitle dimensions for timed-text in mov/mp4.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Mar 11 06:34:02 CET 2013

On 11 Mar 2013, at 00:23, Philip Langdale <philipl at overt.org> wrote:
> See https://ffmpeg.org/trac/ffmpeg/ticket/1845.
> It's crazy, but the full spec for timed-text subtitles, requires
> specifying dimensions and positioning for the subtitle rendering
> area, and doing so in pixels, which pretty much means you have to
> know the size of the video stream being shown, so that the subtitles
> can be meaningfully placed over it.

That is not unusual, which is why the width/height of the subtitle stream should indicate the resolution of the video for which the subtitles were meant.

> This diff shows one possible way of implementing a reasonable
> heuristic for the subtitle area: Find the first video stream and
> set the subtitle area to be of equal width and 10% height, and
> place it 90% of the way down the video, so that it occupies the
> bottom 10% of the video area.

Which means you should at most fall back to the first video stream if the subtitle track has no width/height itself.

More information about the ffmpeg-devel mailing list