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

Featured Video Play Icon

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 thoughts on “Fully Optimised Raspbian Jessie with Accelerated Qt Multimedia Backend (Pi2)”

  1. Hello Luca,

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

    Thank you

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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

  7. 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 .

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

  9. 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.

  10. 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.

  11. 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), 1280×720, 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: 1280×720@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.

  12. 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.

  13. 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.

  14. 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

  15. 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

  16. …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

  17. 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

  18. 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

  19. 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

  20. Thank you very much! The chinese website was always crashing me, so this is a little delayed christmas miracle! 🙂

  21. 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

  22. 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.

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

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

    Thanks

  24. 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.

  25. 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?

  26. 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.

  27. 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

  28. "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

  29. 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!

  30. 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.

  31. 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.

  32. 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.

  33. 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), 1280×720, 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: 1280×720@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.

  34. 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

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

  36. 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), 1280×720, 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: 1280×720@24.00 interlace:0 deinterlace:0 anaglyph:0 par:inf layer:0 alpha:255
    Segmentation fault

  37. 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) ?

  38. 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);

  39. 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?

  40. 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.

  41. 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?

  42. 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

  43. 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.

  44. 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 🙂

  45. 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.

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

  47. 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.

  48. 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?

  49. 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

  50. 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?

Leave a Reply

Your email address will not be published. Required fields are marked *