QWebView and embedded YouTube player - not working properly - qt

My system:
OS: Debian Jessie 64bit
GPU: ATI Mobility Radeon HD 5650 (with proprietary video drivers)
I'm working with PyQt5 and want to embed a QWebView with a YouTube tutorial video inside a QWizardPage. However what I'm getting is the following is really strange:
Video doesn't load at all if I use the embedded link for the video (that is - the embedded YouTube player) which is basically what I want to use and not load the complete YouTube website
If I use the normal link (not embedded) I get not image but there is sound
The playback time is always messed up - I get -Nan:Nan when I however the player's playback trackbar and `
In the terminal (where I start my PyQt5 application from) always gives me the following errors:
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
Especially the last error really baffles me since yes, there is not JACK server running because I don't use JACK (I use PulseAudio and ALSA depending on the case). Does QWebView require JACK on Linux systems?
Here is a screenshot of my QWizard and the respective QWizardPage:
The code I use is as follows (the URL is just an example (video is mine) for the purpose of this post):
class CalibrationPageWelcome(QWizardPage):
'''
Gives an overviewo of the calibration procedure including some external URLs to tutorials
'''
def __init__(self, parent):
super(CalibrationPageWelcome, self).__init__(parent)
self.setTitle('Calibration Wizard')
self.setSubTitle('The wizard will guide you through the process of calibrating your camera device.')
layout = QVBoxLayout()
label = QLabel('''
Before you continue make sure you are familiar with the process of calibration.
The video below will give a brief explanation what the calibration process is for
and how it will be done using this wizard
''')
label.setWordWrap(True)
layout.addWidget(label)
view = QWebView()
# TODO Add link to tutorial about calibrating a camera using patterns and OpenCV
view.load(QUrl('https://www.youtube.com/embed/5sOiGJRyoBI'))
layout.addWidget(view)
self.setLayout(layout)
Any idea what is going on here?

Make sure you have the appropriate GStreamer dependencies installed - on Debian Jessie this should be:
apt-get install gstreamer1.0-plugins-{bad,base,good,ugly}

Related

Qt: Switching 'virtual desktops' on linux makes the multimediawidgets/videographicsitem example, stop displaying the video

If you've got the Qt 5.12.8 (the version that ships with Ubuntu 20.04) examples installed + built, start playing a video with it, switch virtual desktops and the video stops (you can't hear it). Come back, and the widget is white, in some sense it forgot the video. The example's 'brother', multimediawidgets/videowidget, works as you'd expect: start playing a video, go to another virtual desktop, you can hear it still playing, come back, and it's carried on as you'd expect. Interestingly, if you first pause the video in the videographicsitem example, do the switch-and-back, the video correctly still shows and is resumable when you come back, so, it's just if you switch while playing. I presume it's a bug - can anyone think of a workaround? Thanks.
edit: This is the same for Qt 5.15.2, the latest Qt 5.x as I write. As for Qt 6.2.x (latest as I write), it didn't have that example - I've read that totally new versions of Qt take a while to get the multimedia stuff.

Qt control not working properly in custom Linux

I'm trying to develop a Qt application to a custom linux built with Buildroot for Raspberry PI 4. My goal is to make an GUI through Touch interface and for that I'm using an USB Infrared frame.
My Problem
When I try to interact with a frame, I can move the dial, but when i try to use another dial it behaves like the first pressed dial didn't get released (like when you press mouse 1 and don't release it anymore).
It just stays selected and I can't interact with any other thing in the application.
I run the program using this command :
./dials -platform linuxfb
and here is the frame I am talking about.
What I tried so far
I tried some of the examples provided by Qt that came with buildroot. They seem to work just fine with the mouse in both the Raspberry and in Ubuntu (my PC). Also I tried the same examples in Ubuntu with the touch frame and they also worked flawlessly .
I've set QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS:/dev/input/event1 , if I don't do this it doesn't even move anything.

Problem when deploying Qt app on Raspberry Pi 4 (Could not queue DRM page flip on screen HDMI1 (Invalid argument))

