Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#4499 closed defect (duplicate)

Parse internal subtitles in realtime

Reported by: SubJunk Owned by:
Priority: normal Component: avfilter
Version: unspecified Keywords: sub
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
When using FFmpeg to overlay internal non-SSA subtitles (like SRT) there is a wait time before transcoding while FFmpeg parses all of the subtitles into SSA format, before the video starts transcoding.
In some cases (10+GB MKVs) it can take minutes for the initial extraction to complete. We have had reports of 3+ minutes.
It would be great if it was done as it goes along instead, so that extraction/conversion process is spread out.

How to reproduce:

% ffmpeg -i input.mkv -filter_complex subtitles=input.mkv -c:a ac3 -c:v libx264 -f mpegts file.ts

ffmpeg version N-69972-g6c91afe Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
  libavutil      54. 19.100 / 54. 19.100
  libavcodec     56. 25.100 / 56. 25.100
  libavformat    56. 23.100 / 56. 23.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.100 /  5. 11.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100

Change History (12)

comment:1 Changed 5 years ago by ExSport

Voting for it too.
Any embeded subs must be "extracted/internally parsed" before FFmpeg will start filling pipe or output results to external file so piping more things together always fail.
For 11GB file there is about 3-4min delay which leads to broken chain as other side will timeout before any output is generated.
Btw. I tested also SSA embeded in MKV file and same behavior so it is not limited to non-SSA/ASS only.

comment:2 Changed 5 years ago by ExSport

Is there any workaround for it? It seems there is no interest implementing this :(

comment:3 Changed 5 years ago by ExSport

  • Cc added
  • Priority changed from normal to important

comment:4 Changed 5 years ago by ExSport

  • Cc removed

comment:5 Changed 5 years ago by cehoyos

  • Priority changed from important to normal

comment:6 Changed 5 years ago by cehoyos

  • Component changed from undetermined to avfilter
  • Keywords sub added
  • Resolution set to duplicate
  • Status changed from new to closed

Looks like a duplicate of ticket #2067.

comment:7 Changed 5 years ago by ExSport

Thanks for info and sorry for bump done this way.

comment:8 Changed 5 years ago by ExSport

After reading linked ticket, this problem is totally different.
Problem described here is that internal subs (not external ones) have to be parsed beforehand what delays transcoding process by minutes what makes other side to close connection/pipe.
E.g. mkv file with internal subs have to be extracted before the ffmpeg will burn them to the picture and will start to fill pipe with encoded results. This 4minutes delay every other side will forcefully close or disconnect from open pipe or connection.

comment:9 Changed 5 years ago by gjdfgh

It's the same problem.

comment:10 Changed 5 years ago by cehoyos

Currently "internal subtitles" do not exist because libavfilter does not support subtitles internally.

comment:11 follow-up: Changed 5 years ago by ExSport

Ok, I understand. So the question is, will it be ever supported or some eta if it is worked on?
Many thanks for info

comment:12 in reply to: ↑ 11 Changed 5 years ago by llogan

Replying to ExSport:

So the question is, will it be ever supported or some eta if it is worked on?

FFmpeg generally has no roadmap or milestone goals. It just depends on if anyone has the time and interest. Alternatively you can post a bounty [1] for #2067 which may increase developer/contributor interest.

Also, patch submissions are always welcome.

[1] <>

Note: See TracTickets for help on using tickets.