Opened 9 years ago

Closed 9 years ago

#5547 closed defect (worksforme)

Drawtext filter borderw option crashes setting fontsize from 10 to 22 using msgothic font

Reported by: nicol Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: drawtext
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

Summary of the bug: Setting fontsize from 10 to 22 crashes, but under 9 and over 23 using msgothic.ttc is fine.
How to reproduce:

ffmpeg-20160512-git-cd244fa-win64-static\bin>ffplay -f lavfi -i testsrc -vf drawtext=fontcolor=white:fontfile='C\:/Windows/Fonts/msgothic.ttc':fontsize=10:text=hoge:borderw=1 -debug 99
ffplay version N-79947-gcd244fa Copyright (c) 2003-2016 the FFmpeg developers  built with gcc 5.3.0 (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-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib  
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 41.102 / 57. 41.102
  libavformat    57. 36.100 / 57. 36.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 45.100 /  6. 45.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
detected 4 logical cores  0 aq=    0KB vq=    0KB sq=    0B f=0/0
[Parsed_testsrc_0 @ 0000000000594d80] size:320x240 rate:25/1 duration:-1.000000 sar:1/1
[AVFilterGraph @ 000000000035a220] query_formats: 2 queried, 1 merged, 0 already done, 0 delayed
[lavfi @ 0000000000590bc0] All info found
Input #0, lavfi, from 'testsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0, 1, 1/25: Video: rawvideo, 1 reference frame (RGB[24] / 0x18424752), rgb24, 320x240 (0x0) [SAR
 1:1 DAR 4:3], 0/1, 25 fps, 25 tbr, 25 tbn
[rawvideo @ 000000000060f8a0] PACKET SIZE: 230400, STRIDE: 960
Video frame changed from size:0x0 format:none serial:-1 to size:320x240 format:rgb24 serial:1
[ffplay_buffer @ 0000000000591600] Setting 'video_size' to value '320x240'
[ffplay_buffer @ 0000000000591600] Setting 'pix_fmt' to value '2'
[ffplay_buffer @ 0000000000591600] Setting 'time_base' to value '1/25'
[ffplay_buffer @ 0000000000591600] Setting 'pixel_aspect' to value '1/1'
[ffplay_buffer @ 0000000000591600] Setting 'frame_rate' to value '25/1'
[ffplay_buffer @ 0000000000591600] w:320 h:240 pixfmt:rgb24 tb:1/25 fr:25/1 sar:1/1 sws_param:
[ffplay_crop @ 0000000003639720] Setting 'out_w' to value 'floor(in_w/2)*2'
[ffplay_crop @ 0000000003639720] Setting 'out_h' to value 'floor(in_h/2)*2'
[Parsed_drawtext_0 @ 0000000003639800] Setting 'fontcolor' to value 'white'
[Parsed_drawtext_0 @ 0000000003639800] Setting 'fontfile' to value 'C:/Windows/Fonts/msgothic.ttc'
[Parsed_drawtext_0 @ 0000000003639800] Setting 'fontsize' to value '10'
[Parsed_drawtext_0 @ 0000000003639800] Setting 'text' to value 'hoge'
[Parsed_drawtext_0 @ 0000000003639800] Setting 'borderw' to value '1'
    nan M-V:    nan fd=   0 aq=    0KB vq= 5852KB sq=    0B f=0/0

Change History (1)

comment:1 by Carl Eugen Hoyos, 9 years ago

Description: modified (diff)
Keywords: drawtext added; Drawtext font removed
Resolution: worksforme
Status: newclosed

I cannot reproduce, please reopen if you can provide backtrace etc. as explained on https://ffmpeg.org/bugreports.html

$ ffmpeg -loglevel 99 -f lavfi -i testsrc=s=hd1080 -vf drawtext=fontcolor=white:fontfile=msgothic.ttc:text=hoge:borderw=1 out.avi
ffmpeg version N-79976-gcb928fc Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --enable-libfreetype --enable-fontconfig
  libavutil      55. 24.100 / 55. 24.100
  libavcodec     57. 41.102 / 57. 41.102
  libavformat    57. 36.100 / 57. 36.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 45.100 /  6. 45.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'lavfi'.
Reading option '-i' ... matched as input file with argument 'testsrc=s=hd1080'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'drawtext=fontcolor=white:fontfile=msgothic.ttc:text=hoge:borderw=1'.
Reading option 'out.avi' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument 99.
Successfully parsed a group of options.
Parsing a group of options: input file testsrc=s=hd1080.
Applying option f (force format) with argument lavfi.
Successfully parsed a group of options.
Opening an input file: testsrc=s=hd1080.
detected 8 logical cores
[Parsed_testsrc_0 @ 0x242e1e0] Setting 's' to value 'hd1080'
[Parsed_testsrc_0 @ 0x242e1e0] size:1920x1080 rate:25/1 duration:-1.000000 sar:1/1
[AVFilterGraph @ 0x242cc60] query_formats: 2 queried, 1 merged, 0 already done, 0 delayed
[lavfi @ 0x242c420] All info found
[lavfi @ 0x242c420] 0: start_time: 0.000 duration: -9223372036854.775
[lavfi @ 0x242c420] stream: start_time: 0.000 duration: -9223372036854.775 bitrate=0 kb/s
Input #0, lavfi, from 'testsrc=s=hd1080':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0, 1, 1/25: Video: rawvideo, 1 reference frame (RGB[24] / 0x18424752), rgb24, 1920x1080 (0x0) [SAR 1:1 DAR 16:9], 0/1, 25 fps, 25 tbr, 25 tbn
Successfully opened the file.
Parsing a group of options: output file out.avi.
Applying option vf (set video filters) with argument drawtext=fontcolor=white:fontfile=msgothic.ttc:text=hoge:borderw=1.
Successfully parsed a group of options.
Opening an output file: out.avi.
[file @ 0x2434d40] Setting default whitelist 'file,crypto'
Successfully opened the file.
[Parsed_drawtext_0 @ 0x243e0e0] Setting 'fontcolor' to value 'white'
[Parsed_drawtext_0 @ 0x243e0e0] Setting 'fontfile' to value 'msgothic.ttc'
[Parsed_drawtext_0 @ 0x243e0e0] Setting 'text' to value 'hoge'
[Parsed_drawtext_0 @ 0x243e0e0] Setting 'borderw' to value '1'
[Parsed_drawtext_0 @ 0x243e0e0] Could not set tabsize.
[AVFilterGraph @ 0x243d160] Error initializing filter 'drawtext' with args 'fontcolor=white:fontfile=msgothic.ttc:text=hoge:borderw=1'
Error opening filters!
[AVIOContext @ 0x243ce40] Statistics: 0 seeks, 0 writeouts
Note: See TracTickets for help on using tickets.