ContinuumIO / anaconda-issues

Anaconda issue tracking
646 stars 220 forks source link

Qt5 multimedia stuck in "Loading" and gstreamer errors #2314

Open maxnoe opened 7 years ago

maxnoe commented 7 years ago

Consider the following example of using qt5 multimedia to play an mp3:

from PyQt5.QtCore import QCoreApplication, QUrl
from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer
from PyQt5.QtWidgets import QApplication
import sys
import os

def handle_state_change(state):
    if state == QMediaPlayer.LoadingMedia:
        print('loading')
    if state == QMediaPlayer.LoadedMedia:
        print('loading finished')
        player.play()
    if state == QMediaPlayer.EndOfMedia:
        print('playing finished')
        QCoreApplication.quit()

app = QApplication(sys.argv)

url = QUrl.fromLocalFile(os.path.abspath('./redalert.mp3'))

content = QMediaContent(url)
player = QMediaPlayer()
player.mediaStatusChanged.connect(handle_state_change)
player.setVolume(50)
player.setMedia(content)

app.exec()

This works fine with the ubuntu system install of qt5, but not with a freshly installed anaconda3. It throws the following errors:


(python:8726): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT (object)' failed

(python:8726): GStreamer-CRITICAL **: gst_object_ref: assertion 'object != NULL' failed

(python:8726): GStreamer-CRITICAL **: gst_bin_add_many: assertion 'GST_IS_ELEMENT (element_1)' failed

(python:8726): GStreamer-CRITICAL **: gst_element_link_pads_full: assertion 'GST_IS_ELEMENT (src)' failed

(python:8726): GStreamer-CRITICAL **: gst_element_get_static_pad: assertion 'GST_IS_ELEMENT (element)' failed

(python:8726): GStreamer-CRITICAL **: gst_ghost_pad_new: assertion 'GST_IS_PAD (target)' failed

(python:8726): GStreamer-CRITICAL **: gst_element_add_pad: assertion 'GST_IS_PAD (pad)' failed

(python:8726): GStreamer-CRITICAL **: gst_object_unref: assertion 'object != NULL' failed

And is stuck in the MediaLoading state.

ccordoba12 commented 7 years ago

Our package probably don't have support for MP3. What happens if you try with Wav files?

maxnoe commented 7 years ago

Same errors and also stuck in Loading.

maxnoe commented 7 years ago

On arch I get

defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"
mingwandroid commented 6 years ago

I tested on Fedora 26 and with a .mp3 I got:

Warning: "No decoder available for type 'application/x-id3.'"
Error: "Your GStreamer installation is missing a plug-in."

and with a .wav I got:

Warning: "No decoder available for type 'audio/x-wav.'"
Error: "Your GStreamer installation is missing a plug-in."

I think we should aim to fix these missing features (along with making sure the webm video codec works well). FWIW (not much probably) on macOS the .mp3 test worked (I didn't check .wav).

@MaxNoe, can you test with Anaconda 5.0.1 on your preferred distros (provided you do not have LD_LIBRARY_PATH set) and verify that you get the same (slightly better but still not of any use) results?

@csoja, can we add this to the 5.1 milestone?

raphmur commented 6 years ago

I just opened an issue ( #8047 ) dealing with missing codecs. Before refreshing my conda install (this morning, Jan 8th 2018) I had the same GLib-GObject-CRITICAL errors. I fixed them by upgrading conda conda upgrade conda.

Now down to missing Gstreamer features... If this can help ;)