Opened 4 years ago
#8926 new defect
Burning subtitles silently fails with certain fonts
Reported by: | C0rn3j | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | unspecified | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
I've been trying to follow https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo to burn video into subtitles, but it looks like with certain fonts, it just silently fails, producing the video without subtitles.
How to reproduce:
ffmpeg -i Remembering.gif -vf subtitles=subtitles.srt Remembering2.gif
This works with the first file but not with the one that uses Montara Gothic.
SRT file that works:
1
00:00:00,000 --> 00:00:08,000
Making the magic happen.
SRT file that's broken:
1
00:00:01,620 --> 00:00:03,120
<font face="Montara Gothic" size="65">W— Woah—</font>
Workaround:
Specifying a different font(DejaVu Serif) via force_style got me render with subtitles correctly.
ffmpeg -i Remembering.mkv -vf "fps=10,scale=320:-1:flags=lanczos,subtitles=Remembering.mkv:force_style='Fontsize=70,FontName=DejaVu Serif',split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 Remembering.gif
Logs while using the broken SRT file and ffmpeg version:
% ffmpeg -i Remembering.gif -vf subtitles=RememberingConverted.srt Remembering2.gif ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 10.1.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3 libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Input #0, gif, from 'Remembering.gif': Duration: 00:00:12.00, start: 0.000000, bitrate: 1234 kb/s Stream #0:0: Video: gif, bgra, 320x180 [SAR 64:64 DAR 16:9], 10 fps, 10 tbr, 100 tbn, 100 tbc File 'Remembering2.gif' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (gif (native) -> gif (native)) Press [q] to stop, [?] for help [Parsed_subtitles_0 @ 0x55613b117500] Shaper: FriBidi 1.0.9 (SIMPLE) HarfBuzz-ng 2.7.2 (COMPLEX) [Parsed_subtitles_0 @ 0x55613b117500] Using font provider fontconfig Output #0, gif, to 'Remembering2.gif': Metadata: encoder : Lavf58.45.100 Stream #0:0: Video: gif, bgr8, 320x180 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 10 fps, 100 tbn, 10 tbc Metadata: encoder : Lavc58.91.100 gif [Parsed_subtitles_0 @ 0x55613b117500] fontselect: (Arial, 400, 0) -> /usr/share/fonts/liberation/LiberationSans-Regular.ttf, 0, LiberationSans frame= 120 fps=0.0 q=-0.0 Lsize= 2083kB time=00:00:11.91 bitrate=1432.8kbits/s speed=51.7x video:2083kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000938%
The font file it ends up using exists:
% ls -lah /usr/share/fonts/liberation/LiberationSans-Regular.ttf
.rw-r--r-- root root 399.3 KB Mon Jun 8 07:42:31 2020 LiberationSans-Regular.ttf