[FFmpeg-devel] DVB Subtitles
Reimar.Doeffinger at gmx.de
Tue Dec 3 16:55:28 CET 2013
On 03.12.2013, at 13:23, JULIAN GARDNER <joolzg at btinternet.com> wrote:
> I have a stream which is in 1280x720 format and when i overlay the subtitles they are small and to the left, which i am guessing is due to them being made for 720x576 displays.
> My question is, using the extra code -filter_complex '[0:v][0:s:1] overlay, scale=iw/2:ih/2', how can this be changed to rescale the subtitles so they match the screen resolution.
> I tried
> -filter_complex '[0:s:1] scale=iw:ih [subs],[0:v][subs] overlay, scale=iw/2:ih/2'
> but im guessing the iw:ih in the 1st scale is the iw:ih of the subs, so it wont change
> Now looking at the code i see the following
> [mpegts @ 0x1ba72f80] sub2video: using canvas 1280x720
> Which leads me to guess this is the problem, as the dvb subs decode will be drawing a 720x576 onto the 1280x720 screen.
> So any ideas on how we get the correct dvb subs on screen for an input other than 720x576
It depends, is there something in the file that indicates what size the subtitles were defined for?
FFmpeg should export that as width/height of the stream.
If it doesn't, it needs to be guessed, which usually means some x576 resolution, at least until we find a subtitle that does not fit in that.
MPlayer for example has some code for guessing.
However I think it might fail here, since it assumes that a HD resolution file will have HD subtitles, who created such a broken file with 720p for video but only SD resolution or the subtitles?
More information about the ffmpeg-devel