[Working] PANGO Text overlay ported to Leopardbopard

[Working] PANGO Text overlay ported to Leopardbopard

  • Hi,

    I am trying to add Pango font rendering ability to Leopardboard, which can be very useful in adding subtitles and text rendering to the video output. 

    Example on a Linux Machine

    I have explained the whole idea here:  Text or Bitmap Overlay

    Thanks to Todd, I am somehow familiar with the structure of the build process in RRSDK.

    I have added a new folder under $DEVDIR/fs/apps called /pango-1.29.4/ and I have also added Config, Makefile, metainfo files to the folder and I have set the desired settings.

    I have also enabled Cairo, Fontconfig in make config

    When I try to make the package, I get this error:

     

    /opt/codesourcery/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libX11.so when searching for -lX11

    /opt/codesourcery/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/libX11.a when searching for -lX11

    /opt/codesourcery/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lX11

    collect2: ld returned 1 exit status

    make[5]: *** [libpangox-1.0.la] Error 1

    make[4]: *** [all-recursive] Error 1

    make[3]: *** [all] Error 2

    make[2]: *** [all-recursive] Error 1

    make[1]: *** [all] Error 2

    make: *** [autotools_built] Error 2

    It seems it is trying to integrate X11 related stuff to the package which is not available on the target machine.

    Can anyone help me about it?

    Thanks 

    Morteza

     

  • I successfully compiled Pango, and there is no error. 

    I figured out that it is trying to add X11 support and I checked the /src/configure script. There is an undocumented switch which I added to my Makefile (ac_cv_have_x=no)

    Here is my Makefile:

    # Pango Text rendering library by Morteza

    PKG_URL=http://ftp.gnome.org/pub/GNOME/sources/pango/1.29/

    PKG_TARBALL=pango-1.29.4.tar.bz2

    PKG_SHA1SUM=3b4dfe317b328061893cf0728afebe292bbcc05b

    AUTOTOOLS_PARAMS= ac_cv_have_x=no

    LIBRARIES= /usr/lib/pango/libpango-1.0.so

    include ../../../bsp/classes/rrsdk.class

    include $(CLASSES)/autotools.class

     

    When I issue a make command at $DEVDIR/fs/apps/pango-1.29.4/ I get no errors and everything seems to work.

    When I try the make command at $DEVDIR/ I get this error:

    Compiling and installing pango-1.29.4...

    install: cannot stat `/home/moza/LeoSDK/fs/fsdev//usr/lib/pango/libpango-1.0.so': No such file or directory

    Failed to install library /usr/lib/pango/libpango-1.0.so

    make[3]: *** [rrsdk_install] Error 255

    Error building pango-1.29.4

    make[2]: *** [dependency_build] Error 1

    make[1]: *** [apps_build] Error 1

    make: *** [fs_build] Error 2

    Any response is appreciated. 

    Thanks

    Morteza

  • Thanks Everyone!! :)

    I solved it myself.

    I looked into $DEVDIR/fs/fdsev/ for the compiled libraries (libpango-1.0.so) and found out that the path I was using inside the Makefile was incorrect.

    I fixed it and it works like a charm now.

    In the near future I will post a tutorial on the format of Makefile (as the info from RidgeRun does not cover the basics)

     

     

    Here is the steps I took to integrate Pango into my build:

     

    1- Create a new folder under $DEVDIR/fs/apps and rename it to pango-1.29

    2- Create two text files inside $DEVDIR/fs/apps/pango-1.29 and name them Config and Makefile and use the codes below for them.

     

    Makefile: (v0.2 Added Binary files and fixed LA path)

    # Pango Font rendering by Morteza Nov 2011
    # Thanks to RidgeRun
    PKG_URL=http://ftp.gnome.org/pub/GNOME/sources/pango/1.29/
    PKG_TARBALL=pango-1.29.4.tar.bz2
    PKG_SHA1SUM=3b4dfe317b328061893cf0728afebe292bbcc05b

    DESTDIR=$(FSDEVROOT)
    APPS_LDFLAGS+=-Wl,--rpath-link -Wl,$(FSDEVROOT)/usr/lib

    AUTOTOOLS_PARAMS= --prefix=/usr  ac_cv_have_x=no LDFLAGS="$(APPS_LDFLAGS)"

    CORRECT_LA=/usr/lib/{libpango-1.0.la,libpangocairo-1.0.la,libpangoft2-1.0.la,pango/1.6.0/modules/pango-basic-fc.la}
    DIRECTORIES=/usr/lib/

    LIBRARIES= /usr/lib/{libpango-1.0.so,libpangocairo-1.0.so,libpangoft2-1.0.so,pango/1.6.0/modules/pango-basic-fc.so}
    BINARIES= /usr/bin/{pango-querymodules,pango-view}

    include ../../../bsp/classes/rrsdk.class
    include $(CLASSES)/autotools.class

    Config: (v0.2  FontConfig and DejavuFonts are added as dependencies for PANGO)

    config FS_APPS_PANGO
    bool "PANGO Text rendering"
    select FS_APPS_CAIRO
    select FS_APPS_FONTCONFIG
    select FS_APPS_DEJAVU_FONTS


    help

    This option installs Pango font rendering.

    3- Then you must clean the GST-Base plugins to force it to be made again so Pango is integrated into it this time.

    cd $DEVDIR

    `make env`  (Please note that the special characters ` are not single quote ' characters, they are the same key which produces ~ but without the shift key!)

    cd fs/apps/gst-plugins-base-0.10.32

    make clean

    cd $DEVDIR

    make

    make install

    It must compile and integrate without any error.

    If you run gst-inspect on your LeopardBoard now you will see that there are 4 new elements:

     

    1. pango:  textrender: Text renderer
    2. pango:  clockoverlay: Clock overlay
    3. pango:  timeoverlay: Time overlay
    4. pango:  textoverlay: Text overlay

     

    Thanks for all the attention :)

    Morteza

  • Here are some tests with Pango and the pipelines which produce them on Leopardboard

    Text Overlay:

    gst-launch videotestsrc ! textoverlay text="Morteza" font-desc="Verdana bold 80px" ! autovideosink

     

    Time Overlay:

    gst-launch videotestsrc ! clockoverlay shaded-background=1 font-desc="Arial 60px" ! autovideosink

  • Hi Morteza,

    Look at how simple and clean your integration Makefile and your Config files are once you get the details right.  You did a great job.

    Documentation for creating the Makefile and Config files can be found at

    www.ridgerun.com/.../RidgeRun_2011Q2_SDK_Development_and_Integration_Guide

    and by running

    $DEVDIR
    make doc
    firefox $DEVDIR/documentation/html/index.html

    and looking in the autotools class module.

    Please add some pipelines using v4l2src and add dmaiperf so we can see the frame rate.  How does using the overlay element effect the framerate?

    Todd

  • Thanks Todd,

    As you asked, I ran some tests on V4L2SRC and here are the performance outputs from my LeopardBoard 365 @ 297Mhz

     

    Pipeline without overlay:

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736'!  dmaiperf ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false


    Framerate:

    INFO:
    Timestamp: 0:50:23.705259228; bps: 8930232; fps: 19;
    INFO:
    Timestamp: 0:50:24.753365772; bps: 10112977; fps: 21;
    INFO:
    Timestamp: 0:50:25.753539356; bps: 10137600; fps: 22;
    INFO:
    Timestamp: 0:50:26.753582647; bps: 10137600; fps: 22;


    Pipeline with Text Overlay (Font Size=30):

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736' !  textoverlay text="Morteza" font-desc="30px" !dmaiperf ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false

    Framerate:
    INFO:
    Timestamp: 0:01:47.901762017; bps: 8729012; fps: 18;
    INFO:
    Timestamp: 0:01:48.923417727; bps: 9929089; fps: 21;
    INFO:
    Timestamp: 0:01:49.938745519; bps: 9987783; fps: 21;
    INFO:
    Timestamp: 0:01:50.965747102; bps: 9871080; fps: 21;



    Pipeline with Text Overlay (Font Size=60):

    Framerate:
    INFO:
    Timestamp: 0:04:21.007989433; bps: 7314285; fps: 15;
    INFO:
    Timestamp: 0:04:22.014538354; bps: 8244930; fps: 17;
    INFO:
    Timestamp: 0:04:23.022621688; bps: 8228571; fps: 17;
    INFO:
    Timestamp: 0:04:24.029919521; bps: 8236742; fps: 17;



    Pipeline with Text Overlay (Font Size=120):

    Framerate:
    INFO:
    Timestamp: 0:11:34.238144103; bps: 4266666; fps: 9;
    INFO:
    Timestamp: 0:11:35.286273980; bps: 4836641; fps: 10;
    INFO:
    Timestamp: 0:11:36.338549521; bps: 4818250; fps: 10;
    INFO:
    Timestamp: 0:11:37.386952145; bps: 4836641; fps: 10;

     

    As you might have noticed from the last picture, font rendering with Pango is very complicated. It has Shadow and Outline. Unfortunately you can not disable them to improve performance in gst-plugins-base 0.10.xx. The support for changing Shadow and Outline is added in gst-plugins-base 0.11.xx

    I suspect that the shadow which uses alpha blending is the slowest part and should be disabled.

    So I am going to give it a try and update my gstreamer to gstreamer 0.11.1 and also all the plugins (BASE, GOOD, BAD)

    Will there be any problem in the process?

    Morteza


  • For anyone interested in the topic, I must add that there are two steps in a new installation of Pango before you can use it.

    First you have to update the Pango plugins registry by updating your pango.modules file in /usr/etc/pango by:

    > mkdir /usr/etc/pango
    > pango-querymodules > '/usr/etc/pango/pango.modules'

    The next step is updating the list of available fonts in your system by:

    > fc-list

    Please note that "Font Config" and some fonts (e.g. DejaVu Fonts) must be selected from make config > Filesystem Configuration > Select target's file system software.

    If there is any questions, I would be happy to help.

    Morteza

  • Hi Morteza,

    Thanks a lot for the instruction. It's greatly an useful issue, if works!

    I have done the steps carefully but received not a successful response!

    I copied the build output. I have not seen any trace of Pango in output but highlighted warning for Cairo! I am not sure if it's important.

    I activeted the necessary LIBs and created the "config" and "makefile" in the right folder as you said.

    For you information, if I make a mess into "config" file deliberately, "make config" makes an error (fs/apps/pango-1.29/Config:8: unknown option "....") .. it shows the files are considered! but Leopard command line "gst-inspect" does not shows the expected libraries.

    Do I miss some thing else?

    Jack@ubuntu:~/trunk$ cd $DEVDIR

    Jack@ubuntu:~/trunk$ cd fs/apps/gst-plugins-base-0.10.32
    Jack@ubuntu:~/trunk/fs/apps/gst-plugins-base-0.10.32$ make clean
    Jack@ubuntu:~/trunk/fs/apps/gst-plugins-base-0.10.32$ cd $DEVDIR
    Jack@ubuntu:~/trunk$ make
      Ridgerun Linux SDK
      Board configuration: Leopard Board DM365
     
      Processing toolchain...
        Build complete
      Processing kernel...
      Kernel: arch/arm/boot/Image is ready
      Kernel: arch/arm/boot/zImage is ready
        Build complete
      Processing fs...
        Building Apps.defs
        Checking for host packages required by the SDK target applications...
        Host machine has all required packages.
        Entering host-apps...
        Entering apps...
          Checking dependencies for alsa-lib-1.0.24
          Compiling and installing alsa-lib-1.0.24...
          Checking dependencies for alsa-utils-1.0.24.2
            Checking dependencies for ncurses-5.7
            Compiling and installing ncurses-5.7...
          Compiling and installing alsa-utils-1.0.24.2...
          Checking dependencies for cairo-1.10.2
    ls: cannot access DirectFB*: No such file or directory
            Checking dependencies for pixman-0.21.6
            Compiling and installing pixman-0.21.6...
            Checking dependencies for freetype-2.4.4
            Compiling and installing freetype-2.4.4...
            Checking dependencies for fontconfig-2.8.0
              Checking dependencies for expat-2.0.1
              Compiling and installing expat-2.0.1...
            Compiling and installing fontconfig-2.8.0...
          Compiling and installing cairo-1.10.2...
          Checking dependencies for curl-7.21.3
          Compiling and installing curl-7.21.3...
          Checking dependencies for dbus-1.4.6
            Checking dependencies for sysvinit
            Compiling and installing sysvinit...
          Compiling and installing dbus-1.4.6...
          Checking dependencies for dejavu-fonts-ttf-2.32
          Compiling and installing dejavu-fonts-ttf-2.32...
          Checking dependencies for dhcp-4.1.2
          Compiling and installing dhcp-4.1.2...
          Checking dependencies for dropbear-0.53
            Checking dependencies for zlib-1.2.5
            Compiling and installing zlib-1.2.5...
          Compiling and installing dropbear-0.53...
          Checking dependencies for gettext-0.18.1.1
          Compiling and installing gettext-0.18.1.1...
          Checking dependencies for glib-2.26.1
            Checking dependencies for libiconv-1.13.1
            Compiling and installing libiconv-1.13.1...
          Compiling and installing glib-2.26.1...
          Checking dependencies for gst-ffmpeg-0.10.11
            Checking dependencies for gstreamer-0.10.32
              Checking dependencies for libxml2-2.7.8
              Compiling and installing libxml2-2.7.8...
            Compiling and installing gstreamer-0.10.32...
            Checking dependencies for gst-plugins-base-0.10.32
              Checking dependencies for liboil-0.3.17
              Compiling and installing liboil-0.3.17...
            Compiling and installing gst-plugins-base-0.10.32...
            Discovering generated gstreamer plugins...
            Installing generated gstreamer plugins...
          Compiling and installing gst-ffmpeg-0.10.11...
            Installing generated gstreamer plugins...
          Checking dependencies for gst-plugins-bad-0.10.21
          Compiling and installing gst-plugins-bad-0.10.21...
            Installing generated gstreamer plugins...
          Checking dependencies for gst-plugins-good-0.10.25
          Compiling and installing gst-plugins-good-0.10.25...
            Installing generated gstreamer plugins...
          Checking dependencies for gst-plugins-ugly-0.10.17
          Compiling and installing gst-plugins-ugly-0.10.17...
            Installing generated gstreamer plugins...
          Checking dependencies for gst-rtsp-server-0.10.8
          Compiling and installing gst-rtsp-server-0.10.8...
          Checking dependencies for ipiped
            Checking dependencies for readline-6.1
            Compiling and installing readline-6.1...
            Checking dependencies for librraew-demo
            Compiling and installing librraew-demo...
          Compiling and installing ipiped...
          Checking dependencies for jpeg-8c
          Compiling and installing jpeg-8c...
          Checking dependencies for libdaemon-0.14
          Compiling and installing libdaemon-0.14...
          Checking dependencies for libpng-1.5.0
          Compiling and installing libpng-1.5.0...
          Checking dependencies for lzo-2.04
          Compiling and installing lzo-2.04...
          Checking dependencies for mtdutils-1.4.2
            Checking dependencies for util-linux-2.19
            Compiling and installing util-linux-2.19...
          Compiling and installing mtdutils-1.4.2...
          Checking dependencies for psplash
          Compiling and installing psplash...
        Entering /home/Jack/trunk/toolchain...
          Build complete
        Entering arch...
          Checking dependencies for base
          Compiling and installing base...
        Entering mach...
          Checking dependencies for base
          Compiling and installing base...
        Entering proprietary_src...
          Checking dependencies for dvsdk-4_02_00_06
          Compiling and installing dvsdk-4_02_00_06...
          Checking dependencies for gst-dmai-plugins
          Compiling and installing gst-dmai-plugins...
        Entering myapps...
        Installing proprietary code
        Installing Overlay
        Building file system target image(s)
        Generating file system nfsroot...
          Selected NFS root filesystem...
          Please check the directory /home/Jack/trunk/fs/fs is on your nfs-server exports file
        Build complete
      Processing bootloader...
          Building bootloader uncompressed uImage
        Build complete
      Processing installer...
    Jack@ubuntu:~/trunk$

  • Hi Morteza, hi Jack,

    first thank you Morteza for your tutorial to implement pango to leopardboard.

    I followed your tutorial Mortezam but

    I'm sad, I got the same warning like Jack:

    Checking dependencies for cairo-1.10.2

    ls: cannot access DirectFB*: No such file or directory

    And when I do gst-inspect on leopardboard, pango is not listed there.

    Do you have any suggestions? Or Jack, did you solve the problem?

    Stefan

  • OK, got it.

    The DirectFB cairo dependencies were not the problem.

    I think I had forgotten one step the last time.

    Now I created the pango diretory under $DEVDIR/fs/apps and created the makefile and the config file in it.

    in the pango directory i did make and this works, so i did a make clean.

    I switched to the gst-base-flugin folder did a make clean, a make, and a make clean again, everything works.

    I switched to $DEVDIR

    make config -> selected pango an its dependencies

    make

    make install

    did gst-inspect on leopardboard and pango was found.

    last but not least i did threpango-querymodules thing and fc-list and now it works.

    Thanks Morteza

    Stefan

  • Hi Jack and STEFAN81,

    Can you do me a favor and run the same pipelines I have tested above on your boards and report the FPS benchmark.

    I want to test the performance of different boards (Dm365, DM368,...)

    Thanks in advance.

    Morteza

  • Hi Morteza,

    I changed your pipelines a little to match my config.

    your pipeline was

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736'!  dmaiperf ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false

    and mine is

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736'!  dmaiperf print-arm-load=true ! TIDmaiVideoSink videoStd=PRGB sync=false

    Here are the results:

    INFO:                                                                           
    Timestamp: 0:40:40.647770394; bps: 10917275; fps: 23; CPU: 92;                  
    INFO:                                                                           
    Timestamp: 0:40:41.666156273; bps: 12674263; fps: 27; CPU: 91;                  
    INFO:                                                                           
    Timestamp: 0:40:42.686586648; bps: 12649411; fps: 27; CPU: 92;                  
    INFO:                                                                           
    Timestamp: 0:40:43.705927647; bps: 12661825; fps: 27; CPU: 94;                  
    INFO:                                                                           
    Timestamp: 0:40:44.724114606; bps: 12674263; fps: 27; CPU: 91;                  
    INFO:                                                                           
    Timestamp: 0:40:45.743663439; bps: 12661825; fps: 27; CPU: 95;

    And with

    gst-launch -e v4l2src chain-ipipe=true always-copy=false input-src=composite ! "video/x-raw-yuv, format=(fourcc)NV12, width=640, height=480" ! queue ! dmaiaccel  ! dmaiperf print-arm-load=true ! TIDmaiVideoSink sync=false accelFrameCopy=true videoStd=PRGB enable-last-buffer=false

    I got

    INFO:                                                                           
    Timestamp: 0:46:30.917415804; bps: 10757976; fps: 23; CPU: 30;                  
    INFO:                                                                           
    Timestamp: 0:46:31.957420056; bps: 11520000; fps: 25; CPU: 25;                  
    INFO:                                                                           
    Timestamp: 0:46:32.997421347; bps: 11520000; fps: 25; CPU: 24;                  
    INFO:                                                                           
    Timestamp: 0:46:33.997434138; bps: 11520000; fps: 25; CPU: 23;                  
    INFO:                                                                           
    Timestamp: 0:46:34.997440472; bps: 11520000; fps: 25; CPU: 17;                  


    Now with textoverlay.


    font size 30

    With

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736' !  textoverlay text="Morteza" font-desc="30px" !dmaiperf print-arm-load=true ! TIDmaiVideoSink videoStd=PRGB  sync=false

    I got
                      
    INFO:                                                                           
    Timestamp: 0:48:12.049149813; bps: 11451292; fps: 24; CPU: 95;                  
    INFO:                                                                           
    Timestamp: 0:48:13.071260314; bps: 11272015; fps: 24; CPU: 98;                  
    INFO:                                                                           
    Timestamp: 0:48:14.079512355; bps: 11428571; fps: 24; CPU: 93;                  
    INFO:                                                                           
    Timestamp: 0:48:15.091112481; bps: 11394658; fps: 24; CPU: 98;                  
    INFO:                                                                           
    Timestamp: 0:48:16.109002355; bps: 11327433; fps: 24; CPU: 97;                  

    And with

    gst-launch -e v4l2src chain-ipipe=true always-copy=false input-src=composite ! "video/x-raw-yuv, format=(fourcc)NV12, width=640, height=480" ! queue ! dmaiaccel  ! dmaiperf print-arm-load=true ! textoverlay text="Morteza" font-desc="30px" ! TIDmaiVideoSink sync=false accelFrameCopy=true videoStd=PRGB enable-last-buffer=false

    I got
                      
    INFO:                                                                           
    Timestamp: 0:55:23.971609095; bps: 11520000; fps: 25; CPU: 0;                   
    INFO:                                                                           
    Timestamp: 0:55:24.971620720; bps: 11520000; fps: 25; CPU: 0;                   
    INFO:                                                                           
    Timestamp: 0:55:25.971660803; bps: 11520000; fps: 25; CPU: 1;                   
    INFO:                                                                           
    Timestamp: 0:55:27.011672679; bps: 11520000; fps: 25; CPU: 0;                   
    INFO:                                                                           
    Timestamp: 0:55:28.051670307; bps: 11531087; fps: 25; CPU: 0;                   


    font size 60

    With

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736' !  textoverlay text="Morteza" font-desc="60px" !dmaiperf print-arm-load=true ! TIDmaiVideoSink videoStd=PRGB  sync=false

    I got
                  
    INFO:                                                                           
    Timestamp: 0:50:43.996501185; bps: 10077137; fps: 21; CPU: 94;                  
    INFO:                                                                           
    Timestamp: 0:50:45.001069769; bps: 10097211; fps: 21; CPU: 97;                  
    INFO:                                                                           
    Timestamp: 0:50:46.007148852; bps: 10077137; fps: 21; CPU: 95;                  
    INFO:                                                                           
    Timestamp: 0:50:47.012046728; bps: 10097211; fps: 21; CPU: 94;                  
    INFO:                                                                           
    Timestamp: 0:50:48.018332561; bps: 10077137; fps: 21; CPU: 97;        


    And with


    gst-launch -e v4l2src chain-ipipe=true always-copy=false input-src=composite ! "video/x-raw-yuv, format=(fourcc)NV12, width=640, height=480" ! queue ! dmaiaccel  ! dmaiperf print-arm-load=true ! textoverlay text="Morteza" font-desc="60px" ! TIDmaiVideoSink sync=false accelFrameCopy=true videoStd=PRGB enable-last-buffer=false

    I got
                      
    INFO:                                                                           
    Timestamp: 0:56:32.813606434; bps: 11520000; fps: 25; CPU: 26;                  
    INFO:                                                                           
    Timestamp: 0:56:33.853606223; bps: 11531087; fps: 25; CPU: 26;                  
    INFO:                                                                           
    Timestamp: 0:56:34.893623598; bps: 11520000; fps: 25; CPU: 26;                  
    INFO:                                                                           
    Timestamp: 0:56:35.893627432; bps: 11520000; fps: 25; CPU: 26;                  
    INFO:                                                                           
    Timestamp: 0:56:36.893673098; bps: 11520000; fps: 25; CPU: 26;                  


    font size 120

    With

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736' !  textoverlay text="Morteza" font-desc="120px" !dmaiperf print-arm-load=true ! TIDmaiVideoSink videoStd=PRGB  sync=false

    I got

    INFO:                                                                           
    Timestamp: 0:51:16.363104434; bps: 5821574; fps: 12; CPU: 93;                   
    INFO:                                                                           
    Timestamp: 0:51:17.387710435; bps: 6750000; fps: 14; CPU: 98;                   
    INFO:                                                                           
    Timestamp: 0:51:18.414595894; bps: 6736842; fps: 14; CPU: 98;                   
    INFO:                                                                           
    Timestamp: 0:51:19.439822436; bps: 6743414; fps: 14; CPU: 95;                   
    INFO:                                                                           
    Timestamp: 0:51:20.466027519; bps: 6736842; fps: 14; CPU: 96;                   

    And with

    gst-launch -e v4l2src chain-ipipe=true always-copy=false input-src=composite ! "video/x-raw-yuv, format=(fourcc)NV12, width=640, height=480" ! queue ! dmaiaccel  ! dmaiperf print-arm-load=true ! textoverlay text="Morteza" font-desc="120px" ! TIDmaiVideoSink sync=false accelFrameCopy=true videoStd=PRGB enable-last-buffer=false

    INFO:                                                                           
    Timestamp: 0:57:21.059504228; bps: 10200577; fps: 22; CPU: 90;                  
    INFO:                                                                           
    Timestamp: 0:57:22.099500771; bps: 10200577; fps: 22; CPU: 92;                  
    INFO:                                                                           
    Timestamp: 0:57:23.139511771; bps: 10190769; fps: 22; CPU: 90;                  
    INFO:                                                                           
    Timestamp: 0:57:24.179445937; bps: 10200577; fps: 22; CPU: 90;                  
    INFO:                                                                           
    Timestamp: 0:57:25.219966022; bps: 10190769; fps: 22; CPU: 90;                  



    It seems, the textoverlay plugin from GStreamer needs high CPU. Perhaps it will be better to use the hardware OSD from DM368 Chip to use overlay?!

    Stefan

  • Thanks a lot Stefan.

    You did a great job!

    The performance data you posted is very helpful.

    But I think you forgot to mention the Board and the CPU clock you were running the board on.

    It seems that the TextOverlay plugin is a CPU hungry plugin. I am tweaking GStreamer a little bit to remove Alphablending under the text, which I suspect is makes it slower.

    When it is ready I will post the patch here too.

    Thanks a lot Stefan.

    Morteza

  • you're welcome.

    you're right.. i use leopardboard dm368 with ridgerun evalSDK for leopardboard DM365.

    i did not change the pll settings, so it's running on 297MHz ARM frequency and 243MHz DDR frequency.

    you are right that the textoverlay plugin is a cpu hungry plugin. I'm looking forward to see your results without the alpha blending under the text. This would be very interesting.

    Stefan

  • Hi,

    performing instruction to maximize the clock rate for DM368 (http://designsomething.org/leopardboard/f/33/p/615/2309.aspx#2309), this is the result of PLLs' and clocks' check:

    cat /proc/davinci_clocks

    ref_clk users=16 24000000 Hz
    pll1 users=14 pll 702000000 Hz
    pll1_aux_clk users= 5 pll 24000000 Hz
    uart0 users= 1 psc 24000000 Hz
    i2c users= 1 psc 24000000 Hz
    spi4 users= 0 psc 24000000 Hz
    pwm0 users= 0 psc 24000000 Hz
    pwm1 users= 0 psc 24000000 Hz
    pwm2 users= 0 psc 24000000 Hz
    timer0 users= 1 psc 24000000 Hz
    timer1 users= 0 psc 24000000 Hz
    timer2 users= 2 psc 24000000 Hz
    timer3 users= 0 psc 24000000 Hz
    usb users= 1 psc 24000000 Hz
    pll1_sysclkbp users= 0 pll 24000000 Hz
    clkout0 users= 0 pll 24000000 Hz
    pll1_sysclk1 users= 0 pll 702000000 Hz
    pll1_sysclk2 users= 0 pll 351000000 Hz
    pll1_sysclk3 users= 2 pll 351000000 Hz
    vpss_dac users= 1 psc 351000000 Hz
    mjcp users= 1 psc 351000000 Hz
    pll1_sysclk4 users= 5 pll 175500000 Hz
    uart1 users= 1 psc 175500000 Hz
    mmcsd1 users= 0 psc 175500000 Hz
    spi0 users= 0 psc 175500000 Hz
    spi1 users= 0 psc 175500000 Hz
    spi2 users= 0 psc 175500000 Hz
    spi3 users= 0 psc 175500000 Hz
    gpio users= 1 psc 175500000 Hz
    aemif users= 1 psc 175500000 Hz
    emac users= 1 psc 175500000 Hz
    asp0 users= 1 psc 175500000 Hz
    rto users= 0 psc 175500000 Hz
    pll1_sysclk5 users= 1 pll 351000000 Hz
    vpss_master users= 1 psc 351000000 Hz
    pll1_sysclk6 users= 0 pll 27000000 Hz
    pll1_sysclk7 users= 0 pll 702000000 Hz
    pll1_sysclk8 users= 1 pll 100285714 Hz
    mmcsd0 users= 1 psc 100285714 Hz
    pll1_sysclk9 users= 0 pll 351000000 Hz
    pll2 users= 2 pll 445440000 Hz
    pll2_aux_clk users= 0 pll 24000000 Hz
    clkout1 users= 1 pll 24000000 Hz
    pll2_sysclk1 users= 0 pll 445440000 Hz
    pll2_sysclk2 users= 1 pll 445440000 Hz
    arm_clk users= 1 psc 445440000 Hz
    pll2_sysclk3 users= 0 pll 445440000 Hz
    pll2_sysclk4 users= 0 pll 20247272 Hz
    voice_codec users= 0 psc 20247272 Hz
    pll2_sysclk5 users= 0 pll 74240000 Hz
    pll2_sysclk6 users= 0 pll 445440000 Hz
    pll2_sysclk7 users= 0 pll 445440000 Hz
    pll2_sysclk8 users= 0 pll 445440000 Hz
    pll2_sysclk9 users= 0 pll 445440000 Hz
    pwm3 users= 0 psc 24000000 Hz

    and the results you're interested:


    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736' ! textoverlay text="Morteza" font-desc="30px" !dmaiperf ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false

    INFO:
    Timestamp: 0:03:48.592790271; bps: 11986127; fps: 26;
    INFO:
    Timestamp: 0:03:49.597878855; bps: 12838208; fps: 27;
    INFO:
    Timestamp: 0:03:50.603508397; bps: 12838208; fps: 27;
    INFO:
    Timestamp: 0:03:51.608930271; bps: 12838208; fps: 27;
    INFO:
    Timestamp: 0:03:52.609988230; bps: 12889510; fps: 27;

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736' ! textoverlay text="Morteza" font-desc="60px" !dmaiperf ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false

    INFO:
    Timestamp: 0:00:26.256643728; bps: 10380411; fps: 22;
    INFO:
    Timestamp: 0:00:27.261153395; bps: 11474103; fps: 24;
    INFO:
    Timestamp: 0:00:28.262093311; bps: 11520000; fps: 25;
    INFO:
    Timestamp: 0:00:29.266993103; bps: 11474103; fps: 24;
    INFO:
    Timestamp: 0:00:30.268987519; bps: 11508491; fps: 24;
    INFO:
    Timestamp: 0:00:31.272401145; bps: 11485543; fps: 24;

    gst-launch -e v4l2src always-copy=FALSE input-src=composite ! 'video/x-raw-yuv,format=(fourcc)NV12,width=640,height=480,pitch=736' ! textoverlay text="Morteza" font-desc="120px" !dmaiperf ! TIDmaiVideoSink videoStd=D1_NTSC videoOutput=composite sync=false

    INFO:

    Timestamp: 0:01:26.726428938; bps: 7035114; fps: 15;
    INFO:
    Timestamp: 0:01:27.776225520; bps: 7028408; fps: 15;
    INFO:
    Timestamp: 0:01:28.824764269; bps: 7035114; fps: 15;
    INFO:
    Timestamp: 0:01:29.873744726; bps: 7035114; fps: 15;
    INFO:
    Timestamp: 0:01:30.923200185; bps: 7028408; fps: 15;
    INFO:
    Timestamp: 0:01:31.972349976; bps: 7028408; fps: 15;

    The modified version suggested by Stephan:

    gst-launch -e v4l2src chain-ipipe=true always-copy=false input-src=composite ! "video/x-raw-yuv, format=(fourcc)NV12, width=640, height=480" ! queue ! dmaiaccel ! dmaiperf print-arm-load=true ! textoverlay text="Morteza" font-desc="30px" ! TIDmaiVideoSink sync=false accelFrameCopy=true videoStd=D1_NTSC enable-last-buffer=false

    INFO:
    Timestamp: 0:18:43.888600509; bps: 13810189; fps: 29; CPU: 16;
    INFO:
    Timestamp: 0:18:44.889645217; bps: 13810189; fps: 29; CPU: 11;
    INFO:
    Timestamp: 0:18:45.890818386; bps: 13810189; fps: 29; CPU: 18;
    INFO:
    Timestamp: 0:18:46.891778012; bps: 13824000; fps: 30; CPU: 16;
    INFO:
    Timestamp: 0:18:47.892830471; bps: 13810189; fps: 29; CPU: 12;
    INFO:
    Timestamp: 0:18:48.893830012; bps: 13824000; fps: 30; CPU: 18;
    INFO:
    Timestamp: 0:18:49.894331176; bps: 13824000; fps: 30; CPU: 22;


    gst-launch -e v4l2src chain-ipipe=true always-copy=false input-src=composite ! "video/x-raw-yuv, format=(fourcc)NV12, width=640, height=480" ! queue ! dmaiaccel ! dmaiperf print-arm-load=true ! textoverlay text="Morteza" font-desc="60px" ! TIDmaiVideoSink sync=false accelFrameCopy=true videoStd=D1_NTSC enable-last-buffer=false

    INFO:
    Timestamp: 0:19:31.505961894; bps: 13810189; fps: 29; CPU: 36;
    INFO:
    Timestamp: 0:19:32.507057184; bps: 13810189; fps: 29; CPU: 43;
    INFO:
    Timestamp: 0:19:33.508175850; bps: 13810189; fps: 29; CPU: 45;
    INFO:
    Timestamp: 0:19:34.509272561; bps: 13810189; fps: 29; CPU: 39;
    INFO:
    Timestamp: 0:19:35.510497479; bps: 13810189; fps: 29; CPU: 40;
    INFO:
    Timestamp: 0:19:36.511510228; bps: 13810189; fps: 29; CPU: 41;
    INFO:
    Timestamp: 0:19:37.512598104; bps: 13810189; fps: 29; CPU: 41;

    gst-launch -e v4l2src chain-ipipe=true always-copy=false input-src=composite ! "video/x-raw-yuv, format=(fourcc)NV12, width=640, height=480" ! queue ! dmaiaccel ! dmaiperf print-arm-load=true ! textoverlay text="Morteza" font-desc="120px" ! TIDmaiVideoSink sync=false accelFrameCopy=true videoStd=D1_NTSC enable-last-buffer=false

    INFO:
    Timestamp: 0:17:35.321862435; bps: 9861478; fps: 21; CPU: 96;
    INFO:
    Timestamp: 0:17:36.349366142; bps: 9871080; fps: 21; CPU: 95;
    INFO:
    Timestamp: 0:17:37.378341517; bps: 9861478; fps: 21; CPU: 98;
    INFO:
    Timestamp: 0:17:38.413024142; bps: 9804255; fps: 21; CPU: 97;
    INFO:
    Timestamp: 0:17:39.447663685; bps: 9804255; fps: 21; CPU: 94;

    If not enough let me know!

    Thanks Morteza and Stephan...