Opened 9 years ago

Closed 9 years ago

Last modified 3 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

Description

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 (13)

comment:1 by ExSport, 9 years ago

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.
Thx!

comment:2 by ExSport, 9 years ago

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

comment:3 by ExSport, 9 years ago

Cc: temp0@email.cz added
Priority: normalimportant

comment:4 by ExSport, 9 years ago

Cc: temp0@email.cz removed

comment:5 by Carl Eugen Hoyos, 9 years ago

Priority: importantnormal

comment:6 by Carl Eugen Hoyos, 9 years ago

Component: undeterminedavfilter
Keywords: sub added
Resolution: duplicate
Status: newclosed

Looks like a duplicate of ticket #2067.

comment:7 by ExSport, 9 years ago

Thanks for info and sorry for bump done this way.

comment:8 by ExSport, 9 years ago

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 by gjdfgh, 9 years ago

It's the same problem.

comment:10 by Carl Eugen Hoyos, 9 years ago

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

comment:11 by ExSport, 9 years ago

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

in reply to:  11 comment:12 by llogan, 9 years ago

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] <https://www.bountysource.com/issues/1414440-support-subtitles-in-libavfilter-so-seek-is-honored-for-subtitles-filters-like-hardsubbing>

comment:13 by SubJunk, 3 years ago

Is that BountySource website still being used by the FFmpeg devs? I don't want to post a bounty if not, but this issue is pretty big for media servers because most devices will timeout while waiting for FFmpeg to initially parse the subtitles

Note: See TracTickets for help on using tickets.