I've compiled Qt5.15.0 and set up cross-compiler on my host machine (Ubuntu 20.04) and managed to cross-compile a simple Hello World app for my Raspberry Pi 4, however, when I deploy and run it (tried both on Qt Creator and in terminal) I get Could not queue DRM page flip on screen HDMI1 (Invalid argument) I use latest Raspbian image and tried both with lite and full desktop versions.
There are some solutions suggesting to set the environment variables;
QT_QPA_EGLFS_ALWAYS_SET_MODE=1
QT_QPA_EGLFS_KMS_ATOMIC=1
But I had no luck with setting them.
I don't know where the problem is, I'm very new to Qt.
For those who has the same problem here is how I solved;
Somehow I discovered that Raspberry Pi does not set the environment variable QT_QPA_EGLFS_ALWAYS_SET_MODE. You can check that by typing
printenv QT_QPA_EGLFS_ALWAYS_SET_MODE
or
echo $QT_QPA_EGLFS_ALWAYS_SET_MODE
in both cases, you should see 1 as a result if you've set it so.
However I got no response when I typed them.
Then I went and opened .profile and added
QT_QPA_EGLFS_ALWAYS_SET_MODE=1
at the end of the file and rebooted the system. Finally there it was, when I echoed the variable it returned 1, and my programs now work pretty well.
The variables should be set in:
/etc/default/qt
See QTBUG-72539 in the Qt bug tracking.

Running videos on JavaFX in Raspberry Pi Zero

I am trying to run a program which shows a simple video through mediaView and then shows a QR code that is associated with a string that the program generates on javaFX in a Raspberry Pi Zero. I have tried to follow this answer Play a video using JavaFX on Raspberry Pi but I get the following problems:
I try to install Gluon following this tutorial (https://docs.gluonhq.com/embedded/#_setting_up_the_raspberry_pi) but I get the following error message when I try to run a JavaFX application WITHOUT video which simply has a button that when pressed show "Hello World":
Error occurred during initialization of VM
Server VM is only supported on ARMv7+ VFP
It seems that Gluon doesn't work with the Raspberry Pi Zero but I am not sure.I must say that in order to follow the answer mentioned above I fully reinstalled the Raspberry Pi OS so it's up to date and previously I had been able to run JavaFX applications without video but not using Gluon.
Also when trying to install the gstreamer packages they all seem to be outdated and I can't install them.
So I would be very thankful if anyone could tell me how to not only properly install Gluon on Raspberry Pi Zero but also the needed packages in order to run the video. If you see that this is impossible do you have any ideas how to replicate this program in another language in order to make it work on my Raspberry Pi Zero
From that tutorial you have linked it states it is using Java 11 which your Pi Zero (ARMv6) doesn't support.
You will need supported hardware.
EDIT : If you wish to just play videos & use QR on your Pi Zero using JavaFX you can using Java8 instead.

Beaglebone Black, Qt Application, and startup procedure

I have a BBB running Debian 3.18.13-bone70. I have made a Qt application that works great. I would like this application to run on startup.
Currently, I have made a script, placed it in /etc/init.d and made a symbolic link to it in /etc/rc5.d/S05application. This all functions correctly.
The issue that I'm having is when my system boots up, I see my application briefly (<1 second) before the CLI login screen appears and hides my application.
I've tried playing around with the startup script location (moving it to rc2.d, but the same issue persists.
I have a splash screen that times out after 10 seconds, and it moves on to the next screen. After moving to the next screen the application is never hidden again. I would like to see the splash screen the entire time and hide the CLI login screen entirely. How could I go about doing this?
EDIT:
#!/bin/bash
export QWS_MOUSE_PROTO=tslib:/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_TSDEVICE=/dev/input/event1
/home/root/./Scanscale -qws
This is the script that I use to start the application. The Qt window service is used when I start the program.
EDIT 2:
I'm running Debian 7 using the Debian 7 image from http://elinux.org/Beagleboard:BeagleBoneBlack_Debian from March 1, 2015. This is maintained by Robert Nelson, I'm not sure if it's a yocto build or something else.
Furthermore, it doesn't appear to be an X issue. I've stopped loading X, I no longer boot into the application and just sit on the command line waiting to log in. The system flickers at about the same point in time. Any thoughts?
I should probably also mention that I'm running it on a 4.3" LCD cape, not on the HDMI interface.
You weren't specific about your system and what else is running on it. For example, is it a yocto build and does it run the sato user interface, or is it more traditional X server with a display manager, window manager, etc? Either way, there is a session-specific file which directs what programs get launched when the Xserver starts up. Using matchbox, that file is .matchbox/session. With X, it's usually xinit, which is driven by .xinitrc or .xserverrc. Also, look at startx as another poster mentioned. The latter can either be in your home directory or /etc/X11. Depending on your system and configuration, likely one of those methods, customized, is what you're looking for. See man xinit for more info.

Resources