Build Procedure for PiOmxTextures

Building PiOmxTextures (POT for convenience) involves building a few components:
  • Build ffmpeg;
  • patch and rebuild Qt Multimedia;
  • build the whatever component you want in POT, which includes:
    • test app using the POT library;
    • POT library;
    • POT plugin;
    • proof-of-concept player (POCPlayer).
NOTE: Starting from POT v5.1.0 (and maybe even some commits before it), patching Qt Multimedia is not needed anymore. But please, remember that your application NEEDS a shared OpenGL context. To enable refer to Qt docs on Qt::AA_ShareOpenGLContexts. Also note that qmlscene sets it by default, so qmlscene is always working (unless you explicitly disable it).

Build ffmpeg

Building ffmpeg and preparing the other 3rdparty deps is simple: go to piomxtextures_tools and run the prepare_3rdparty.sh script. This should also build ffmpeg:

export RPI_SYSROOT= (e.g. /opt/rpi/sysroot)
export COMPILER_PATH= (where 
arm-linux-gnueabihf-gcc is positioned)
cd /piomxtextures_tools
./prepare_3rdparty.sh  n(n is the number of threads)


Patch and Rebuild Qt Multimedia

Unfortunately, still a patch to QtMultimedia is needed, so go into the qtmultimedia dir of your Qt source tree (latest tested is Qt 5.4.1) and patch using the patch provided in tools:

patch -p1 < /piomxtextures_tools/qt_multimedia_patch_5.4.0.patch
$QMAKE_PATH CONFIG+=raspberry
make -jn
make install


Build Components in POT

POT source tree contains a few things, but you can build those pretty independently. Use qmake to build the project or any of the subprojects.

If you're interested in the Qt plugin, once built, you should have the new openmaxil plugin in your Qt install dir (read the output of make). When using, if an error like this is returned when running an application using the plugin:

luca@raspberrypi ~ $ ./piomxtextures_pocplayer
* failed to open vchiq instance


then set the permissions appropriately:

sudo chmod a+rw /dev/vchiq

Or better add your user to the video group. Same stands for input devices:

sudo usermod -a -G video 
sudo usermod -a -G input


Old Build Procedure (prev cfe5a9e)

Building PiOmxTextures (POT for convenience) is a little convoluted. Some work should probably be done to make it simpler. However it requires three main steps:
  • Build ffmpeg;
  • build the POT library;
  • build the POT Qt plugin.

Building ffmpeg

Building ffmpeg should be pretty simple if a proper sysroot is available. A script is provided in the POT repo:

export RPI_SYSROOT= (e.g. /opt/rpi/sysroot)
export COMPILER_PATH= (where 
arm-linux-gnueabihf-gcc is positioned)
cd tools
./compile_ffmpeg.sh n(n is the number of threads)


After this, ffmpeg libs will be placed in the 3rdparty directory and nothing more needs to be done.

NOTE: I had to modify the libssh pkgconfig file ($RPI_SYSROOT/usr/lib/arm-linux-gnueabihf/pkgconfig/libssh.pc) to:

prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib/arm-linux-gnueabihf
includedir=${prefix}/include

Name: libssh
Description: The SSH Library
Version: 0.5.4
Libs: -L{libdir} -lssh
Cflags: -I{includedir}

Building POT lib

POT lib is needed to get an interface to hardware video and audio decoding/playback. A script is provided to prepare the POT lib and the sources for the Qt driver:

export QMAKE_PATH=
./prepare_openmaxil_backend.sh


Now you have to copy the directory of the plugin to the src/plugins subdirectory of your Qt source tree. Once finished, this plugin will be built.

Building POT Qt driver

Unfortunately, still a patch to QtMultimedia is needed, so go into the qtmultimedia dir of your Qt source tree (I tested on the Qt 5.4.0 tree) and patch using the patch provided in tools:

cp -a /openmaxil_backend /qtmultimedia/src/plugins/openmaxil
patch -p1 < /tools/qt_multimedia_patch_5.4.0.patch
$QMAKE_PATH CONFIG+=raspberry
make -jn
make install


Now you should have the new openmaxil plugin in your Qt prefix. When using, remember that libPiOmxTextures.so* must be in the runtime library path when using the plugin. If an error like this is returned when running an application using the plugin:

luca@raspberrypi ~ $ ./POCPlayer
* failed to open vchiq instance


then set the permissions appropriately:

sudo chmod a+rw /dev/vchiq

Or better add your user to the video group. Same stands for input devices:

sudo usermod -a -G video
sudo usermod -a -G input

