OpenGL trouble on Ubuntu
Attempting to manipulate the "alpha" parameters for either videos or pictures causes a few problems
on video, alpha can only be 1 or -1. when sending -1 first then 1, the video seems to start again from the beginning.
On pictures it doesn't seem to work at all and causes great cpu strain
In the terminal, a few error seem to pop up but I can never relay link it to a particular event.
/ITL/scene/Video_1 error invalid media
/ITL/scene/Video_1 error Internal data stream error.
VMediaPlayer::error QMediaPlayer::ResourceError
These happen with the video (but neither upon first loading or playing, just during the manipulation of "alpha").
VGraphicsItemView::~VGraphicsItemView fTilerItems: 0
This one crop up with both video and Pictures.
tested on ubuntu 19.10
Could you send a script, the Qt version you're using and INscore version too? Did you notice that alpha values interpretation is type dependant? (see the doc section 2.3): the range for float values is -1.,1. while integers range is 0,255 Do you have this problem only with opengl on? what happens when off? Regarding the video, it's highly dependent on the video encoding and on the system layer used to play it. I'm really not an expert on that on ubuntu. I can't reproduce on MacOS and I don't have an Ubuntu station at hand right now and I won't be able to check before a couple of weeks.
Here is the script :
# affiche la fenêtre de messages
/ITL/log show 1;
# supprime tous les éléments (si il y en a)
/ITL/scene/* del;
# fenêtre au noir, support opengl et sans pleine écran
/ITL/scene color 0 0 0;
/ITL/scene opengl 1;
#/ITL/scene fullscreen 1;
# etage vidéo
/ITL/scene/Video_1 set video '/home/thibaud/Vidéos/GaronneCopie.mov';
/ITL/scene/Video_1 alias '/ITL/scene/Video_1/scale' scale;
/ITL/scene/Video_1 alias '/ITL/scene/Video_1/play' play;
/ITL/scene/Video_1 alias '/ITL/scene/Video_1/rate' rate;
/ITL/scene/Video_1 alias '/ITL/scene/Video_1/alpha' alpha;
/ITL/scene/Video_1 alias '/ITL/scene/Video_1/pos' x y z;
/ITL/scene/Video_1 alias '/ITL/scene/Video_1/vdate' vdate;
127.0.0.1:9997/ITL/scene/Video_1 "" "";
127.0.0.1:9997/ITL/scene/Video_1/scale 1.;
127.0.0.1:9997/ITL/scene/Video_1/play 1;
127.0.0.1:9997/ITL/scene/Video_1/rate 1.;
127.0.0.1:9997/ITL/scene/Video_1/alpha 1.;
127.0.0.1:9997/ITL/scene/Video_1/pos 0. 0. -1.;
127.0.0.1:9997/ITL/scene/Video_1/vdate 0;
# envoie le nom de la série une fois chargée
/ITL/scene watch endPaint (127.0.0.1:9997/ITL/scene/Serie "Video");
Qt version is 5.12.4 Inscore version 1.24 (latest commit on dev branch)
All works great without opengl. And I don't have any issues with types, (either float or int)
I wonder If opengl support may not have been completely built as I wasn't able to invoque -DGL=1 when building guidolib (I'll share the issue on the guidolib page)
Is there maybe a make invocation for inscore to be sure opengl support is built ?
Actually, opengl is supported using a QGLWidget (see VSceneView.cpp line 326). Thus opengl support is built in Qt. In inscore, you could try to change the GL format used (currently QGLFormat(QGL::SampleBuffers)) to see if there is one that solves the problem. I don't remember why SampleBuffers is used but there was probably a good reason at that time. Regarding Guido, the GL option has nothing to do with Qt opengl support
Ok, thanks for the tip and the link ! I'll have look and will let you know.
I tried a few different GL format (I had great hopes for QGL::AlphaChannel) but no luck so far.
Videos still dosen't respond to "alpha". (-1 values stops it from playing and generates the "invalid media" error, changing the value again from -1 replays from the bigging).
Using the Satndalone/Video with the oglcontrol script example also prevent going to the next video.
This issue also prevents an image (.jpg) from appearing. Here is the simple script I used. With opengl 0, everything works as usual
# affiche la fenêtre de messages
/ITL/log show 1;
# supprime tous les éléments (si il y en a)
/ITL/scene/* del;
# fenêtre au noir, support opengl et pleine écran
/ITL/scene color 0 0 0;
/ITL/scene opengl 1;
/ITL/scene fullscreen 0;
# assigne des adresses à des objets (photos, textes ... )
/ITL/scene/Karlax_00 set img '/home/thibaud/Images/3 Detroit.jpg';
# assignes nouvelle adresse à certains paramêtres
/ITL/scene/Karlax_00 alias '/ITL/scene/Karlax_00/alpha' alpha;
/ITL/scene/Karlax_00 alias '/ITL/scene/Karlax_00/scale' scale;
# envoi pour osc learn;
127.0.0.1:9997/ITL/scene/Karlax_00 "" "";
127.0.0.1:9997/ITL/scene/Karlax_00/alpha -1.;
127.0.0.1:9997/ITL/scene/Karlax_00/scale 1.;
# redimentionne les images et textes ( taille de caractères )
/ITL/scene/Karlax_00 scale 0.258;
# rend transparent tous les objets
#/ITL/scene/* alpha -1.;
# envoie le nom de la série une fois chargée
/ITL/scene watch endPaint (127.0.0.1:9997/ITL/scene/Serie "Alteration");
Well!, I did some tests on a Debian 8 with Qt 5.9.1 and I think I can reproduce your issues. Actually everything works fine with or without opengl, provided the video alpha is not completely transparent. When the alpha channel is -1. and as you report, the video stops playing and an error is triggered: "error GStreamer encountered a general stream error".
I have the feeling there's not much I can do about it. Video streaming is fully supported by Qt and moreover, it seems that the error comes from lower system layers. There is a workaround: set the alpha channel to a low value, close to -1, e.g. -0.99: the video is not visible but still plays correctly.
Warning: it seems that very low values are interpreted as -1, e.g. 0.999 doesn't work and triggers the same error.
Same behavior on Ubuntu 16.04 and Qt 5.10.0. Note that I get the Gstreamer error with alpha=-1 also when opengl is off. (I didn't check on Debian).