[FFmpeg-user] Long delay on subtitle overlay from a subtitles embedded video

Dennis Huang owlhuang at yahoo.com
Mon Apr 24 10:41:25 EEST 2017


Hi all,
First of all, thanks for the great ffmpeg software.  It is useful and neat.  Good job.

My question is regarding the long delay before ffmpeg transcodes a file, with following command,
ffmpeg -i embed_sub.mkv -vf subtitles=embed_sub.mkv -sn result.mkv
With -loglevel trace, it shows the command takes over 30 seconds going through ALL subtitles in mkv before it starts the transcoding.  Yet this causes problem for a real-time transcoding server like Universal Media server, which needs the output stream within certain time, usually a few seconds.  The long wait before the transcoding causes the server to timeout.
When the delay is taking place, it stops with following messages,
[Parsed_subtitles_0 @ 0x1c8f6e0] Shaper: FriBidi 0.19.6 (SIMPLE) HarfBuzz-ng 1.4.5 (COMPLEX)
[Parsed_subtitles_0 @ 0x1c8f6e0] Using font provider fontconfig

I have 2 questions,
1. Why ffmpeg needs to go through all the subtitles before the transcoding?  And2. Is there any way ffmpeg could start the transcoding without the long delay in this case?
The file, embed_sub.mkv includes following tracksTrack1 libx264 videoTrack2 dts audioTrack3 ASS subtitles
Thank you for the time and information in advance.
-Dennis



More information about the ffmpeg-user mailing list