Monday, November 16, 2015

Fully Optimised Raspbian Jessie with Accelerated Qt Multimedia Backend (Pi2)

This is an image of Raspbian Jessie ready to test (and use) the Qt Multimedia Backend POT. This image is optimised for maximum performance (see the demos below). This is the current setup:

pi@raspberrypi ~ $ sudo /opt/vc/bin/vcgencmd version
Nov 11 2015 21:31:07 
Copyright (c) 2012 Broadcom
version 54011a8ad59a9ae1c40bd07cddd9bcf90e779b66 (clean) (release)
pi@raspberrypi ~ $ uname -a
Linux raspberrypi 4.1.13-v7+ #826 SMP PREEMPT Fri Nov 13 20:19:03 GMT 2015 armv7l GNU/Linux
pi@raspberrypi ~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:        8.0
Codename:       jessie

Download image here.

The image includes:
  • Qt 5.5.1 built for armv7 with neon optimisations, including support for touch screens, gstreamer, libinput, X11 (no multimedia), tslib, and Bluetooth/Bluetooth BLE using bluez (complete configuration below). Modules provided include QtWebKit (no multimedia support).
  • Dependant libs: evdev, icu (not the one provided by raspbian), mtdev, libts.
  • POCPlayer and QML samples to show the performance of the backend and test bugs.
  • POT library including ffmpeg 2.7.2.
Everything is built for armv7 including neon optimisations. To quickly test the performance there are a few things you can launch:

/home/pi/piomxtextures_pocplayer --multipleanimtest /home/pi/sintel_trailer_720p.mp4 /home/pi/big_buck_bunny_720p_h264.mov

This is the result you should expect with a proper overclocking:


It will show you a continuous animation while running two 720p videos concurrently. To improve the frame rate of the animations you can also overclock your Pi2 (see below).
Other samples to test the features of the plugin are stored in /home/pi/samples:

/usr/local/Qt-rasp2-5.5.1/bin/qmlscene /home/pi/samples/video_simple.qml file:///home/pi/big_buck_bunny_1080p_h264.mov

Another interesting test is running qmlvideofx example included in the Qt sources. This will show you the perfomance of the effects applied on the video using shaders. You can find an executable in /usr/local/Qt-rasp2-5.5.1/examples/multimedia/video/qmlvideofx/qmlvideofx. This shows approximately what you should expect (the video shows the result on Pi1, Pi2 is just a little better):

Overclocking

The Pi can be overclocked by tuning parameters in /boot/config.txt. I provided a configuration that I find useful:

#force_turbo=1  # Voids Warranty!
#boot_delay=1   # Helps to avoid sdcard corruption when force_turbo is enabled.
#arm_freq=1100
#sdram_freq=450
#core_freq=550
#over_voltage=4
#temp_limit=80  # Will throttle to default clock speed if hit.

In the image this is all disabled. If you intent to enable please keep in mind I don't take responsibility for any consequence. Please refer to the documentation for this procedure.

Have fun! Bye ;-)

Qt Configuration

   Configure summary

Building on:   linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for:  devices/linux-rasp-pi2-g++ (arm, CPU features: neon)
Platform notes:

            - Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx
        
qmake vars .......... styles += mac fusion windows QT_CFLAGS_GLIB = -pthread -I/opt/rpi/sysroot/usr/include/glib-2.0 -I/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/glib-2.0/include  QT_LIBS_GLIB = -L/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf -lgthread-2.0 -pthread -lglib-2.0  QT_CFLAGS_PULSEAUDIO = -D_REENTRANT -I/opt/rpi/sysroot/usr/include/glib-2.0 -I/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/glib-2.0/include  QT_LIBS_PULSEAUDIO = -L/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf -lpulse-mainloop-glib -lpulse -lglib-2.0  QMAKE_CFLAGS_FONTCONFIG = -I/opt/rpi/sysroot/usr/include/freetype2  QMAKE_LIBS_FONTCONFIG = -L/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf -lfontconfig -lfreetype  QMAKE_INCDIR_LIBUDEV =  QMAKE_LIBS_LIBUDEV = -L/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf -ludev  QMAKE_LIBINPUT_VERSION_MAJOR = 1 QMAKE_LIBINPUT_VERSION_MINOR = 0 QMAKE_INCDIR_LIBINPUT = /opt/rpi/sysroot/home/pi/qtdeps/include  QMAKE_LIBS_LIBINPUT = -L/opt/rpi/sysroot/home/pi/qtdeps/lib -linput  QMAKE_LIBXI_VERSION_MAJOR = 1 QMAKE_LIBXI_VERSION_MINOR = 7 QMAKE_LIBXI_VERSION_PATCH = 4 QMAKE_X11_PREFIX = /usr QMAKE_XKB_CONFIG_ROOT = /usr/share/X11/xkb QMAKE_CFLAGS_XCB =  QMAKE_LIBS_XCB = -L/opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf -lxcb-sync -lxcb-xfixes -lxcb-render -lxcb-randr -lxcb-image -lxcb-shm -lxcb-keysyms -lxcb-icccm -lxcb-shape -lxcb  INCLUDEPATH +=  "/opt/rpi/sysroot/home/pi/qtdeps/include" LIBS +=  -L"/opt/rpi/sysroot/home/pi/qtdeps/lib" sql-drivers =  sql-plugins =  sqlite qmake switches ......... 

