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

Philip Langdale philipl at overt.org
Mon Mar 11 21:10:37 CET 2013

On 2013-03-10 22:34, Reimar Döffinger wrote:
> 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.

Yeah, except that in the most common cases of srt/ass subtitles as
input, there was no sizing information to begin with. :-(

>> 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.

Agreed. I should respect sizing that the track had to begin with. Do
we have any existing _text_ formats that have meaningful sizing 


More information about the ffmpeg-devel mailing list