Qt multimeia GStreamer-Critical error!
-
i start to debug my project there are errors:
(FMT:4908): GStreamer-CRITICAL **: gst_object_ref_sink: assertion 'GST_IS_OBJECT (object)' failed(FMT:4908): GStreamer-CRITICAL **: gst_object_ref_sink: assertion 'GST_IS_OBJECT (object)' failed
(FMT:4908): GStreamer-CRITICAL **: gst_element_set_state: assertion 'GST_IS_ELEMENT (element)' failed
my host is ubuntu 16.04, and my Qt is 5.7.1 version.
i try to play a .wmv with my project. and i can play the file with double-click
can someone helps me?
-
@JiujiuTong Could be that some GStreamer plug-ins are missing. You can see here (for Ubuntu) what packages can be installed. I'm not sure which one contains WMV codec.
But first you should try to play the WMV file using the GStreamer command line client, see here https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/using.html
-
@jsulm
thank you, i just install all the plugins and there is no such error
. I try to play the media .wmv with GStreamer command line client.
it works well . but anther erro happen when i try to play the medias, error info:
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
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
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 startedmy code is(partial) :
///ppath the directory of medias , path like "/home/XXX"
QDir ppath= getCurrentpathparent();
//list a QList contains media names
foreach(MEDIA_PLAYINFO var,list)
{
QString file = ppath.filePath(var.medianame);
if(QFile(file).exists())
{
QMediaContent cont(QUrl::fromLocalFile(file));
//m_playlist is a QMediaPlaylist
m_playlist->addMedia(cont);
}
}
m_playlist->setCurrentIndex(0);
m_playlist->setPlaybackMode(QMediaPlaylist::Loop);
///////////////
the error happen after m_playlist->setCurrentIndex(0) when debug.
this code runs with no error on windows , is there something wrong? thankyou!
or
-
Hi,
Did you check that you have all plugin packages installed on your distribution ?
-
@SGaist
do you mean Gstreamer plugins?
i try to follow the tips "Install GStreamre on Ubuntu or Debian" inbelow
https://gstreamer.freedesktop.org/documentation/installing/on-linux.html
but the command fails ,so i do not know exactly how many plugins for GStreamer...
-
What exact command did you use ?
-
@JiujiuTong On that page it is:
apt-get install ....
this for sure cannot work - you need to replace .... with actual package names.
Looks like GStreamer folks do not like/use Debian/Ubuntu :-)
-
It might be something like
sudo apt-get install ubuntu-restricted-extras
some also had to do
apt-get install gstreamer0.10-alsabut it was in older ubuntu. Didnt try in newest.
https://ubuntuforums.org/showthread.php?t=1101525
-
@SGaist @jsulm @mrjj
i use the following command
sudo apt-get gstreamer1-devel gstreamer1-plugins-base-tools gstreamer1-devel-docs gstreamer1-plugins-base-devel gstreamer1-plugins-base-devel-docs gstreamer1-plugins-good gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-ugly-devel-docs gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-devel gstreamer1-plugins-bad-free-extras.
these plugins seems do not exist.so i use sudo apt-cache search gstreamer* , and install many plugins,
including gstreamer1.0-plugins-ugly, gstreamer1.0-plugins-bad, gstreamer1.0-plugin-good
now there is only one warning:
GStreamer: unable to pause pause- "file:///home/tong/src/Wildlife.wmv"
warning: no decoder available for type "video/x-ms-asf"
seems need to install decoders...another question:
As my target is rapsberry pi3,i try to play video with default GStreamer command,the video is not fluency. i need to enable hardware-accelerate when using QT to play video, Does QT support this feature when play video? how to enable it ? thank you !
-
Install gstreamer1-plugins-ugly plug-in for video/x-ms-asf
-
@jsulm @SGaist @mrjj
there seems something strange, as Gstreamer0.10-plugins-ugly is no longer available, when i remove all gstreamer0.1 packages, i try to run my project, there is info:
defaultserviceprovider::requestservice(): no service found for - "org.qt-project.qt.mediaplayer".
then i reinstall all gstreamer0.1 packages.
the info is :
GStreamer: unable to pause pause- "file:///home/tong/src/Wildlife.wmv"
warning: no decoder available for type "video/x-ms-asf"
does it mean QT still use gstreamer0.1 package?
but gstreamer0.10-plugins-bad, gstreamer0.10-plugins-ugly no long available.
i have installed gstreamer1.0-plugins-ugly, gstreamer1.0-plugins-bad, gstreamer1.0-plugin-good.
-
@JiujiuTong said in Qt multimeia GStreamer-Critical error!:
but gstreamer0.10-plugins-bad, gstreamer0.10-plugins-ugly no long available
Are you sure: https://launchpad.net/ubuntu/xenial/+package/gstreamer0.10-plugins-ugly ?
Did you activate "universe", "restricted" and "multiverse" repositories?
-
@jsulm
i have check all repositories in ubuntu software tab.
are there other ways to check the repositories ?
-
@JiujiuTong Did you activate universe repository?
If so thensudo apt-get install gstreamer0.10-plugins-ugly
should be enough.
I'm usually using synaptic graphical tool - you can search for gstreamer0.10-plugins-ugly there as well and check whether universe repository is activated.
Also you can useapt-cache search gstreamer0.10-plugins-ugly
to search.
-
@jsulm
i have checked the four repositories in system settings ->software& updates->ubuntu software tab.
but failed to run sudo apt-get install gstreamer0.10-plugins-ugly
info:
Package gstreamer0.10-plugins-ugly is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another sourceE: Package 'gstreamer0.10-plugins-ugly' has no installation candidate
-
@JiujiuTong OK, looks like it is really not available on Ubuntu 16.04
-
@jsulm @SGaist @mrjj
Then what should i do with my project ?
is there anyway to combine the QT with gstreamer1.0 ?
-
@JiujiuTong Can you play this file with, for example, VLC?
-
IIRC, since 5.8 the backend uses GStreamer 1.0. Otherwise, you can re-build the QtMultmedia module yourself against GStreamer 1.0
On a side note, unless you need specific features or bug fixes of more recent versions, why not use your distribution provided Qt for development ?
-
@jsulm
yes,i can play file with VLC, but there are some other logical with my project, and i need to control playlist and other thing. so i think the best way is use functions provided by QT.
-
@JiujiuTong I didn't say you should use VLC - I only wanted to know whether the file is broken.
-
@jsulm
the file is OK, it can be played by double click
-
@SGaist
sorry for my poor English, do you mean i should use the latest QT version ?
-
It depends on what you need, either use the Qt from your distribution or indeed a more recent version. Current is 5.8.0 and 5.9Beta2 is available.
-
@SGaist
well ,Thank you
i will try to compile QT5.7.1 against GStreamer 1.0. can you give me some instructions? thank you!
another thing is how to support hardware-accelerate? or it support it by default,but the default behavior of Gstreamer seem not enable hardware-accelerate.
my project finally runs on raspberry pi3, i do a lot efforts to make the QT5.7 deployed on rpi3. i'm worried about QT5.8....
i find a description:
1,install gstream1.0*
install libgstreamer1.0*
2, cd qt5.7.1
run ./configure -gstreamer 1.0
make
make install
is it right?
-
You don't need to re-build everything, if you already have a build then just re-build the QtMultimedia module.
-
@SGaist
what should i do if i just want to rebuild QtMultimeida module with Gstreamer1.0? i have installed a QT with older GStreamer.
thank you !
-
@SGaist @jsulm @mrjj
i finish the reinstall work with all modules rebuild,the output result is still NG.
play the video with gstreamer command the output is below:
gst-play-1.0 /home/tong/build-FMT-gstream1_0-Debug/src/Wildlife.wmv
Press 'k' to see a list of keyboard shortcuts.
Now playing /home/tong/build-FMT-gstream1_0-Debug/src/Wildlife.wmv
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
Redistribute latency...
Redistribute latency...
Redistribute latency...
0:00:30.0 / 0:00:30.0
Reached end of play list.
the video can play normally.while the output of my project (also the same result with QT example):
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
just pops a blackscreen ,no video shows. strange...when i try to install gstreamer1.0
there is an error:
gstreamer1.0-hybris:i386:Depends: libmedia1:i386 but it is no going to be installed
E: Unable to correct problems, you have held broken packages.
-
Is that on your Pi or on your desktop ? If on your Pi then there's something strange since it talks about a i386 version of the package and the Pi is an ARM based machine.
-
@JiujiuTong said in Qt multimeia GStreamer-Critical error!:
gstreamer1.0-hybris:i386:Depends: libmedia1:i386
Are you trying to install x86 (32bit) version?
-
@SGaist @jsulm
currently , i just test on my ubuntu. my host is x64bit. i install gstreamer1.0 with command sudo apt-get install gstreamer1.0
and can help give steps about how to rebuild only qtmultimedia module with gstreamer1.0?
-
This post is deleted!
-
Please show the command you use to install the GStreamer packages.
-
@SGaist
the command line is :
1,sudo apt-get install gstreamer1.0
2,sudo apt-get install libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstreamer1.0-0 libqgsttools-p1 libqt5multimedia5-plugins gstreamer1.0-libav libges-1.0-dev libgstreamer-plugins-bad1.0-dev libgstreamermm-1.0-0v5 libgstreamermm-1.0-dev libqt5gstreamer-1.0-0 libqt5gstreamer-dev libqt5gstreamerquick-1.0-0 libqt5gstreamerui-1.0-0 libqt5gstreamerutils-1.0-0 libqtglib-2.0-0 libqtgstreamer-1.0-0 libqtgstreamer-dev libqtgstreamerui-1.0-0 libqtgstreamerutils-1.0-0 qtgstreamer-plugins-qt5 qtgstreamer-plugins ubuntu-restricted-extras
some packages may be useless,i don't know exactly.
when trying to rebuild QtMultimedia module with gstreamer1.0 ,following the steps:
1, run command1 && command 2,
2, cd qt5.7.1
run ./configure -gstreamer 1.0
(NO need to rebuild qtbase and other modules.)
3, cd to qtmultimedia folder
run qmake
run make install
is it right? thank you !
-
Which qmake did you use ?
-
@SGaist
the qmake is the path of qt5.7.1 installed ,it was generated by the last make install (with default gsteamer 0.1), is it right way as you mentioned ¨just re-build the QtMultimedia module. ¨?
-
Which version exactly ? You seem to have started by configuring a new version of Qt rather than build the QtMultimedia module with the version your already installed.
-
@SGaist
the version is QT5.7.1 i have install with QtMultimedia using gstreamer0.1.
i try to rebuild the QtMultimedia module with the version i already installed,
should i parse what parameters to let the QtMultimedia module know that it should use gstreamer1.0 instead of gstreamer0.1? can you give instructions please?
-
@SGaist @jsulm
thank you for your great support,
but i found a strange thing:
i can not play the .wmv or .mp4 video even when i try to use QT5.8(install by qt-opensource-linux-x64-5.8.0.run, host is ubuntu 16.04),
after i install Qt5.8, i use the Qtcreator4.2.1 to open the project player under multimediawidgets Example, run the example, and open a Wildlife.wmv(example video under windows 7), try to play it ,just no video .output is :
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0I installed gstreamer with following commands:
1,sudo apt-get install gstreamer1.0
2,sudo apt-get install libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstreamer1.0-0 libqgsttools-p1 libqt5multimedia5-plugins gstreamer1.0-libav libges-1.0-dev libgstreamer-plugins-bad1.0-dev libgstreamermm-1.0-0v5 libgstreamermm-1.0-dev libqt5gstreamer-1.0-0 libqt5gstreamer-dev libqt5gstreamerquick-1.0-0 libqt5gstreamerui-1.0-0 libqt5gstreamerutils-1.0-0 libqtglib-2.0-0 libqtgstreamer-1.0-0 libqtgstreamer-dev libqtgstreamerui-1.0-0 libqtgstreamerutils-1.0-0 qtgstreamer-plugins-qt5 qtgstreamer-plugins ubuntu-restricted-extras
can you check it for me? the video is OK, i can play it with gst-play-1.0 or with double click.
ps: i try to play a *.mp3, it works well, and there are sounds playing with no pictures if the format is mp4