Build options:
  Configuration .......... accessibility accessibility-atspi-bridge alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile cups dbus egl eglfs eglfs_brcm enable_new_dtags evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib gstreamer-1.0 harfbuzz iconv icu inotify ipv6ifname large-config largefile libinput libproxy libudev linuxfb medium-config minimal-config mremap mtdev neon nis opengl opengles2 openssl pcre png posix_fallocate pulseaudio qpa qpa reduce_exports release rpath shared small-config system-freetype system-jpeg system-png system-zlib tslib use_gold_linker xcb xcb-glx xcb-plugin xcb-render xcb-xlib xinput2 xkbcommon-qt xlib xrender 
  Build parts ............  libs examples
  Mode ................... release
  Using sanitizer(s)...... none
  Using C++11 ............ yes
  Using gold linker....... yes
  Using new DTAGS ........ yes
  Using PCH .............. no
  Target compiler supports:
    Neon ................. yes

Qt modules and options:
  Qt D-Bus ............... yes (loading dbus-1 at runtime)
  Qt Concurrent .......... yes
  Qt GUI ................. yes
  Qt Widgets ............. yes
  Large File ............. yes
  QML debugging .......... yes
  Use system proxies ..... no

Support enabled for:
  Accessibility .......... yes
  ALSA ................... yes
  CUPS ................... yes
  Evdev .................. yes
  FontConfig ............. yes
  FreeType ............... yes (system library)
  Glib ................... yes
  GStreamer .............. yes (1.0)
  GTK theme .............. no
  HarfBuzz ............... yes (bundled copy)
  Iconv .................. yes
  ICU .................... yes
  Image formats: 
    GIF .................. yes (plugin, using bundled copy)
    JPEG ................. yes (plugin, using system library)
    PNG .................. yes (in QtGui, using system library)
  journald ............... no
  libinput................ yes
  mtdev .................. yes (system library)
  Networking: 
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    libproxy.............. yes
    OpenSSL .............. yes (loading libraries at run-time)
  NIS .................... yes
  OpenGL / OpenVG: 
    EGL .................. yes
    OpenGL ............... yes (OpenGL ES 2.0+)
    OpenVG ............... no
  PCRE ................... yes (bundled copy)
  pkg-config ............. yes 
  PulseAudio ............. yes
  QPA backends: 
    DirectFB ............. no
    EGLFS ................ yes
      EGLFS i.MX6....... . no
      EGLFS KMS .......... no
      EGLFS Mali ......... no
      EGLFS Raspberry Pi . yes
      EGLFS X11 .......... no
    LinuxFB .............. yes
    XCB .................. yes (system library)
      EGL on X ........... no
      GLX ................ yes
      MIT-SHM ............ yes
      Xcb-Xlib ........... yes
      Xcursor ............ yes (loaded at runtime)
      Xfixes ............. yes (loaded at runtime)
      Xi ................. no
      Xi2 ................ yes
      Xinerama ........... yes (loaded at runtime)
      Xrandr ............. yes (loaded at runtime)
      Xrender ............ yes
      XKB ................ yes
      XShape ............. yes
      XSync .............. yes
      XVideo ............. yes
  Session management ..... yes
  SQL drivers: 
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... yes (plugin, using bundled copy)
    TDS .................. no
  tslib .................. yes
  udev ................... yes
  xkbcommon-x11........... yes (bundled copy, XKB config root: /usr/share/X11/xkb)
  xkbcommon-evdev......... no
  zlib ................... yes (system library)

