Opened 9 years ago

#4781 new defect

Automatic subtitle scaling

Reported by: Carl Eugen Hoyos Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: sub
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

One sample attached to ticket #679 contains subtitles which are shown with correct size by FFplay but cannot be overlayed unless scaled manually.

$ ffmpeg -i oversized_pgs_subtitles.mkv -filter_complex [0:0][0:4]overlay -qscale 2 -t 5 out.avi
ffmpeg version N-74483-gb807f7e Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      54. 30.100 / 54. 30.100
  libavcodec     56. 57.100 / 56. 57.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 34.100 /  5. 34.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[matroska,webm @ 0x35e14e0] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'oversized_pgs_subtitles.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.1
    creation_time   : 2014-05-18 14:26:43
  Duration: 00:00:09.57, start: 0.000000, bitrate: 642 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709), 848x480, SAR 1:1 DAR 53:30, 23.98 fps, 23.98 tbr, 1k tbn, 180k tbc (default)
    Stream #0:1(eng): Audio: vorbis, 48000 Hz, mono, fltp (default)
    Stream #0:2(jpn): Audio: vorbis, 48000 Hz, mono, fltp
    Stream #0:3(eng): Subtitle: hdmv_pgs_subtitle (default)
    Stream #0:4(eng): Subtitle: hdmv_pgs_subtitle, 1920x1080
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf56.40.101
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 848x480 [SAR 1:1 DAR 53:30], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
    Metadata:
      encoder         : Lavc56.57.100 mpeg4
    Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, mono, fltp, 96 kb/s (default)
    Metadata:
      encoder         : Lavc56.57.100 ac3
Stream mapping:
  Stream #0:0 (h264) -> overlay:main (graph 0)
  Stream #0:4 (pgssub) -> overlay:overlay (graph 0)
  overlay (graph 0) -> Stream #0:0 (mpeg4)
  Stream #0:1 -> #0:1 (vorbis (native) -> ac3 (native))
Press [q] to stop, [?] for help
frame=  120 fps=0.0 q=2.0 Lsize=    3257kB time=00:00:05.02 bitrate=5310.0kbits/s
video:3182kB audio:58kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.503110%

The output file shows no subtitles, ffplay -sst 4 oversized_pgs_subtitles.mkv works fine.
The following works as expected:

$ ffmpeg -i oversized_pgs_subtitles.mkv -filter_complex [0:4]scale=848x480,[0:0]overlay -qscale 2 -t 5 out.avi

Change History (0)

Note: See TracTickets for help on using tickets.