Qt5.9.5 multimedia library does not work with webcam on C2

Post Reply
User avatar
chrism
Posts: 3
Joined: Wed Dec 19, 2018 1:46 am
languages_spoken: english
ODROIDs: C2, XU4, USB cam 720
Contact:

Qt5.9.5 multimedia library does not work with webcam on C2

Unread post by chrism » Fri Jan 11, 2019 10:26 pm

Hi All,

I have a rather puzzling problem with Qt5.9.5 webcam support on my C2.

Using the example webcam camera project from the https://doc.qt.io/qt-5/qtmultimedia-mul ... ample.html I have found that it works on my PC and XU4 but not on my C2.

I have verified that the webcam I am using (odroid720) works on the C2 by running the Cheese program and Qt V4L2 Test Utility. The webcam works on the other two platforms as well. The Qt V4L2 test program appears to use the V4L library and does not use the Qt multimedia libraries for accessing the webcam.

When I run the camera program on the C2, all I get is a black view where there should be a live stream. The camera is correctly detected by the program as it is listed in the available devices. If I ignore the fact that there is no live image, I can click the "capture image" button and it will successfully take a picture. There are no obvious errors output by the application apart from some warnings which also appear on my PC and XU4.

I think that this may be a problem with my Qt installation. Has anyone else had any success using the QMultimedia, QMultimediaWidgets, QCamera libraries on their C2?

Regards,
Chris

User avatar
meveric
Posts: 9612
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go
Contact:

Re: Qt5.9.5 multimedia library does not work with webcam on C2

Unread post by meveric » Sat Jan 12, 2019 6:46 am

chrism wrote:
Fri Jan 11, 2019 10:26 pm
I think that this may be a problem with my Qt installation. Has anyone else had any success using the QMultimedia, QMultimediaWidgets, QCamera libraries on their C2?
Very much possible, by default Qt is compiled against OpenGL on arm64 architectures (such as the C2 is using) but most arm64 boards (including the C2) only have OpenGL ES not OpenGL, therefore Qt needs to be recompiled for OpenGL ES to make it work on C2.
I've already used Qt5 applications successfully on the C2 with recompiled QT5, but I haven't specifically tried the webcam app.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

User avatar
odroid
Site Admin
Posts: 29408
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Qt5.9.5 multimedia library does not work with webcam on C2

Unread post by odroid » Mon Jan 14, 2019 11:20 am

Pre-installed Qt library in our C2 Ubuntu 18.04 image was built with OpenGL-ES.
Can you run a Qt OpenGL example?

Code: Select all

sudo apt-get install qtbase5-examples
/usr/lib/arm-linux-gnueabihf/qt5/examples/opengl/hellogl2/hellogl2

User avatar
chrism
Posts: 3
Joined: Wed Dec 19, 2018 1:46 am
languages_spoken: english
ODROIDs: C2, XU4, USB cam 720
Contact:

Re: Qt5.9.5 multimedia library does not work with webcam on C2

Unread post by chrism » Mon Jan 14, 2019 4:55 pm

meveric wrote:
Sat Jan 12, 2019 6:46 am
Very much possible, by default Qt is compiled against OpenGL on arm64 architectures (such as the C2 is using) but most arm64 boards (including the C2) only have OpenGL ES not OpenGL, therefore Qt needs to be recompiled for OpenGL ES to make it work on C2.
I've already used Qt5 applications successfully on the C2 with recompiled QT5, but I haven't specifically tried the webcam app.
The System Information (from within QtCreator) shows that the platform is OpenGL capable:
Platform capabilities: ThreadedPixmaps OpenGL ThreadedOpenGL WindowMasks MultipleWindows ForeignWindows NonFullScreenWindows NativeWidgets WindowManagement SyncState RasterGLSurface SwitchableWidgetComposition

LibGLES Vendor: ARM
Renderer: Mali-450 MP
Version: OpenGL ES 2.0
Shading language: OpenGL ES GLSL ES 1.00
Format: Version: 2.0 Profile: 0 Swap behavior: 0 Buffer size (RGBA): 8,8,8,8 Depth buffer: 24 Stencil buffer: 8
odroid wrote:
Mon Jan 14, 2019 11:20 am
Pre-installed Qt library in our C2 Ubuntu 18.04 image was built with OpenGL-ES.
Can you run a Qt OpenGL example?

Code: Select all

sudo apt-get install qtbase5-examples
/usr/lib/arm-linux-gnueabihf/qt5/examples/opengl/hellogl2/hellogl2
The path

Code: Select all

/usr/lib/arm-linux-gnueabihf/qt5/examples/opengl/hellogl2/hellogl2
does not exist on my installation. However, I do have

Code: Select all

/usr/lib/aarch64-linux-gnu/qt5/examples/opengl/hellogl2
This OpenGL example does work as expected.

User avatar
odroid
Site Admin
Posts: 29408
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Qt5.9.5 multimedia library does not work with webcam on C2

Unread post by odroid » Mon Jan 14, 2019 5:13 pm

Ah... C2 is an aarch64 and your corrected test result says OpenGL-ES works fine with Qt.

But I have no idea how the Qt media framework renders the video output from camera input. :(
I hope other people can help you.

User avatar
chrism
Posts: 3
Joined: Wed Dec 19, 2018 1:46 am
languages_spoken: english
ODROIDs: C2, XU4, USB cam 720
Contact:

Re: Qt5.9.5 multimedia library does not work with webcam on C2

Unread post by chrism » Mon Jan 14, 2019 5:31 pm

Luckily, I can use my XU4 which does work :D

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: leo117 and 3 guests