121 comments:

  1. Hi, I am trying to play audio through the 3.5mm jack to no avail. Have you tried playing audio that way, did work for you? If so, is there anything in particular that I need to do in order to achieve this?

    ReplyDelete
    Replies
    1. Yes, refer to this article: http://goo.gl/TuiSyS.

      Delete
  2. Hi Luca
    I'm not able to download the image file.
    Is the file always online?

    ReplyDelete
    Replies
    1. Seems ok, I can download very slowly.

      Delete
    2. I had the same problem using Virgin Media here in the UK, the download speed was measured in bytes and was showing several days to complete. However I solved it by installing https://www.internetdownloadmanager.com it then used multiple threads and flew down in no time at all.

      Delete
    3. ok
      i'll try with the download manager and i keep you in touch

      thanks guys

      Delete
    4. Download works nice
      I'll try this
      Thanks

      Delete
  3. Luca, great work once again! I downloaded your image and it works great. If anyone is interested I removed quite a lot of preinstalled raspbian bloat by doing the following...

    sudo apt-get remove --purge wolfram-engine scratch nuscratch sonic-pi idle3 smartsim penguinspuzzle java-common minecraft-pi python-minecraftpi python3-minecraftpi libx11-6 libgtk-3-common xkb-data lxde-icon-theme raspberrypi-artwork

    sudo apt-get remove --auto-remove --purge libx11-.* x11-common

    dpkg -l | grep ^rc | cut -d' ' -f3|xargs sudo dpkg -P

    After letting the above run through, I found qmlscene wouldn't load this was easily fixed by installing libproxy...

    sudo apt-get install libproxy-dev

    Once qmlscene was fixed I then discovered that the videos would no longer play, again easily fixed by reinstalling gstreamer...

    sudo apt-get install gstreamer0.10-alsa gstreamer0.10-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-plugins-good

    ReplyDelete
    Replies
    1. Thanks for sharing that! However why did you need gstreamer?

      Delete
    2. Erm... not sure to be honest, I thought it was required in so much as soon as it was removed the videos would not play in my QML app as soon as I reinstalled the videos started playing again.

      Is it just gstreamer1.0-plugins-bad gstreamer1.0-plugins-good that are required?

      Delete
    3. I have mentioned previously that I am looking to build a bare / leaner image but I am still struggling with what the minimum core dependencies are to make it work with QT and your plugin.

      Delete
    4. I'm sorry but I don't know what happened there. POT does not use gstreamer itself.

      Delete
    5. Will remove it again and see what the debug output shows.

      Delete
    6. Failed to allocate 513942050 bytes for decompression.
      I can not extract. Do you have to use lrz or sdklsajdlkasjdlas?

      Delete
    7. Seems to work for me. Maybe try on another system.

      Delete
    8. Dave, thank you for tip about free memory by removing packages. It free from 6.2 Gb to 3.9 Gb disk space.
      Plese note, when deleting packages removed many base packages, not only libproxy-dev.
      And installing gstreamer fix problem because install some packages that needs to work eglfs.
      http://pastebin.com/NfWWkLPk

      Delete
  4. Hello Luca!
    Good work and awesome video demontrations about raspberry Qt perfomance!
    I downloaded binary but it in lrz archive and my PC extracting this archive so long... now it proceed 7 hours and progress on 50 percent. My previous try last night ends with error. So, actually I can't use this archive.

    ReplyDelete
    Replies
    1. Just tried to see if it was corrupted but it seems it is not. What version of lrunzip are you using? What OS?

      Delete
    2. I use ubuntu 14.04 on virtualBox 5 AMD phenom X2 550.
      So, I unpacked and run examples. I leaved running example for several hours (more than 10 hours)
      /home/pi/piomxtextures_pocplayer --multipleanimtest /home/pi/sintel_trailer_720p.mp4 /home/pi/big_buck_bunny_720p_h264.mov

      When i check video on screen shows one frame of one video with animate as should. Video with big_buck_bunny_1080p_h264.mov not palyed. only black screen appeared.

      Should this demo example to work infinite time or it has limit for playing count?

      Thank you for reply :-)

      Delete
    3. Sorry, not sure I understand what you are saying, but no, it should go on indefinitely.

      Delete
  5. Hi Luca
    Thank you for your awesome work
    I have a problem. how can i use your library to compile my own sample project? (e.g. videowidget)
    i have your jessie image for Pi2 and i prepare my host ubuntu14.04 with copiler and sysroot placed on /opt/rpi/ directory.

    ReplyDelete
    Replies
    1. Cross-compiler in /opt/rpi and sysroot in /opt/rpi/sysroot. The rest should be like building for any other system.

      Delete
    2. Hello!
      Could you explain how to cross compile example app with this binaries.
      I have tried to google instruction but unsuccessfull.
      I newbie in crosscompiling issues.

      Delete
  6. Is this also for Pi or only Pi2?

    ReplyDelete
  7. by cross-compiler do you meen all Qt-rasp-5.5.0 folder content?

    ReplyDelete
    Replies
    1. What do you mean by cross-compiler on this answer: "Cross-compiler in /opt/rpi"

      Delete
    2. That you should place linaro raspberry crosscompiler there.

      Delete
  8. It is working now :) Thank you.

    What I have done:
    - Copy gcc-linaro-arm-linux-gnueabihf-raspbian to /opt/rpi
    - Copy Qt-rasp-5.5.0 to /opt/rpi/sysroot/usr/local
    - Copy /lib /opt /usr from RPi to my host at /opt/rpi/sysroot

    I can now cross compile and deploy to rpi however I tried to create a sample based on your video_simple.qml and I got the following error:
    13:37:07.445 ERROR: Failed to get shared OGL context. Please enable it with the proper attr.


    Full log: http://pastebin.com/kGLU2syz

    ReplyDelete
    Replies
    1. Yes, enable shared context: https://github.com/carlonluca/pi/blob/master/piomxtextures_pocplayer/main.cpp.

      Delete
    2. I tried to compile piomxtextures_pocplayer example but the project doesn't find #include "lc_logging.h" can you help me on how to install LightLogger?

      Delete
    3. Use the prepare_3rdparty script. It will also build ffmpeg.

      Delete
    4. Do I need to download qt source?

      Delete
    5. It ask me for qt source root :s

      Delete
    6. Look what it does inside. It won't do much with it. Howevwr you can simply download LightLogger the same way and place in the same position without actually running it.

      Delete
    7. I download the file and copy it to 3rdparty and now I'm able to compile however when I run it on RPi it only show a black screen. http://pastebin.com/5aDzyT6j

      Thank you for your help

      Delete
    8. I don't know why but I tought it start playing the video automatically. Thank you

      I return the my test app and set this attribute to true QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true); make the app run however it doesn't show nothing on the screen it keep showing the console. http://pastebin.com/f0um9w86

      Looking at your example it looks like I may need to create a qquickview and do some more things. Can you elaborate here a little more on what is needed?

      Delete
    9. That is a regular Qt application using QML.

      Delete
  9. Thank you, been able to add video to my qml aplication :)

    I was trying to understand you application but can't understand that part:

    POC_QMLUtils qmlUtils;
    POC_Uptime uptime;

    QQuickView view;

    // Set EGL to 24bit color depth.
    QSurfaceFormat curSurface = view.format();
    curSurface.setRedBufferSize(8);
    curSurface.setGreenBufferSize(8);
    curSurface.setBlueBufferSize(8);
    curSurface.setAlphaBufferSize(0);
    view.setFormat(curSurface);

    view.engine()->rootContext()->setContextProperty("utils", &qmlUtils);
    view.engine()->rootContext()->setContextProperty("uptime", &uptime);

    ReplyDelete
    Replies
    1. That is setting the pixel format for the surface. Not mandatory.

      Delete
  10. Hi Luca,
    great image ! thanks alot. saves a lot of effort.
    Can you provide short info on how to compile QT app in this image (not cross-compile, just compile on RPI2 with this image) ?

    ReplyDelete
    Replies
    1. I'm sorry, I never bothered to try building on the device.

      Delete
  11. Hi Luca,
    I run one of QT multimedia samples (/usr/local/Qt-rasp2-5.5.1/examples/multimediawidgets/videographicsitem/videographicsitem), opened one of videos in /home/pi (e.g. /home/pi/big_buck_bunny_720p_h264.mov). Click on Play results in Segmentation fault.

    Any ideas why ?


    Full console output

    pi@raspberrypi ~/ /usr/local/Qt-rasp2-5.5.1/examples/multimediawidgets/videographicsitem/videographicsitem
    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
    03:40:43.103 INFORMATION: POT build Nov 10 2015 21:01:04.
    Requesting control for org.qt-project.qt.metadatareadercontrol/5.0...
    Requesting control for org.qt-project.qt.mediaavailabilitycontrol/5.0...
    Requesting control for org.qt-project.qt.mediaplayercontrol/5.0...
    Requesting control for org.qt-project.qt.medianetworkaccesscontrol/5.0...
    03:40:43.107 INFORMATION: Initializing GPU context in media processor...
    03:40:43.108 INFORMATION: Initializing buffer provider...
    03:40:43.108 ERROR: Failed to get shared OGL context. Please enable it with the proper attr.
    Requesting control for org.qt-project.qt.videorenderercontrol/5.0...
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/pi/big_buck_bunny_720p_h264.mov':
    Metadata:
    major_brand : qt
    minor_version : 537199360
    compatible_brands: qt
    creation_time : 2008-05-27 18:36:22
    timecode : 00:00:00:00
    Duration: 00:09:56.46, start: 0.000000, bitrate: 5589 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 5146 kb/s, 24 fps, 24 tbr, 2400 tbn, 480
    0 tbc (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    encoder : H.264
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    timecode : 00:00:00:00
    Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 437 kb/s (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    03:41:23.370 INFORMATION: Instantiating texture data...
    03:41:23.371 INFORMATION: Creating EGLImageKHR...
    eglCreateImageKHR: failed to create image for buffer 0x74b57d5 target 12465 error 0x3008
    03:41:23.372 ERROR: Failed to create KHR image: 12296.
    03:41:23.373 INFORMATION: Instantiating texture data...
    03:41:23.373 INFORMATION: Creating EGLImageKHR...
    eglCreateImageKHR: failed to create image for buffer 0x74b57d5 target 12465 error 0x3008
    03:41:23.374 ERROR: Failed to create KHR image: 12296.
    03:41:23.374 INFORMATION: Instantiating texture data...
    03:41:23.375 INFORMATION: Creating EGLImageKHR...
    eglCreateImageKHR: failed to create image for buffer 0x74b57d5 target 12465 error 0x3008
    03:41:23.375 ERROR: Failed to create KHR image: 12296.
    03:41:23.376 INFORMATION: Instantiating texture data...
    03:41:23.376 INFORMATION: Creating EGLImageKHR...
    eglCreateImageKHR: failed to create image for buffer 0x74b57d5 target 12465 error 0x3008
    03:41:23.377 ERROR: Failed to create KHR image: 12296.
    03:41:23.378 WARNING: Couldn't get a valid texture.
    Video codec omx-h264 width 1280 height 720 profile 77 fps 24.000000
    Audio codec aac channels 6 samplerate 48000 bitspersample 16
    V:PortSettingsChanged: 1280x720@24.00 interlace:0 deinterlace:0 anaglyph:0 par:inf layer:0 alpha:255
    Segmentation fault

    ReplyDelete
    Replies
    1. 03:40:43.108 ERROR: Failed to get shared OGL context. Please enable it with the proper attr.

      Read in the blog you'll find the reason.

      Delete
  12. My apologies for not reading.
    I was assuming that off-the-shelf QT sample should work without alterations ...

    ReplyDelete
    Replies
    1. Information is unfortunately very fragmented. Unfortunately they should most work but some slight changes may be needed yet.

      Delete
  13. ok. We did add

    QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);

    thing is better but another error ...

    WARNING: Failed to start surface.

    We did try to search for this error on Internet, but no resolution ...
    Any ideas ?

    Full stack is

    pi@raspberrypi ~/tests/videographicsitem $ ./videographicsitem
    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
    06:49:47.350 INFORMATION: POT build Nov 10 2015 21:01:04.
    Requesting control for org.qt-project.qt.metadatareadercontrol/5.0...
    Requesting control for org.qt-project.qt.mediaavailabilitycontrol/5.0...
    06:49:47.353 INFORMATION: Initializing GPU context in media processor...
    Requesting control for org.qt-project.qt.mediaplayercontrol/5.0...
    Requesting control for org.qt-project.qt.medianetworkaccesscontrol/5.0...
    06:49:47.353 INFORMATION: Initializing buffer provider...
    Requesting control for org.qt-project.qt.videorenderercontrol/5.0...
    VideoPlayer::openFile: fileName: "/home/pi/big_buck_bunny_720p_h264.mov"
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/pi/big_buck_bunny_720p_h264.mov':
    Metadata:
    major_brand : qt
    minor_version : 537199360
    compatible_brands: qt
    creation_time : 2008-05-27 18:36:22
    timecode : 00:00:00:00
    Duration: 00:09:56.46, start: 0.000000, bitrate: 5589 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 5146 kb/s, 24 fps, 24 tbr, 2400 tbn, 480
    0 tbc (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    encoder : H.264
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    timecode : 00:00:00:00
    Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 437 kb/s (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    06:50:03.983 INFORMATION: Instantiating texture data...
    06:50:04.001 INFORMATION: Creating EGLImageKHR...
    06:50:04.001 INFORMATION: Instantiating texture data...
    06:50:04.019 INFORMATION: Creating EGLImageKHR...
    06:50:04.020 INFORMATION: Instantiating texture data...
    06:50:04.037 INFORMATION: Creating EGLImageKHR...
    06:50:04.038 INFORMATION: Instantiating texture data...
    06:50:04.056 INFORMATION: Creating EGLImageKHR...
    Video codec omx-h264 width 1280 height 720 profile 77 fps 24.000000
    Audio codec aac channels 6 samplerate 48000 bitspersample 16
    VideoPlayer::mediaStateChanged: state: QMediaPlayer::PlayingState
    V:PortSettingsChanged: 1280x720@24.00 interlace:0 deinterlace:0 anaglyph:0 par:inf layer:0 alpha:255
    06:50:07.935 INFORMATION: Buffer created 0x6a1007c0
    06:50:07.936 INFORMATION: Buffer created 0x6a100830
    06:50:07.936 INFORMATION: Buffer created 0x6a1008a0
    06:50:07.938 INFORMATION: Buffer created 0x6a100920
    06:50:08.151 WARNING: Failed to start surface.
    06:50:08.193 WARNING: Failed to start surface.
    06:50:08.234 WARNING: Failed to start surface.
    06:50:08.275 WARNING: Failed to start surface.
    06:50:08.322 WARNING: Failed to start surface.
    06:50:08.358 WARNING: Failed to start surface.
    06:50:08.399 WARNING: Failed to start surface.
    06:50:08.441 WARNING: Failed to start surface.

    ReplyDelete
  14. eh ... i know.
    I did add
    QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);

    it is better now. I dont see errors, but getting

    WARNING: Failed to start surface.

    I searched for any hints with no luck.
    Any ideas ?

    Full output
    pi@raspberrypi ~/tests/videographicsitem $ ./videographicsitem
    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
    06:49:47.350 INFORMATION: POT build Nov 10 2015 21:01:04.
    Requesting control for org.qt-project.qt.metadatareadercontrol/5.0...
    Requesting control for org.qt-project.qt.mediaavailabilitycontrol/5.0...
    06:49:47.353 INFORMATION: Initializing GPU context in media processor...
    Requesting control for org.qt-project.qt.mediaplayercontrol/5.0...
    Requesting control for org.qt-project.qt.medianetworkaccesscontrol/5.0...
    06:49:47.353 INFORMATION: Initializing buffer provider...
    Requesting control for org.qt-project.qt.videorenderercontrol/5.0...
    VideoPlayer::openFile: fileName: "/home/pi/big_buck_bunny_720p_h264.mov"
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/pi/big_buck_bunny_720p_h264.mov':
    Metadata:
    major_brand : qt
    minor_version : 537199360
    compatible_brands: qt
    creation_time : 2008-05-27 18:36:22
    timecode : 00:00:00:00
    Duration: 00:09:56.46, start: 0.000000, bitrate: 5589 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 5146 kb/s, 24 fps, 24 tbr, 2400 tbn, 480
    0 tbc (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    encoder : H.264
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    timecode : 00:00:00:00
    Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 437 kb/s (default)
    Metadata:
    creation_time : 2008-05-27 18:36:22
    handler_name : Apple Alias Data Handler
    06:50:03.983 INFORMATION: Instantiating texture data...
    06:50:04.001 INFORMATION: Creating EGLImageKHR...
    06:50:04.001 INFORMATION: Instantiating texture data...
    06:50:04.019 INFORMATION: Creating EGLImageKHR...
    06:50:04.020 INFORMATION: Instantiating texture data...
    06:50:04.037 INFORMATION: Creating EGLImageKHR...
    06:50:04.038 INFORMATION: Instantiating texture data...
    06:50:04.056 INFORMATION: Creating EGLImageKHR...
    Video codec omx-h264 width 1280 height 720 profile 77 fps 24.000000
    Audio codec aac channels 6 samplerate 48000 bitspersample 16
    VideoPlayer::mediaStateChanged: state: QMediaPlayer::PlayingState
    V:PortSettingsChanged: 1280x720@24.00 interlace:0 deinterlace:0 anaglyph:0 par:inf layer:0 alpha:255
    06:50:07.935 INFORMATION: Buffer created 0x6a1007c0
    06:50:07.936 INFORMATION: Buffer created 0x6a100830
    06:50:07.936 INFORMATION: Buffer created 0x6a1008a0
    06:50:07.938 INFORMATION: Buffer created 0x6a100920
    06:50:08.151 WARNING: Failed to start surface.
    06:50:08.193 WARNING: Failed to start surface.
    06:50:08.234 WARNING: Failed to start surface.
    06:50:08.275 WARNING: Failed to start surface.
    06:50:08.322 WARNING: Failed to start surface.

    ReplyDelete
    Replies
    1. That example seems to be using widgets, which means probably no graphics acceleration at all. The plugin assumes complete acceleration, both for video and graphics. Which means that code is not compatible with the plugin. You should test examples that use graphics acceleration (typically QML based), otherwise POT won't be used at all.

      Delete
    2. "Anonymous" how much memory did you configured for GPU?
      I have done some test with QMediaPlayer from C++ using the PiOmxTextures backend and there's no problem like this.
      The only scenario I have seen this is when there's not enought memory for the GPU (At least 128MBts). Configure that via raspi-config at console

      Delete
  15. Luca,
    looking in /usr/local/Qt-rasp2-5.5.1/examples/multimediawidgets/videographicsitem/videoplayer.cpp source code, they are using QMediaPlayer class.

    QGraphicsVideoItem *videoItem = new QGraphicsVideoItem;
    videoItem->setSize(QSizeF(640, 480));
    QGraphicsScene *scene = new QGraphicsScene(this);
    QGraphicsView *graphicsView = new QGraphicsView(scene);

    scene->addItem(videoItem);
    ...
    mediaPlayer.setVideoOutput(videoItem);

    Above will not use POT ?
    Can you point me to C++ samples that uses POT (prefer C++ over QML) ?

    Thanks.

    ReplyDelete
    Replies
    1. Maybe I'm wrong but here I go...

      POT is a QtMultimedia Plugin (or Backend). Therefore if you use it in C++, QtWidgets or QtQuick (QML), the Qt framework should do it thing to just use the plugin, qhenever you need some object that uses it, as QMediaPlayer.

      I already said this in other answer but I recently used the QMediaPlayer at C++ level but just to play some background sounds for my app, not video, and it worked perfect and the only plugin available in my RPi is POT

      Delete
  16. Hey Luca,

    first of all, thanks for all your work on this. Its greatly appreciated.

    Your image is working fine, i can play local video files on it perfectly, but i was wondering if i could get https streams to work as well.

    When using such a stream as source for a video object, i get the following error:

    _____________________________________________________________________________
    16:58:17.126 INFORMATION: POT build Nov 10 2015 21:01:04.
    16:58:17.129 INFORMATION: Initializing GPU context in media processor...
    16:58:17.129 INFORMATION: Initializing buffer provider...
    Requesting control for org.qt-project.qt.metadatareadercontrol/5.0...
    Requesting control for org.qt-project.qt.mediaavailabilitycontrol/5.0...
    Requesting control for org.qt-project.qt.mediaplayercontrol/5.0...
    Requesting control for org.qt-project.qt.medianetworkaccesscontrol/5.0...
    Requesting control for org.qt-project.qt.videorenderercontrol/5.0...
    16:58:17.155 ERROR: Failed to open source .
    qml: Status changed to: 8.
    ______________________________________________________________________________

    Where does the problem lie here? Opening the same URL directly with omxplayer works without problems.
    I am a bit confused by the error-message, as it always just shows "." as the source it failed to open. If i give it an invalid "file://" source, the error will correctly display the invalid path.

    Does that mean the "https://" url isn't getting passed through to your backend correctly? How would i go about addressing this?

    Cheers!

    ReplyDelete
    Replies
    1. At the moment the code is pretty close to be ready to play remote streams including https, but probably not entirely. I may publish some developments "soon" to support this better.

      Delete
    2. Good to know!

      Looking forward to further developments on this. Thanks for the info.

      Delete
  17. hi ı couldnt download image. Could u renew another url please

    ReplyDelete
  18. I have uncommented overclock settings on /boot/config.txt and reboot the rpi but it just stuck on the start up where this colorful palette is shown.

    Can anyone please help me to find out where am I doing a mistake?

    ReplyDelete
    Replies
    1. By the way, I use 2100mA adaptor.

      Delete
    2. I'm sorry it probably means your Pi cannot handle that or that the power adapter is not good enough, I don't know. I have pretty long runs with this configuration now:

      force_turbo=1
      boot_delay=1
      arm_freq=1000
      core_freq=500
      sdram_freq=450
      over_voltage=4

      You can try this as well.

      Delete
    3. Ah :S it is probably, would you share your adapter brand please?

      And on those new settings, is temp settings are intentionally missing?

      Thanks

      Delete
    4. No no, that is always safe to place.
      Well, it is an old adapter from an old Samsung smartphone. But I think this may also be related to the board itself, I understand not all are identical. Components may be from different manufacturers.

      Delete
    5. Ah yeah it make sense.
      I guess I can live with minus 100 mhz.
      Thanks for your support.
      Sina

      Delete
  19. Hi Luca
    I'm not able to download the image file.
    it is chinese site and asking the my phone number for registering.
    I have tried everything but nothing happens.
    Thanks
    LD

    ReplyDelete
    Replies
    1. No idea sorry, seems to work properly for me and for many others. Maybe some difference related to the your region.

      Delete
  20. Good job Luca, this is extremely useful, thank you.

    For lrzip haters, take a note;
    http://akil.solutions/share/index.php/s/N6gh49mIOgMHSUn
    pass: 78f8
    size: 2278467583
    img md5: 24d248f3ee7b3da54670a0c46212c56c
    7z md5: 8b398a724f6b3555bfd31a5f7dc0a9b3

    ReplyDelete
    Replies
    1. Write to mail@isgursoyyavuz.com for any problems related with downloading image.

      Delete
    2. Thankyou, I hate lrzip and was not able to decompress over windows your 7z file is extremely useful..

      Delete
  21. Thank you very much! The chinese website was always crashing me, so this is a little delayed christmas miracle! :)

    ReplyDelete
  22. Hello ,I'm Late,
    Which qmake to use for Qt Versions on QtCreator.

    ReplyDelete
    Replies
    1. I'm sorry I don't understand the question.

      Delete
    2. I'm Sorry About My bad English.
      I use Qt5.5.1 and QtCreator on PC with ubuntu 14.04 for Cross Compiling to my device.
      Like This Maybe.
      http://s21.postimg.org/rcomzigjr/Screenshot_from_2016_01_24_21_31_04.png

      Delete
  23. I'm Sorry About My bad English.
    I use Qt5.5.1 and QtCreator on PC with ubuntu 14.04 for Cross Compiling to my device.
    Like This Maybe.
    http://s21.postimg.org/rcomzigjr/Screenshot_from_2016_01_24_21_31_04.png

    ReplyDelete
    Replies
    1. No problem, but I don't see a question here...

      Delete
    2. But Error Like This:
      The qmake executable /opt/rpi/sysroot/usr/local/Qt-rasp2-5.5.1/bin/qmake could not be added: Cannot start "/opt/rpi/sysroot/usr/local/Qt-rasp2-5.5.1/bin/qmake": Exec format error

      Delete
    3. What arch are you on? Qmake is for x86_64.

      Delete
    4. That is probably the reason then.

      Delete
  24. Hello Luca,

    thank you for your nice work! Everything is working fine on my raspberry pi 2 except of gradients. I have some serious banding issues when for example trying:
    RadialGradient {
    anchors.fill: parent
    gradient: Gradient {
    GradientStop { position: 0.0; color: "#004444" }
    GradientStop { position: 0.5; color: "#dddddd" }
    }
    }

    I used your code in my main.cpp:
    // Set EGL to 24bit color depth.
    QSurfaceFormat curSurface = view.format();
    curSurface.setRedBufferSize(8);
    curSurface.setGreenBufferSize(8);
    curSurface.setBlueBufferSize(8);
    curSurface.setAlphaBufferSize(0);
    view.setFormat(curSurface);

    ...but the banding still occurs. It really just looks awful. I googled and found a hint to set QT_QPA_EGLFS_FORCE888=1, but this does not help. As I understand it, I already set the surface format correct.

    Do you have any idea why the banding could happen?
    Thank you again for your great work and have a nice day,

    Florian

    ReplyDelete
    Replies
    1. export QT_QPA_EGLFS_FORCE8888=1 works for me. Gradient is not completely perfect but far better.

      Delete
    2. Sorry, I meant
      export QT_QPA_EGLFS_FORCE888=1.

      Delete
    3. Hi,

      yes, they are better but far from perfect :)

      I have another question regarding video playback. I implemented a player that loads an xml file and plays the urls in the xml file (urls to local mp4 files) by setting the source of a Video component. Everything works fine but after a while (10-20 min) I get a black screen. The output is as always (no error messages). The Video component onStatusChanged is called with value 3 (QMediaPlayer::LoadedMedia) but then the playback doesn't start. Usually there comes a log line regarding creating buffers afterwars.
      The Video component is loaded inside a Loader component and is inside a separate QML file. First I thought of a memory issue, so I watched the ram of the pi while playing, but free mem doesn't decrease too much. I would have still over 580 MB free. Maybe it is an issue with gpu memory, but I have it at 256M. Can I do something to free the memory after each video I played - as far as I saw it, qt does this for me.
      Do you have any other ideas why this problem could happen?

      Thank you so much and have a nice day,

      Florian

      Delete
    4. ...also I notices that my player quits with the following error message:

      CGPlayer: /home/luca/project/pi/pi/piomxtextures_src/omxplayer_lib/OMXCore.cpp:878: OMX_ERRORTYPE COMXCoreComponent::FreeInputBuffers(): Zusicherung »m_omx_input_buffers.size() == m_omx_input_avaliable.size()« nicht erfüllt.

      ..it means that the ASSERT failed.

      Thank you!

      Florian

      Delete
    5. You can file a bugreport, but at the moment I am a little busy. Payed tasks have higher priority.

      Delete
    6. Of course.
      Thank you.

      Delete
  25. Hi Luca Carlon,
    Thank you for your time.
    It seems the download link is not working anymore. i can come to the page by using the password but the download does not seem to work anymore.
    is there a way to get this rom?
    Thank you,
    Bob

    ReplyDelete
    Replies
    1. Hello, I just tried and it seems to work for me.

      Delete
    2. Hi Luca,
      I'm not willing to waste your time, but when i access the link with the code, I see the icon and the file discription, but i thied to download using the chineese download button (the one with the arrow) but that gives me a dropdown menu with two options. I tried both. The first Blue-one opens a page without the file. The second button does nothing.
      Thank you.
      Ps. tried it under Windows and Ubuntu

      Delete
    3. Yes, arrow button and then the blue text. Chromium tells me there may be harmful software, don't know why. Accept the risk, then download starts.

      Delete
    4. thank you.
      Firefox did not download it. So i installed chromium and its downloading perfectly

      Delete
    5. Oh, interesting... if it was possible I'd use a different service but that is the best place to have the files under my control. Last time I used dropbox they suspended my account.

      Delete
  26. Hi Luca, hi everyone.
    I'm having trouble finding a way of decompressing the image on Windows 7.
    Can someone give me a clue?
    Thanks.

    ReplyDelete
    Replies
    1. I tested on Linux and Mac OS. I don't personally care about windows and I won't waste my time over that. Don't know if someone else tried, sorry.

      Delete
  27. Hi Luca.
    Thanks for your work!

    How can I get video resolution? metaData.resolution and metaData.size returns "Undefined".

    ReplyDelete
    Replies
    1. I didn't probably extract those. You can get from ffmpeg. If you want you can file an issue on github to add this to the backend.

      Delete
  28. Is there a way to render HTML5 video tags with this? I've downloaded the image and it works great for video files by providing hardware acceleration. I would like to render RTD (real time data) in the browser using HTML5 and the POT image. Any information is greatly appreciated. Thank you.

    ReplyDelete
    Replies
    1. No, it isn't. There is an experimental patch to webkit that I made which can render video tags with acceleration: https://youtu.be/AuK9Ubu4dOQ but it is outside QML. You can find more info here: http://thebugfreeblog.blogspot.it/2016/06/binaries-for-pot-530-beta1-on-qt-560.html. I stopped there for the moment.
      Otherwise my WebEngine builds should be able to render video tags but without acceleration.

      Delete
  29. Thanks for the great work. The download link is not working for me is there a latest link i can use ?

    ReplyDelete
  30. hello Luca, i have installed QT5 from repository on latest raspbian jessie, and i have compiled a QML app (video playing) locally. however when the app start , an error occurs " QXcbConnection: Could not connect to display. aborted" , from forums they told me to set export DISPLAY=:0, but it didn't worked , then i have read that there is many platforms for gui (qxcbconnection, EGLFS...), please how can i install these plugins on raspberry pi2 to make my app work .

    ReplyDelete
    Replies
    1. You are using the Qt build from the repo so this has nothing to do with this article.

      Delete
  31. Hello, For those looking to get the qt5.7.1 libraries installed on raspberry-pi, you can check thread # 77 at https://github.com/Denvi/Candle. It is also offered for downloading a pre-compiled raspbian jessie PIXEL image. There, qt5 was used to compile candle natively for the control of a CNC. Regards. JVARL

    ReplyDelete
  32. Hello Luca, can you please re-upload the image link? Your job is amazing and I really need it for my project. Thanks

    ReplyDelete
  33. Hello again Luca, I have a Raspeberry Pi 3 and it doesn't start with this image file, maybe it's only for RPi 2 or is a bug? Thanks

    ReplyDelete
    Replies
    1. Not sure, I had no issues on Pi3. Have you already tried with the Jessie Lite image which is a little newer?

      Delete
  34. Hello Luca, sorry for the offtopic question, I had folowed this guide https://wiki.qt.io/RaspberryPi2EGLFS for cross-compile Qt on raspi, but it`s updated and I get errors in the make, also i've a raspi 3 and your Jessie Lite image file. So, do you know some guide or link to do it on raspi3? Thanks

    ReplyDelete
    Replies
    1. What errors? I commonly build auccessfully with it.

      Delete
    2. I have Raspberry pi3 with Raspbian Jessie.

      I'm using Linux Ubuntu to compile.
      What changes should I make in the Configure command

      ./configure -release -opengl es2 -device linux-rasp-pi2-g++ \
      -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- \
      -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs \
      -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v

      When I run qopenglwidget I get the following output:

      pi@raspberrypi:~ $ ./qopenglwidget
      ./qopenglwidget: /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so.5: no version information available (required by ./qopenglwidget)
      ./qopenglwidget: /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5: no version information available (required by ./qopenglwidget)
      ./qopenglwidget: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: no version information available (required by ./qopenglwidget)
      ./qopenglwidget: relocation error: ./qopenglwidget: symbol _ZN14QSurfaceFormat16setDefaultFormatERKS_, version Qt_5 not defined in file libQt5Gui.so.5 with link time reference

      Please. I appreciate all help.

      Delete
    3. The application you are running does not seem to be using the Qt you configured above. The prefix is set to /usr/local/qt5pi but the executable is trying to link from /usr/lib/arm-linux-gnueabihf.

      Delete
  35. Hey Luca

    Great work !! ..very impressed with the things you manage to do with a PI !

    ..just taking my first look at QT and hoping to build a basic video loop / fade / control using GPIO pins...

    ..any chance you could give me a pointer to what I need to upgrade for this image to play nice with QT5.7...or should I use QT5.5.1 on my OSX ?

    Many thanks.

    ReplyDelete
    Replies
    1. Hello, not sure what your OSX has to do with this, but if you want to use Qt 5.7.0 I suggest you use one of the other packages I provided in the other blog posts. This image is simply a standard Raspbian with the libs already installed in the proper places. But you can always download a package with Qt 5.7.0 or 5.8.0-rc1 and install in your own Raspbian. This image is just a shortcut.

      Delete
  36. Forgot to say...I'm running on a PI 3

    ReplyDelete
    Replies
    1. All the packages I provide are compatible with Pi2 and Pi3.

      Delete
  37. Hello Luca,

    Not able to decompress and lrz file on Fedora, can you supply using a different compression?

    Thank you

    ReplyDelete
    Replies
    1. Sorry, I won't invest time on this. The archive seemed to be valid for others.
      Regards.

      Delete