[FFmpeg-trac] #3758(avfilter:new): drawtext filter reverses Arabic text

FFmpeg trac at avcodec.org
Sun Jul 6 14:23:16 CEST 2014


#3758: drawtext filter reverses Arabic text
-------------------------------------+-------------------------------------
             Reporter:  Krieger      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avfilter     |                  Version:  git-
             Keywords:  drawtext,    |  master
  libfreetype                        |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 Arabic text is displayed backwards comparing to supplied parameter.

 How to reproduce:

 This test requires some font supporting Arabic. Below i use a font
 supplied by third party, and i didn't get their agreement yet for
 publishing it here for bug investigation. I don't know which widespread
 free fonts support Arabic (comments are appreciated).

 The issue is reproduced with following command line (i hope non-ASCII
 Arabic letters won't get garbled at transmission).

 I'm not an expert on Arabic, but you can see that there's character like
 "i" on the right, and on rendered picture it goes on the left. I suppose
 that's some smartness of libfreetype. Does anybody know how this behaviour
 could get fixed? Maybe some flag to pass to libfreetype?
 {{{
  $ ffplay -loglevel debug -f lavfi -i
 "color=color=white,drawtext=fontfile=./samples/editor/projects/stc/fonts
 /stc-regular-webfont.ttf:text=أحمد"
 ffplay version N-64175-gb0f3b6d Copyright (c) 2003-2014 the FFmpeg
 developers
   built on Jul  3 2014 16:24:25 with gcc 4.7.3 (Gentoo 4.7.3-r1 p1.4,
 pie-0.5.5)
   configuration: --enable-libfreetype --enable-gpl --enable-libx264
   libavutil      52. 90.100 / 52. 90.100
   libavcodec     55. 68.100 / 55. 68.100
   libavformat    55. 44.100 / 55. 44.100
   libavdevice    55. 13.101 / 55. 13.101
   libavfilter     4.  9.100 /  4.  9.100
   libswscale      2.  6.100 /  2.  6.100
   libswresample   0. 19.100 /  0. 19.100
   libpostproc    52.  3.100 / 52.  3.100
 detected 4 logical cores  0 aq=    0KB vq=    0KB sq=    0B f=0/0
 [Parsed_color_0 @ 0x7fb5dc002060] Setting 'color' to value 'white'
 [Parsed_color_0 @ 0x7fb5dc002060] size:320x240 rate:25/1
 duration:-1.000000 sar:1/1
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Setting 'fontfile' to value
 './samples/editor/projects/stc/fonts/stc-regular-webfont.ttf'
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Setting 'text' to value 'أحمد'
 [AVFilterGraph @ 0x7fb5dc001580] query_formats: 3 queried, 2 merged, 0
 already done, 0 delayed
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:0 t:0.000000 text_w:30 text_h:18
 x:0 y:0
 [lavfi @ 0x7fb5dc000920] All info found
 Input #0, lavfi, from
 'color=color=white,drawtext=fontfile=./samples/editor/projects/stc/fonts
 /stc-regular-webfont.ttf:text=أحمد':
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0, 1, 1/25: Video: rawvideo (I420 / 0x30323449), yuv420p,
 320x240 [SAR 1:1 DAR 4:3], 1/25, 25 tbr, 25 tbn, 25 tbc
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 Video frame changed from size:0x0 format:none serial:-1 to size:320x240
 format:yuv420p serial:1
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:1 t:0.040000 text_w:30 text_h:18
 x:0 y:0
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 [ffplay_buffer @ 0x7fb5d4001620] Setting 'video_size' to value '320x240'
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:2 t:0.080000 text_w:30 text_h:18
 x:0 y:0
 [ffplay_buffer @ 0x7fb5d4001620] Setting 'pix_fmt' to value '0'
 [ffplay_buffer @ 0x7fb5d4001620] Setting 'time_base' to value '1/25'
 [ffplay_buffer @ 0x7fb5d4001620] Setting 'pixel_aspect' to value '1/1'
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 [ffplay_buffer @ 0x7fb5d4001620] Setting 'frame_rate' to value '25/1'
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:3 t:0.120000 text_w:30 text_h:18
 x:0 y:0
 [ffplay_buffer @ 0x7fb5d4001620] w:320 h:240 pixfmt:yuv420p tb:1/25
 fr:25/1 sar:1/1 sws_param:
 [ffplay_crop @ 0x7fb5d4002840] Setting 'out_w' to value 'floor(in_w/2)*2'
 [ffplay_crop @ 0x7fb5d4002840] Setting 'out_h' to value 'floor(in_h/2)*2'
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:4 t:0.160000 text_w:30 text_h:18
 x:0 y:0
 [AVFilterGraph @ 0x7fb5d4000d40] query_formats: 3 queried, 2 merged, 0
 already done, 0 delayed
 [ffplay_crop @ 0x7fb5d4002840] w:320 h:240 sar:1/1 -> w:320 h:240 sar:1/1
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:5 t:0.200000 text_w:30 text_h:18
 x:0 y:0
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:6 t:0.240000 text_w:30 text_h:18
 x:0 y:0
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:7 t:0.280000 text_w:30 text_h:18
 x:0 y:0
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] n:8 t:0.320000 text_w:30 text_h:18
 x:0 y:0
 [Parsed_drawtext_1 @ 0x7fb5dc002b00] Copying data in avfilter.
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3758>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list