179 comments:

  1. hi, while building the latest sources (6f4e2f1efd65) and running ./prepare_openmaxil_backend.sh it ends up with a couple of errors like:
    mkdir: cannot create directory ‘/usr/local/qt-5.4.1/plugins’: Permission denied
    i could give him sudo, but is this correct? Am i doing it correctly?
    Thank you.

    ReplyDelete
    Replies
    1. ah figured it out, ./prepare_openmaxil_backend.sh is not needed on latest source, however there is still a problem, when compiling qtmultimedia I get Cannot find file: /home/nick/opt/qt-5.4/qt5/qtmultimedia/src/plugins/openmaxil/openmaxil.pro. and I can not find this file anywhere in the repo.

      Delete
    2. Yes, prepare_openmax_backend.sh is not needed anymore. Follow the procedure in the build page.

      Delete
  2. I'm confused between the old and new way of building :) Can not get it work at all. The ./prepare_3rdparty.sh runs successfully but im unsure about what param qt_src_root means (i suppose its my QT source tree, i.e. the dir where i have the qt modules like qtmultimedia). The ffmpeg seems to compile successfully (i have the libs in 3rdparty/ffmpeg/lib/). The qtmultimedia patch executes without error but when I compile qtmultimedia i get the error above about missing openmaxil.pro file. From the scripts I dont understand what is supposed to copy it there. Any ideas?

    ReplyDelete
    Replies
    1. Yes, the patch... needs a patch... :-) no need to build openmaxil backend anymore. It is built outside.

      Delete
  3. forgot to mention, I'm using QT 5.4.1 from git.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Do you have pkg-config installed? Are you crossbuilding?

      Delete
  5. Hi,
    I delete the latest post by error:
    I was not able to compile ffmpeg, even if I had installed lidssh-dev. I've solved it by modifying libssh.pc file as Luca describe above.

    Moving on the new procedure, I've seen that prepare_openmax_backend.sh is no needed anymore.
    So, to make the player work correctly, we need to include the piomxtextures_qt_driver.pro in our project and use the openmaxilmediaplayer as player?
    If not, could you make a quick description about how to use POT without compiling it as a qtmultimedia pluggin?

    Thanks!

    ReplyDelete
    Replies
    1. The POT library is built as a shared lib and you can find it in piomxtextures_lib. You'll have to take the needed headers yourself, I removed the installation of the headers. The Qt Multimedia Plugin uses the POT lib itself, so you can have a look at that.

      Delete
    2. Thanks for your reply!
      I've also realized that building the piomxtextures_qt_driver does the same as it used to the old installation. The problem no is while "making" it I get this errors:

      /mnt/rpi/usr/lib/arm-linux-gnueabihf/libm.a(fesetround.o): In function `fesetround':
      (.text+0x78): undefined reference to `_dl_hwcap'
      /mnt/rpi/usr/lib/arm-linux-gnueabihf/libm.a(feholdexcpt.o): In function `feholdexcept':
      (.text+0x48): undefined reference to `_dl_hwcap'
      /mnt/rpi/usr/lib/arm-linux-gnueabihf/libm.a(fesetenv.o): In function `fesetenv':
      (.text+0x64): undefined reference to `_dl_hwcap'


      It seems that there is some broken symlinks...

      Delete
    3. Thanks Luca. Rerunning fixQualifiedLibraryPaths fix the problem.

      Delete
    4. Dear Luca,

      First, thanks for you great work, where is the donate button? :)
      Second: I have a raspbian jessie with QT 5.3.2 installed. I've cloned you git, patched qt recompile qtmultimedia, ffmpeg, etc... everything have been compiled successfull.
      Everything was compiled ON rpi (not crosscompiled)
      So, startx, xterm, and type ./piomxtextures_app

      12:57:17.009 VERBOSE: Setting source.
      12:57:17.017 VERBOSE: Source was set: 11b24c8.
      Fontconfig warning: ignoring UTF-8: not a valid region tag
      Cant find EGLConfig, returning null config
      Unable to find an X11 visual which matches EGL config 0
      Could not initialize OpenGL
      Aborted

      What is wrong?

      Thanks,

      Tibor

      Delete
  6. Forgive me. The second question is solved :)
    (i've given wrong qt source at 3rd party script).

    Thanks,

    Tibor

    ReplyDelete
    Replies
    1. If you want to donate to the project you can contact me in private.

      Delete
  7. Hi. At first thank you for your job and to share it. I have a rpi 2 where i have already compiled qt5.5 on the card (with Gstreamer 0.10, i don't know how to use gstreamer 1). I'm trying to build PiOmxTextures but i have some problems. I'm trying to build ffmpeg, for information i did that on the card, no cross compil.
    export RPI_SYSROOT=/
    export COMPILER_PATH=/usr/bin
    cd tools
    ./compile_ffmpeg.sh pi2

    ihave this error :
    Prefix to /home/pi/opt/pi-master/3rdparty/ffmpeg/ffmpeg_src...
    ERROR: smbclient not found

    Building...
    Makefile:2: config.mak: No such file or directory
    Makefile:59: /common.mak: No such file or directory
    Makefile:100: /libavutil/Makefile: No such file or directory
    Makefile:100: /library.mak: No such file or directory
    Makefile:102: /doc/Makefile: No such file or directory
    Makefile:185: /tests/Makefile: No such file or directory
    make: *** No rule to make target '/tests/Makefile'. Stop.
    Makefile:2: config.mak: No such file or directory
    Makefile:59: /common.mak: No such file or directory
    Makefile:100: /libavutil/Makefile: No such file or directory
    Makefile:100: /library.mak: No such file or directory
    Makefile:102: /doc/Makefile: No such file or directory
    Makefile:185: /tests/Makefile: No such file or directory
    make: *** No rule to make target '/tests/Makefile'. Stop.
    Cleaning up...
    mv: cannot stat `ffmpeg_compiled/include': No such file or directory
    mv: cannot stat `ffmpeg_compiled/lib': No such file or directory
    Done! Bye bye! ;-)

    Do you know where is the problem ?

    ReplyDelete
    Replies
    1. It seems you are not providing a proper sysroot. I suggest you use the prebuilt packages.

      Delete
    2. i got the same problem, my sysroot is ok i think as i'am using it often to cross compile my apps, any idea what should we check to fix our problems ? :)

      Delete
    3. The library cannot be found or maybe it is not in the sysroot at all. Maybe something related to pkgconfig. Cannot be more specific, it depends on your setup.

      Delete
    4. hmm the problem exists with --sysroot=$RPI_SYSROOT
      when i set /mnt/raspiimg (mounted img of jessie from my pi)
      i get error like in Anonymous message

      when i set it to my crosscompiled with crosstool-ng directory armv7-rpi2-linux-gnueabi/armv7-rpi2-linux-gnueabi/sysroot
      i get some other errors like
      /Volumes/Cross/armv7-rpi2-linux-gnueabi/bin/armv7-rpi2-linux-gnueabi-gcc is unable to create an executable file.
      C compiler test failed.

      but when i remove it everything goes fine when executing ./prepare_3rdparty.sh
      what excatly is --sysroot and do i need it or will it be fine without it ?

      Delete
    5. The guy above set RPI_SYSROOT to /, which I suspect is wrong as that is the root of the host. I don't know anything about your issue because I know nothing about your setup.

      Delete
  8. Hi Luca...

    Is this still the procedure to build POT from sources?
    Is a patch to Qt Multimedia still needed?

    On the other hand, we decided to buy the Commercial version of Qt, and they provide a image for raspberry pi 2 based on Armstrong using the Yocto project, but now we are facing the problem to include in it POT and assure Hardware Accelerated Videos...
    Have you tried something in this line?

    ReplyDelete
    Replies
    1. No, actually no. Not needed anymore. I'll update the procedure.

      Delete
    2. No, sorry, never tried to build on anything other than raspbian. Doesn't commercial Qt have a solution for Qt Multimedia?

      Delete
    3. Added a proper note to the article.

      Delete
  9. Nicolas, can you ask Qt why gstreamer 1.0 isn't working with QML as backend? gstreamer 1.0 can hardware-decode videos on PI.

    ReplyDelete
    Replies
    1. It seems to work in my build. Not sure however if it is possible to improve.

      Delete
  10. hi, i'am back with some more questions :) i have succesfully compiled qt5 with gstreamer, and then i followed tutorial found on this page:
    1. run prepare_3rdparty.sh
    2. rebuild qtmultimedia
    3. build qt plugin, after this i have
    libgstaudiodecoder.so libgstmediacapture.so libopenmaxilmediaplayer.so
    libgstcamerabin.so libgstmediaplayer.so libqtmedia_audioengine.so
    in qt/plugins/mediaservice
    3. next i build piomxtextures_pocplayer upload and try to run, after starting video app crashes with
    qml: Setting media source...
    Segmentation fault
    I have also tried to move libgstmediaplayer.so file from mediaservice dir but then i get no error only
    qml: Setting media source...
    and nothing happens

    what am i missing and what is piomxtextures_lib, do i need it ?

    ReplyDelete
    Replies
    1. Remove any libgst* file from mediaservice directory. gstreamer and POT are mutually exclusive.

      Delete
    2. hi, ok, i have tried and nothing happens when i click open and chose a file (.mp4) (tried with your compiled qt and it worked fine some time ago) i only get:
      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).
      defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
      Can't find extension for .
      Can't find extension for image/jp2.
      Can't find extension for image/vnd.microsoft.icon.
      Can't find extension for image/x-dds.
      Can't find extension for image/x-icns.
      Can't find extension for image/x-mng.
      qml: Setting media source...

      and thats all, black screen, pocplayer still works as i can open menu by click mouse.
      what should i check ?

      Delete
    3. Read the blog, you'll find information.

      Delete
  11. sorry, cant edit, when no libgstmediaplayer lib in mediaservice folder i also get:
    defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"

    ReplyDelete
  12. Hi Luca, Following the cross compile tutorial from qt wiki I was able to cross compile and deploy qml apps to rpi :):) now I want to add your qt multimedia backend.

    In the beginning you say that the patch isn't need no more but than you say we need to patch. Can you take a look at the tutorial above and say if it is updated or not? Thank you

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. PS: here is my build config: http://pastebin.com/mStsgGUM

      Delete
    3. The procedure is there for any version of POT, even the olders. The note in red applies to the latest versions. So if you are in that condition you can skip that step now.

      Delete
    4. http://pastebin.com/D8eqMSYZ

      Do I need smbclient to compile ffmpeg? if yes do I need to install ir on pi, right?

      Delete
    5. It depends on how you set it up. My setup includes it, yes.

      Delete
    6. I have installed libsmbclient and libsmbclient-dev on RPi, then I sync the files again on host but it still cant find smbclient :s ERROR: smbclient not found

      Delete
    7. PS: my config:
      export RPI_SYSROOT=~/raspi/sysroot
      export COMPILER_PATH=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/
      ./prepare_3rdparty.sh ~/raspi/qtbase/ pi1

      http://pastebin.com/wGfYDLcf

      Delete
    8. The build procedure is pretty long. You also need to setup pkgconfig. Not sure if it is the case here.

      Delete
    9. it looks like pkgconfig isn't looking for libraries inside sysroot http://pastebin.com/YUQuxA3m can you take a look?

      Delete
  13. I manually change the smbclient.pc file to make the it point to the correct path and now configure pass the smbclient test but failed next at libssh because all the *.pc files are point to /user/lib/arm-linux-gnueabihf instead of home/ze/raspi/sysroot/usr/lib/arm-linux-gnueabihf
    Do you remember what have you done to make it work?

    Thank you a lot

    ReplyDelete
    Replies
    1. You're probably missing the env setup for pkgconfig. What are you trying to accomplish? Building for Pi1?

      Delete
  14. I tried to set PKG_CONFIG_PATH with no sucess. Yes, i'm trying to compile it to Pi1.


    I got this answer from ffmepg mailinglist:

    "Well, you have "--pkg-config=pkg-config" in your configure line, what did
    you expect?

    http://ffmpeg.org/faq.html#How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f"

    But after read that I don't know how to change pkg-config.

    ReplyDelete
    Replies
    1. I think I added that for Jessie recently. But unless there is a comment somewhere I don't remember why.

      Delete
  15. I download the scr from your git recently, do you have a development branch?

    I have read the the all the comments from your recent posts but couldn't find any information about pkg-config settings. Would you mind to search in your host bash history for pkg-config settings related?

    Thank yoh

    ReplyDelete
    Replies
    1. No that script is what I use. You should set up the entire env properly, can't say what is wrong sorry. Try with a pkgconfig manual and see what you are missing.

      Delete
  16. Can you at least see if you have any pkg-config setting on bashrc that you didn't remember to set up?

    That strange why it is working.. Can you share your target sysroot folder on host to compare?

    ReplyDelete
  17. We need to set up this variable export PKG_CONFIG_SYSROOT_DIR=/home/ze/raspi/sysroot so we don't need to manually change pc files :)

    Now that I prepare_3rdparty is done what do I need to do?

    ReplyDelete
  18. Do you compile qtbase and then each module you need?

    ReplyDelete
  19. Ok, I have compiled QtQuick but now I'm trying to solve some opengl problems for some hous without success http://pastebin.com/RZehkPzN :s

    ReplyDelete
  20. I haven't found how to solve this problem :S

    ReplyDelete
  21. It is trying to use GLES3 and RPI only support GLES2, don't you remember if you have set up anything related to it?

    ReplyDelete
    Replies
    1. Your setup is clearly wrong, it is trying to build against a wrong gl, but can't know why. What is your Qt config?

      Delete
    2. Qt config http://pastebin.com/mktyGshE

      Delete
    3. when doing ./prepare_3rdparty.sh you ask for qt_src_root, do you really mean the src or the binaries?

      Delete
    4. Seems ok. Remove the package that includes GLES3.

      Delete
    5. I didn't do that $QMAKE_PATH CONFIG+=raspberry should it be the reason?

      Delete
    6. It is what I have done:

      export RPI_SYSROOT=~/raspi/sysroot
      export COMPILER_PATH=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/
      export PKG_CONFIG_SYSROOT_DIR=/home/ze/raspi/sysroot
      cd carlonluca/piomxtextures_tools/
      ./prepare_3rdparty.sh /home/ze/raspi/qtbase/ pi1
      cd ..
      ~/raspi/qt5/bin/qmake
      make

      Delete
    7. I found I don't have a qtmultimedia folder as told here http://thebugfreeblog.blogspot.pt/2014/12/updates-on-hardware-accelerated-qt.html

      Delete
    8. Unless you are using a version < 5.1.0 you don't need to patch qtmultimedia. You just need a regular qtmultimedia build.

      Delete
  22. I'm using Qt 5.6.0 and the most recent POT. Can you check my previous comment and see if i'm exporting the need variables or if there is something more?

    Thank you

    ReplyDelete
    Replies
    1. I'm sorry, again it depends on your setup. That GL problem indicates you have a setup that includes packages that I'm not using, so I do not know what is wrong or missing.

      Delete
    2. Can you just confirm me that it is the right procedure:

      export RPI_SYSROOT=~/raspi/sysroot
      export COMPILER_PATH=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/
      export PKG_CONFIG_SYSROOT_DIR=/home/ze/raspi/sysroot
      cd carlonluca/piomxtextures_tools/
      ./prepare_3rdparty.sh /home/ze/raspi/qtbase/ pi1
      cd ..
      ~/raspi/qt5/bin/qmake
      make

      Delete
  23. Could you please confirm me these are the needed commands to build POT?

    ReplyDelete
  24. Hello again... I have been trying to build it without no success. Obviously there is something I'm doing wrong, can you revisit it please? Can you share your ENV VAR and the commands list you're using to compile it?

    Thank you

    ReplyDelete
    Replies
    1. metRo, as apparently we're using a similar environment, I'll share what has worked for me (Pi 1)
      1) I followed the following procedure to build Qt 5.6.1 for Pi:
      https://wiki.qt.io/RaspberryPi2EGLFS

      But instead of using the full stock jessie image, I opted for the minimal one.
      I had to add some include paths to the config script (-I) to correct a few build errors ("~/raspi/sysroot/opt/vc/include" "~/raspi/sysroot/opt/vc/include/interface/vcos/pthreads" "~/raspi/sysroot/opt/vc/include/interface/vmcs_host/linux")

      2) After successfully building qtbase, I built qtmultimedia with gst-omx support. The build procedure clearly states that it's unusable - but I gave it a try anyway.
      The QVideoWidget support is really bad - a frame or two is displayed and then it crashes.
      After building QtDeclarative, I could verify that the QML video sample works better - but crashes too... So GSteamer 1.0 + gst-omx still sucks.

      3) The aforementioned build procedure links to Luca's project as an open implementation of openmax + qt. That's how I got it compiled in my environment:

      - Downloaded POT 5.2.0 and tried to compile using my sysroot.
      - ffmpeg complained about samba and ssh. It doesn't matter if you apt-get those stuff, rsync + correct the symlinks. The ffmpeg configure script won't find it.
      Then I just disabled those dependencies in compile_ffmpeg.sh script (--disable-libsmbclient --disable-libssh). Worked.
      - Next I had to deal with the same gles3 header problem as you had - weird, because the qtbase was configured with -opengl es2. Anyway that's how I've fixed it:
      ~/raspi/qt5pi/include/QtGui/qopengl.h:
      //manually undef this guys...
      #undef QT_OPENGL_ES_3_1
      #undef QT_OPENGL_ES_3
      // before the following lines:
      # if defined(QT_OPENGL_ES_3_1)
      # include
      # elif defined(QT_OPENGL_ES_3)
      # include
      # else
      # include
      #endif

      Bingo... gles3 solved.
      Then you'll need a few more packages during the compile time (v4l2, boost maybe more), and then a few others (ssh, bz2) during link time. If your environment is different, just pay attention to missing headers or libraries, apt-get them, rsync, correct the symlinks and you'll be able to continue the build process.

      Once built, rsync all you need to your pi and have fun.
      Note that if you chose to build QMultimedia with GStreamer+gst-omx, you'll have to remove those plugins from the plugins/mediaservice folder.

      Hope this helps you or someone else.

      SH

      Delete
    2. Thank you,

      I'm going to try this :)

      Delete
    3. gles3 error solved :) but it now fails at the end, something relted to mediaservice http://pastebin.com/RDqBP4L1 :s almost there!! :D

      Delete
    4. Project ERROR: No module claims plugin type 'mediaservice'

      I'm sorry, I don't remember ever seeing something like this.

      Delete
    5. I havan't install QtMultimedia :/ Now "make" done with success :)
      However "make install" doesn't make anything :s
      http://pastebin.com/sSrhRyRb

      How do I install it now?

      Delete
    6. It is not supposed to do anything. You should have the plugin already installed in the proper directory of mediaservice plugins.

      Delete
    7. Should I rsync qt5pi to RPi?

      Delete
    8. Don't know your env but probably yes.

      Delete
    9. I have the qt5pi on RPi with your libraries but when I try to run a qml from your repository I got a bad_alloc error:

      http://pastebin.com/QEcGpM5P

      Delete
    10. and poc_player is warning about a qtquick.layout module, can you help me install that http://pastebin.com/nBc67a2W

      Delete
    11. Sorry, I see no log from POT there at all. May not even be related. Can't help you.

      Delete
    12. Another step, installed QtQuickControls and now:
      22:21:26.995 VERB: Can't find extension for .
      22:21:26.997 VERB: Can't find extension for image/vnd.microsoft.icon.

      http://pastebin.com/CK02LumY

      Delete
    13. That may be normal. I don't see anything wrong in that log. Is it working?

      Delete
    14. No, nothing show on The screen. Can you explain me wath tells qtmultimedia to use your drives? It make me a little confused not to build qtmultimedia again after build your project.

      Delete
    15. This is correct. Click on the screen with a mouse and press play. The video won't start automatically with that sample.
      How the plugin is loaded is up to Qt. Do not place multiple plugins, just one.

      Delete
    16. ok, I'm able to open the dialog, select the video but then it doesn't show on the screen. I tried an image and it worked.

      The following links are the result of trying to open diferent video formats.
      http://pastebin.com/RknwS4Ld
      http://pastebin.com/bH4ndKrU

      Video file types
      http://pastebin.com/ezkgsGWy

      thank you

      Delete
    17. PS: I can play some of the above videos with omxplayer

      Delete
    18. No idea sorry. The first one seems to be running, I don't know what is wrong with your build. Can you play the video with my builds?

      Delete
    19. With your lastest build for RP1 I can play the video however because I'm using a screen that was only added to kernel recently I need to run latest raspbian version.

      I don't know if you saw my pastebin trying to run the video_loop.qml:

      pi@raspberrypi:~ $ /usr/local/qt5pi/bin/qmlscene video_loop.qml big_buck_bunny_480p_surround.avi
      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).
      terminate called after throwing an instance of 'std::bad_alloc'
      what(): std::bad_alloc
      Aborted

      Delete
    20. Are you running on Qt 5.6 or 5.5?

      Delete
    21. Qt 5.6 here is my config: http://pastebin.com/mStsgGUM

      I have clone qt-base and then add qtdeclarative, qtquick1, qtquickcontrols, qtquickcontrols2 and qtscript.

      Delete
    22. This comment has been removed by the author.

      Delete
    23. PS: I did run it from qt creator and have some more info:
      QML debugging is enabled. Only use this in a safe environment.
      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).
      20:45:38.505 INFO: [0;32mPOT build Mar 26 2016 16:05:31. [0m
      Requesting control for org.qt-project.qt.metadatareadercontrol/5.0...
      20:45:38.520 INFO: [0;32mInitializing GPU context in media processor... [0m
      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.audiorolecontrol/5.6...
      bash: line 1: 1368 Segmentation fault DISPLAY=':0.0' /home/pi/untitled2/bin/untitled2
      Application finished with exit code 139.

      Delete
    24. Pass an URI to qmlscene, not a path. And look back in the blog, there is a red message reporting the order of the qmlscene. The one you are using may be wrong.

      Delete
    25. got path right and it is working but no video: https://www.youtube.com/watch?v=EiiXICWN-hs

      Delete
    26. The log seems perfectly ok and the position seems to be changing so I have no way to understand what is happening. You may try to increase log level but I see no error anyway. Also I never tested on other screens or resolutions other than 1080p.

      Delete
    27. Connected it to a Full HD monitor and it doesn't workd too :s nothing shown on the screen but the mouse. This time I run it directly from the device instead of ssh. help me please

      Delete
    28. I'm sorry, but I don't have elements to say what is wrong. I'd need to do a complete build myself but at the moment I don't have the time to do it.

      Delete
  25. Do I need to compile QtMultimedia again?

    ReplyDelete
  26. Any guide on how can I debug it?

    ReplyDelete
    Replies
    1. Go to the logging header and set level to debug. Then poat the complete result.

      Delete
    2. can you be more explicit, thank you

      Delete
    3. Not sure how... in POT source code go to the header omx_logging.h and change the debug level. It is a macro that may be set to "INFORMATION". Try to set to DEBUG and rebuild.

      Delete
  27. pocplayer: http://pastebin.com/hcUwszvQ
    qml example: http://pastebin.com/CwyAhSH0

    ReplyDelete
    Replies
    1. No visible error it seems. But:

      16:54:17.278 DBG: [0x1fbd450] virtual void OpenMAXILPlayerControl::play()
      16:54:20.064 DBG: [0x1fbd450] virtual void OpenMAXILPlayerControl::pause()

      So you play and then pause after less than three seconds?

      Delete
  28. PS: this is the output from your last image for rpi1 that works and video is shown: http://pastebin.com/vSWzVtDc

    The problem with this image is that the linux kernel doesn't support the screen where I want to use it.

    ReplyDelete
  29. In file included from ../piomxtextures_src/omx_mediaprocessor.h:44:0,
    from ../piomxtextures_src/omx_mediaprocessorelement.h:32,
    from ../piomxtextures_src/omx_videosurfaceelement.h:36,
    from ../piomxtextures_src/omx_videosurfaceelement.cpp:39:
    ../piomxtextures_src/omx_textureprovider.h: In member function 'bool OMX_EGLBufferProvider::init()':
    ../piomxtextures_src/omx_textureprovider.h:237:39: error: 'globalShareContext' is not a member of 'QOpenGLContext'
    ../piomxtextures_src/omx_textureprovider.h: In member function 'void OMX_EGLBufferProvider::deinit()':
    ../piomxtextures_src/omx_textureprovider.h:532:40: error: 'globalShareContext' is not a member of 'QOpenGLContext'
    Makefile:1145: recipe for target 'omx_videosurfaceelement.o' failed



    Why this error

    ReplyDelete
  30. Replies
    1. when I ./compile_ffmpeg.sh, when configureing, it shows
      "Unknown option "-mfpu=neon-vfpv4"
      it seems -mfpu don't have section name "neon-vfpv4"
      I check the configure file, and there are only 4 sections of -mfpu.

      -mfpu=neon) echo --float_support=vfpv3 --neon ;;
      -mfpu=vfp) echo --float_support=vfpv2 ;;
      -mfpu=vfpv3) echo --float_support=vfpv3 ;;
      -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;

      is .sh file wrong or the vision of ffmpeg_src file wrong?

      Delete
    2. Pi3 is not different from Pi2. Pi3 is backwards compatible.

      Delete
    3. Thanks! I will try to build as pi2 first.

      Delete
    4. I have the same error.
      ../piomxtextures_src/omx_textureprovider.h:532:40: error: 'globalShareContext' is not a member of 'QOpenGLContext'
      Makefile:1145: recipe for target 'omx_videosurfaceelement.o' failed

      My qt version is 5.4.1. What should I do? Update qt to >5.5?

      Delete
    5. No, Qt 5.5 should be sufficient. Requirement is Qt >= 5.5.

      Delete
    6. Thanks for your help luca.
      God! That means I have to rebuild damn QT..

      Delete
  31. I have rebuilt the QT and now the version is 5.7. But when I patch the patch, it is failed. And I just install the no-patch qmultimedia. But when I run ./piomxtextures_tools, it shows

    cd piomxtextures_lib/ && ( test -e Makefile || /usr/local/qt5pi-5.7/bin/qmake /home/lxy/Downloads/pi-master/piomxtextures_lib/piomxtextures_lib.pro DEFINES+=CONFIG_LIB DEFINES+=CONFIG_INCLUDE_FFMPEG -o Makefile ) && make -f Makefile install
    Project MESSAGE: Building for RPi1...
    Project ERROR: Unknown module(s) in QT: multimedia
    Makefile:60: recipe for target 'sub-piomxtextures_lib-install_subtargets' failed
    make: *** [sub-piomxtextures_lib-install_subtargets] Error 3

    why it can not find multimedia module?

    ReplyDelete
    Replies
    1. Probably because your installation does not include it?

      Delete
  32. I find that even if I disable ssh and smbclient when compiling ffmpeg, they are still need when compile piomx-lib. And when make piomx-lib, makefile will automatically add -lsmbclient and -l ssh after make. I don't why you has to add them. But I get a solution.
    Simply apt-get smbclient and ssh is not enough. Because they will not link the lib. So in order to enable -lssh and -lsmbclient, you need to link the lib. (-lxxx must need a file named libxxx.so, and libxxx.so.n is not satisfied.)
    As an example, I link my lib with
    cd /usr/lib/arm-linux-gnueabihf
    ln -s libssh.so.4.4.1 libssh.so
    ln -s libsmbclient.so.0.2.3 libsmbclient.so

    Ps: Thanks for Luca's patience. You always willing to give me a reply. Also appreciate your amazing piomx, even though I have not finish buiding it XD.
    BTW, here are some error in path so I have to change your .ssh file. For example,ffmpeg is build in 3rdparty/ffmpeg/ffmpeg_pin, but when running ./prepare_openmaxil_backend.sh, it asks for ffmpeg lib and include files in 3rdparty/ffmpeg/. And why it chooses to build for Pi1 as default and I cannot change it to Pi2. It seems better to give a choice just like ffmpeg.

    Thanks Luca again!

    ReplyDelete
  33. Here is another question. What should I copy from build-PiOmxTextures? You just
    cp -a build-PiOmxTextures/libPiOmxTextures* PiOmxTextures/lib and
    cp -a build-PiOmxTextures/piomxtextures/* PiOmxTextures/include
    But infact, there are
    Makefile piomxtextures_pocplayer piomxtextures_qt_driver
    piomxtextures_app piomxtextures_pocplayer_widget piomxtextures_samples
    piomxtextures_lib piomxtextures_qmlutils
    in the file, but not simply the lib and include file.

    What should I copy?
    And after I get ffmpeg, PiOmxTextures-lib, LightLogger, what should I do then? I am not quite get the point.

    ReplyDelete
    Replies
    1. I find that I can just compile and install like other qt plugins. Is that the same?
      qmake->make->make install

      Delete
    2. The plugin is built statically so it contains all you need, including ffmpeg. Just ensure it is placed in the proper position.
      Yes, qmake and make is what is needed to build, assuming all the deps are in place. Building the deps can be achieved using the prepare_3rdparty script.

      Delete
    3. What means proper position? Need I put all lib in /usr/lib/arm-linux-gnueabi and include in /usr/include?
      Now I run ./piomxtextures_pocplayer ~/Download/1.mp4
      and it shows:
      unrecognized media assuming video
      can't find extension for .
      can't find extension for image/jp2.
      can't find extension for image/vnd.microsoft.icon

      libva error:va_getDriverName() failed with unknown libva error, driver_name=(null)
      warning: Error:"Could not initialize supporting library."

      How can I fix it?

      Delete
    4. I have rebuild the pocplayer and now it can run a video, but it is nothing different with ffmpeg0.1, it is still not smooth, and the frame seems only 2-10fps. Is this because I have do something wrong?

      Delete
    5. The procedure is simple and is explained above. There are just two steps: build ffmpeg and build POT. 2-10fps means you've done something wrong.

      Delete
    6. The followings are what I now get, could you please show me what I miss?

      ffmpeg(including lib and include)
      PIO_QT_driver(I get a libopenmaxilmediaplayer.so in mediaservice)
      poc_player
      POT_lib
      pio_app


      Delete
    7. Still libva error, if I cd piomxtextures_pocplayer and qmake and make the pocplayer.
      But if I us qtcreator load the.pro file and build and run, it is ok, but 2-10fps.

      Delete
  34. This is the output while I run the poc_player.

    [9;0]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).
    JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
    JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
    QDeclarativeAudio::itemChange
    QMediaPlayer::onItemChanged
    QDeclarativeAudio::itemChange
    QMediaPlayer::onItemChanged
    libva info: VA-API version 0.39.0
    libva info: va_getDriverName() returns -1
    libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
    libva info: VA-API version 0.39.0
    libva info: va_getDriverName() returns -1
    libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
    libva info: VA-API version 0.39.0
    libva info: va_getDriverName() returns -1
    libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
    libva info: VA-API version 0.39.0
    libva info: va_getDriverName() returns -1
    libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
    Error: "Could not initialize supporting library."
    Killed

    ReplyDelete
    Replies
    1. libva has nothing to do with POT so you're doing something wrong, but I have no idea what you're doing, sorry.

      Delete
    2. Can the patch patches on qt5.7? When I patch the patch, there are 2 failed, so I read the patch and change the Qmultimedia code myself. But I still wonder is the patch fit Qt5.7?

      Delete
    3. Fine...In fact, I did not make it clear before that whether I need patch.
      One more question, when running prepare_3rdparty.sh, it will ask for . Why?

      Delete
    4. It will ask for qt_src

      Delete
  35. I have enable gstreamer1.0 when I cross-compile my qt, is that right?

    ReplyDelete
    Replies
    1. POT has nothing to do with gstreamer, but Qt is probably selecting the gstreamer plugin, so remove it.

      Delete
  36. Hi Luca,

    i crosscompiled QT 5.6.1 for my RPI-1.
    Building POT acccording to the above tutorial doesn't work for me. Obviously too many missing libs etc.

    Can i use one of your binaries to integrate the needed files into my QT directory? So i don't need to compile myself.
    Which files would i have to copy? And where?

    Thanks a lot,
    Ben

    ReplyDelete
    Replies
    1. I'm sorry but my latest binaries are optimized for Pi2 and won't work on Pi1.

      Delete
    2. Trying to follow Luca's build instructions
      1) building 3rd party tools seems to have worked
      2) When running qmake on the main POT folder i get the following error. Any idea what is missing?
      Project MESSAGE: Building for RPi1...
      Project ERROR: freetype2 development package not found

      At least the following dev files are installed in the sysroot -> libfreetype6-dev

      Ben

      Delete
    3. Anybody who can help on that?

      It seems like some dev files in my sysroot are not found.

      For example "make" complains about the missing header file "ft2build.h"
      But it's there, in the sysroot: sysroot/usr/include/freetype2/ft2build.h

      Ben

      Delete
    4. freetype2 is referenced using pkg-config, so check everything is in place.

      Delete
    5. Luca, i appreciate any help.
      I don't really know how to find out, why the files are not found.

      "pkg-config" and "autoconf" are installed. If i uninstall them, i get other errors, so i assume that basically they work.

      I set the following variables.
      sysroot=/home/opt_qt_for_rpi/qt5.6.1-1/sysroot
      export RPI_SYSROOT=${sysroot}
      export PKG_CONFIG_SYSROOT_DIR=${sysroot}
      export PKG_CONFIG_DIR=
      export PKG_CONFIG_LIBDIR=${sysroot}/usr/lib/pkgconfig:${sysroot}/usr/share/pkgconfig
      export COMPILER_PATH=/home/niki/opt_qt_for_rpi/qt5.6.1-1/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin

      Ben

      Delete
    6. Can't help you, this is your environment. Check that pkg-config is finding the configuration and that the linker flags are correct.

      Delete
    7. Ok,good hints.
      1) but how could I check pkg-config?
      2) linker flags: if those are not Ok,should I manipulate your .pro file or the makefile after running qmake?

      Delete
    8. I just figured, that i didn't enable "pkg-config" support when running ./configure on qt.
      Is this necessary, so that qmake can find freetype2 through pkg-config?

      >pkg-config ............. no

      Delete
    9. You shouldn't need to enable it explicitly. But if configure fails to find it you may encounter issues yes.

      Delete
    10. Thanks, solved by recompiling qmake.
      Now i get an error from "make". Any ideas what's missing?


      /opt_qt_for_rpi/qt5.7.0/qtsrc/pot/pi/piomxtextures_src/omx_audioprocessor.cpp:410:53: error: ‘avcodec_get_frame_defaults’ was not declared in this scope
      avcodec_get_frame_defaults(decoded_frame);
      ^
      Makefile:4083: recipe for target 'omx_audioprocessor.o' failed
      make[1]: *** [omx_audioprocessor.o] Error 1

      Delete
    11. You didn't probably build ffmpeg properly with the prepare_3rdparty script.

      Delete
    12. I did use your script,but got a bunch of missing header files. Can you tell me (or at least for a few) where I can get those??

      Delete
    13. atomic.h
      mbarrier.h
      windows.h
      conio.h
      io.h
      lzo/lzo1x.h
      X11/extensions/Xvlib.h
      CoreServices/CoreServices.h
      direct.h
      d3d11.h
      dxva.h
      dxva2api.h
      io.h
      libcrystalhd/libcrystalhd_if.h
      mach/mach_time.h
      net/udplite.h
      valgrind/valgrind.h
      vdpau/vdpau.h
      vdpau/vdpau_x11.h
      VideoDecodeAcceleration/VDADecoder.h
      VideoToolbox/VideoToolbox.h
      X11/extensions/XvMClib.h
      d3d9.h
      va/va.h
      vdpau/vdpau.h
      linux/videodev.h
      sys/videoio.h
      vfw.h
      dshow.h
      dev/bktr/ioctl_meteor.h
      machine/ioctl_meteor.h
      dev/video/meteor/ioctl_meteor.h
      dev/ic/bt8xx.h
      sndio.h
      soundcard.h
      va/va.h
      vdpau/vdpau.h

      Delete
    14. I finally managed to get it running. Not sure if everything works but it does show videos fluently. :-))

      I am running qmlscene with simple-qml, but commented out the audio part in the qml.
      One of the videos produces no obvious errors in the bash, but doesn't show a video (red background).

      Output of simple-qml is:
      Duration: 00:00:07.67, start: 0.000000, bitrate: 43062 kb/s
      Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 41647 kb/s, 30 fps, 30 tbr, 3k tbn, 6k tbc (default)

      Then every few seconds:
      16:14:38.304 INFO: Seek to: 00:00:00


      Any idea why?

      Delete
    15. If you think there is a bug then please open an issue on github and provide all that is needed to reproduce the issue.

      Delete
    16. Don't think it's a bug, but i just don't know whats missing.


      Got keys from plugin meta data ("org.qt-project.qt.mediaplayer")
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/bin/mediaservice" ...
      loaded library "/usr/local/qtpi_5.7.0/plugins/mediaservice/libopenmaxilmediaplayer.so"
      14:05:29.764 INFO: POT build Dec 7 2016 21:55:00.
      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.audiorolecontrol/5.6...
      14:05:29.778 INFO: Initializing GPU context in media processor...
      14:05:29.786 INFO: Initializing buffer provider...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/plugins/video/declarativevideobackend" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/bin/video/declarativevideobackend" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/plugins/video/videonode" ...
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/qtpi_5.7.0/plugins/video/videonode/libeglvideonode.so"
      Found metadata in lib /usr/local/qtpi_5.7.0/plugins/video/videonode/libeglvideonode.so, metadata=
      {
      "IID": "org.qt-project.qt.sgvideonodefactory/5.2",
      "MetaData": {
      "Keys": [
      "egl"
      ]
      },
      "className": "QSGVideoNodeFactory_EGL",
      "debug": false,
      "version": 329472
      }


      Got keys from plugin meta data ("egl")
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/bin/video/videonode" ...
      loaded library "/usr/local/qtpi_5.7.0/plugins/video/videonode/libeglvideonode.so"
      Requesting control for org.qt-project.qt.videorenderercontrol/5.0...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/plugins/accessible" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/bin/accessible" ...
      Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/pi/mov2.mov':
      Metadata:
      major_brand : qt
      minor_version : 537331968
      compatible_brands: qt CAEP
      creation_time : 2016-05-28 18:05:12
      Duration: 00:00:07.67, start: 0.000000, bitrate: 43062 kb/s
      Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 41647 kb/s, 30 fps, 30 tbr, 3k tbn, 6k tbc (default)
      Metadata:
      creation_time : 2016-05-28 18:05:12
      Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 44100 Hz, stereo, s16, 1411 kb/s (default)
      Metadata:
      creation_time : 2016-05-28 18:05:12
      14:05:30.677 INFO: Instantiating texture data...
      14:05:30.695 INFO: Instantiating texture data...
      14:05:30.713 INFO: Instantiating texture data...
      14:05:30.731 INFO: Instantiating texture data...
      Video codec omx-h264 width 1920 height 1080 profile 578 fps 30.000000
      Audio codec pcm_s16le channels 2 samplerate 44100 bitspersample 16
      V:PortSettingsChanged: 1920x1088@30.00 interlace:0 deinterlace:0 anaglyph:0 par:inf layer:0 alpha:255
      14:05:31.066 INFO: Buffer created 0xb2c0c8d0
      14:05:31.072 INFO: Buffer created 0xb2c0c940
      14:05:31.086 INFO: Buffer created 0xb2c0c9b0
      14:05:31.091 INFO: Buffer created 0xb2c0ca20
      14:05:39.494 INFO: Seek to: 00:00:00
      14:05:48.498 INFO: Seek to: 00:00:00
      14:05:57.492 INFO: Seek to: 00:00:00

      Delete
    17. I don't think it's a bug, but just don't know whats missing.

      eclarativevideobackend" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/bin/video/declarativevideobackend" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/plugins/video/videonode" ...
      QFactoryLoader::QFactoryLoader() looking at "/usr/local/qtpi_5.7.0/plugins/video/videonode/libeglvideonode.so"
      Found metadata in lib /usr/local/qtpi_5.7.0/plugins/video/videonode/libeglvideonode.so, metadata=
      {
      "IID": "org.qt-project.qt.sgvideonodefactory/5.2",
      "MetaData": {
      "Keys": [
      "egl"
      ]
      },
      "className": "QSGVideoNodeFactory_EGL",
      "debug": false,
      "version": 329472
      }


      Got keys from plugin meta data ("egl")
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/bin/video/videonode" ...
      loaded library "/usr/local/qtpi_5.7.0/plugins/video/videonode/libeglvideonode.so"
      Requesting control for org.qt-project.qt.videorenderercontrol/5.0...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/plugins/accessible" ...
      QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/qtpi_5.7.0/bin/accessible" ...
      Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/pi/mov2_Matze.mov':

      Delete
    18. I don't see anything weird here.

      Delete
    19. sorry for posting twice. It's the same output

      Delete
  37. Info: creating stash file /home/lxy/Downloads/qt5.7-install/qt-everywhere-opensource-src-5.7.0/qtmultimedia/.qmake.stash
    Info: creating cache file /home/lxy/Downloads/qt5.7-install/qt-everywhere-opensource-src-5.7.0/qtmultimedia/.qmake.cache
    Checking for openal... no
    /home/lxy/Downloads/qt5.7-install/qt-everywhere-opensource-src-5.7.0/qtmultimedia/qtmultimedia.pro:27: Variable GST_VERSION is not defined.
    Checking for resourcepolicy... no
    Checking for gpu_vivante... no

    When I qmake qmultimedia, it shows as above. Is the checking right?

    ReplyDelete
    Replies
    1. Not sure about GST_VERSION sorry. The rest should be correct.

      Delete
  38. Hi Luca,

    Can you explain how exactly do I build QtMultimedia library today, in April 2017, for Qt 5.8?
    I use Buildroot and I have everything else ready (Qt, ffmpeg), I just need to know what exactly I need to build from your projects and where should I put it, so that Qt knows it's QtMultimedia backend library.

    ReplyDelete
    Replies
    1. A procedure for Raspbian is approximately the one briefly explained above. Adapt then to your env.

      Delete
    2. I managed to adapt POT for Buildroot and it compiles and installs fine. Audio works OK, but I have two problems/questions:
      1) When I try to play video with POT, audio plays, but it says "One frame could not be shown" for every frame, so I just have black screen. Regardless of the codec, and omxplayer works fine in the same environment. Shared OpenGL context is enabled.

      2) How do I use POT HW acceleration with WebEngine? Does it "just work" or is there something that needs to be patched? You said:
      "So, to summarise: a little patch to Chromium is needed to create a VDA that dynamically loads POT library into memory and uses it with a common interface."

      Can you share this patch?

      Delete
    3. 1) You mean that you see no frame at all? No idea, sorry. May depend on your environment, difficult for me to say what is wrong.
      2) No, it does not "just work": a complete decoder is needed to make chromium work. Actually a bit more than a patch... many patches... Sorry, I had to pause that task, I never completed it.

      Delete
    4. This comment has been removed by the author.

      Delete
    5. Here's the log when I try to play any video. In this example I'm playing YT video, but it's the same regardless of the source (HTML, local file or QRC).
      I use eglfs and QQC2 exclusively (without Quick Controls v1) if that means anything.

      https://pastebin.com/QtFTt7YL

      Delete
    6. What do you mean by "any video"? Did you try this http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov for instance?

      Delete
    7. "Any video" means that I tried various HTTP, UDP, local and QRC sources for MPEG2 and MPEG4 videos with various sizes, lengths (recordings and live streams), bit rates, resolutions and sound encodings, including Big Buck Bunny, and everything says "One frame couldn't be shown", but audio always plays fine.

      Here's the log for BBB video: https://pastebin.com/NM438SYe

      Delete
    8. Unfortunately I don't have an answer, sorry. I guess you're not using the prebuilt packages so your environment is different from mine. I've never seen that behaviour.

      Delete
  39. Dear Luca,
    i compiled POT some time ago just for fun and it worked well on the raspberry.
    I would like to compile again but with newer QT (5.15.2) and newer raspberry pi (2B, Armv7 32 Bit) on raspbian Debian (v9, stretch).

    Do you think that still works?
    Thanks a lot!

    ReplyDelete
    Replies
    1. Hello. I'm sorry but POT won't work on pi 4. It works up to pi 3. Pi 4 does not support that kind of acceleration anymore.

      Delete
    2. I have a pi 2B (Armv7 32 Bit), not a pi 4

      Delete
    3. I don't know what "newer raspberry pi" means then, sorry. Pi version < 4 should be ok afaik. Pi versions >= 4 miss part of the drivers needed. Qt version shouldn't be a significant issue.

      Delete
  40. Oh, i am sorry. My question was confusing then.
    But you answered my question already.

    I would like to upgrade to the following setup:
    raspberry pi (2B, Armv7 32 Bit)
    raspbian Debian (v9, stretch)
    QT (5.15.2)

    So, according to your answer, this should work. Excellent.

    ReplyDelete
    Replies
    1. It should theoretically work, yes.

      Delete
    2. For anyone who is following this road.

      I am able to run video (not tried with audio) with the following configuration:
      - raspberry pi 2B (Armv7 32 Bit)
      - raspbian Debian (v9, stretch)
      - QT (5.15.2) -> QML
      - POT 5.7.3

      I used the toolchain provided in this blog.
      There are some minor glitches in the instruction/scripts.
      At the end i am playing a H264 video (known bunny sample), with a CPU usage < 5%
      It seems like, this is still the (only) option to play HW accelerated video on the raspberry with QT5-QML

      :-)
      Thanks a lot.
      Nik

      Delete
  41. Dear Luca,
    Is POT able to show other video codecs than H.264? What would be necessary to do that?
    Thanks Nik

    ReplyDelete
    Replies
    1. Hello, I suppose it should if OpenMAX supports it. I vaguely remember testing mpeg in the past. You'll need a key: https://www.raspberrypi.org/documentation/configuration/config-txt/codeclicence.md. i don't think h265 is supported by OpenMAX, but I never tried.

      Delete