[FFmpeg-trac] #1845(avformat:open): Encoded movies with mov_text subtitles do not play with QT Player

FFmpeg trac at avcodec.org
Sun Mar 10 23:18:29 CET 2013


#1845: Encoded movies with mov_text subtitles do not play with QT Player
--------------------------------------+------------------------------------
             Reporter:  Atarikid      |                    Owner:
                 Type:  defect        |                   Status:  open
             Priority:  normal        |                Component:  avformat
              Version:  git-master    |               Resolution:
             Keywords:  mov mov_text  |               Blocked By:
             Blocking:                |  Reproduced by developer:  1
Analyzed by developer:  0             |
--------------------------------------+------------------------------------

Comment (by philipl):

 So, there are multiple things going on here that affect the success, or
 otherwise, of this process.

 1) File type subtleties

 There are meaningful differences between mov/mp4/ipod output types as
 generated by the mov encoder. I always use 'ipod' and I've succeeded in
 producing files with subtitle tracks that are recognised by all tested
 players (QT, iPad, mplayer) this way. But not always. I've got input
 samples that don't seem to yield subtitles recognised by QT even with the
 same command line. Don't get it. As mentioned above, there may be some
 subtitle timebase translation failure going on when remuxing existing mp4
 files.

 2) The definite feature gaps

 a) The width/height and positional offset of the text track need to be set
 to meaningful values by the mov encoder (this header is not handled by the
 mov_text encoder).

 b) The text box (which exists within the text track) needs to be sized to
 meaningful values by the mov_text encoder.

 In practice, these values are closely related and in turn closely related
 to the width/height of the video track. I have no idea how one would
 sanely set these values in a file with multiple video tracks and/or ones
 with varying sizes.

 A rough heuristic that works for a single constant size video is that the
 text track has the same width as the video, and some 'reasonable' height
 in pixels - which we might be able to derive as a percentage of the video
 height. The vertical offset of the text track is then video height - text
 height - assuming we want the subtitle area to be aligned exactly with the
 bottom of the video area. (It is legal to offset outside the video area
 and the quicktime player will make this work)

 The text box is then 'normally' sized to the dimensions of the text track
 (ie: fills the whole track). This means that the mov_text encoder cannot
 know ahead of time what a reasonable size for the text box is. We'd really
 have to make the mov encoder re-write these values when writing the track
 header.

 This is all massively overengineered and very hard to get right, because -
 of course, subtitle size and display area really should be controlled by
 the playback device and not by the file encoder!

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1845#comment:21>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list