[Ffmpeg-devel] Subtitle patches

Michael Niedermayer michaelni
Mon Aug 22 03:10:26 CEST 2005


On Mon, Aug 15, 2005 at 01:40:42PM +0100, Ian Caulfield wrote:
> >maybe merging AVSubtitle & AVSubtitleRect would simplify things if we
> >output multiple AVSubtitles anyway?
> There is a slight semantic difference - an AVSubtitle represents a single 
> page of display - all the AVSubtitleRects within one page are displayed 
> together. For DVD subtitles, it's possible to generate multiple pages from 
> one packet. Perhaps if the decode call returns a list of AVSubtitles?


> >> - Different formats use different coordinate systems - DVB subtitles are
> >>based on a 720x576 frame regardless of video resolution, while DVD
> >>subtitles are given (I think) in video coordinates (does anyone have a
> >>sub-D1 DVD to test this on?). Also DVD subtitles for letterboxed display
> >>are formatted to put the text into the black bars - they're meant to be
> >>scaled separately to the video. Currently there's no way to support this
> >>in the AVSubtitle struct. What would be the best way to represent this?
> >
> >well either convert to the video width/height or set the width/height
> >of the used coordinate system in AVCodecContext, i think the later is
> >better in the long run as there might be multiple video streams with
> >different resolution but the same subtitles
> Agreed that the latter is the better solution. Just wondering how best to 
> implement this.
> DVD subtitles are scaled to video coordinates (although may be stretched 
> to 4:3 with widescreen video). The subtitle stream doesn't specify the 
> video size.
> DVB subtitles are scaled to 720x576 (possible widescreen issues there 
> too).
> If we added fields to AVCodecContext to indicate the frame size then an 
> application such as ffmpeg doing transcoding would have to rescale 
> AVSubtitles itself - might be better to add them to the AVSubtitle 
> structure (or perhaps both?), then an encoder could rescale as it needed 
> without the encoding application needing to know the output resolution.

i would prefer that rescaling is done in the application, not the encoder


More information about the ffmpeg-devel mailing list